Browse Source

breakp2.c: allow v(12) and i(vdd) in 'save' command

pre-master-46
h_vogt 13 years ago
committed by rlar
parent
commit
79a9fdbcd7
  1. 37
      src/frontend/breakp2.c

37
src/frontend/breakp2.c

@ -22,6 +22,8 @@ struct dbcomm *dbs = NULL; /* export for iplot */
/* used in breakp.c and breakp2.c */ /* used in breakp.c and breakp2.c */
int debugnumber = 1; int debugnumber = 1;
static char *copynode(char* s);
/* Analyse the data given by the .save card or 'save' command. /* Analyse the data given by the .save card or 'save' command.
Store the data in the global dbs struct. Store the data in the global dbs struct.
@ -82,7 +84,8 @@ settrace(wordlist *wl, int what, char *name)
d->db_type = DB_SAVE; d->db_type = DB_SAVE;
break; break;
} }
d->db_nodename1 = copy(s);
/* v(2) --> 2, i(vds) --> vds#branch */
d->db_nodename1 = copynode(s);
/* wrd_chtrace(s, TRUE, what); */ /* wrd_chtrace(s, TRUE, what); */
} }
@ -131,3 +134,35 @@ ft_getSaves(struct save_info **savesp)
return (count); 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;
}
Loading…
Cancel
Save