From 0e0fc4807f330c705a81e3ae19c8948ea71b5f49 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Tue, 5 Mar 2013 21:56:28 +0100 Subject: [PATCH] breakp2.c: allow v(12) and i(vdd) in 'save' command --- src/frontend/breakp2.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/frontend/breakp2.c b/src/frontend/breakp2.c index f636116f8..354cf614d 100644 --- a/src/frontend/breakp2.c +++ b/src/frontend/breakp2.c @@ -22,6 +22,7 @@ struct dbcomm *dbs = NULL; /* export for iplot */ /* used in breakp.c and breakp2.c */ int debugnumber = 1; +static char *copynode(char* s); /* Analyse the data given by the .save card or 'save' command. Store the data in the global dbs struct. @@ -82,7 +83,8 @@ settrace(wordlist *wl, int what, char *name) d->db_type = DB_SAVE; break; } - d->db_nodename1 = copy(s); + /* v(2) --> 2, i(vds) --> vds#branch */ + d->db_nodename1 = copynode(s); /* wrd_chtrace(s, TRUE, what); */ } @@ -131,3 +133,32 @@ ft_getSaves(struct save_info **savesp) return (count); } + +/* v(2) --> 2, i(vds) --> vds#branch, 3 --> 3, @mn1[vth0] --> @mn1[vth0] +( derived from wordlist *gettoks(char *s) ) +*/ +static char* copynode(char *s) +{ + char *l, *r; + char *ret = NULL; + + if (strstr(s, "(")) + s = stripWhiteSpacesInsideParens(s); + + l = strrchr(s, '('/*)*/); + if (!l) { + ret = copy(s); + return ret; + } + + r = strchr(s, /*(*/')'); + *r = '\0'; + if (*(l - 1) == 'i' || *(l - 1) == 'I') { + char buf[513]; + sprintf(buf, "%s#branch", l + 1); + ret = copy(buf); + } else + ret = copy(l + 1); + + return ret; +} \ No newline at end of file