Browse Source

breakp2.c, settrace(), cleanup #2/2

pre-master-46
rlar 10 years ago
parent
commit
7fc6609821
  1. 35
      src/frontend/breakp2.c

35
src/frontend/breakp2.c

@ -50,7 +50,6 @@ void
settrace(wordlist *wl, int what, char *name) settrace(wordlist *wl, int what, char *name)
{ {
struct dbcomm *d, *last; struct dbcomm *d, *last;
char *s;
if (!ft_curckt) { if (!ft_curckt) {
fprintf(cp_err, "Error: no circuit loaded\n"); fprintf(cp_err, "Error: no circuit loaded\n");
@ -63,44 +62,48 @@ settrace(wordlist *wl, int what, char *name)
else else
last = NULL; last = NULL;
while (wl) {
s = cp_unquote(wl->wl_word);
d = TMALLOC(struct dbcomm, 1);
d->db_number = debugnumber++;
d->db_analysis = name;
for (;wl ;wl = wl->wl_next) {
char *s = cp_unquote(wl->wl_word);
char *db_nodename1 = NULL;
char db_type = 0;
if (eq(s, "all")) { if (eq(s, "all")) {
switch (what) { switch (what) {
case VF_PRINT: case VF_PRINT:
d->db_type = DB_TRACEALL;
db_type = DB_TRACEALL;
break; break;
/* case VF_PLOT: /* case VF_PLOT:
d->db_type = DB_IPLOTALL;
db_type = DB_IPLOTALL;
break; */ break; */
case VF_ACCUM: case VF_ACCUM:
/* d->db_type = DB_SAVEALL; */
d->db_nodename1 = copy(s);
d->db_type = DB_SAVE;
/* db_type = DB_SAVEALL; */
db_nodename1 = copy(s);
db_type = DB_SAVE;
break; break;
} }
/* wrd_chtrace(NULL, TRUE, what); */ /* wrd_chtrace(NULL, TRUE, what); */
} else { } else {
switch (what) { switch (what) {
case VF_PRINT: case VF_PRINT:
d->db_type = DB_TRACENODE;
db_type = DB_TRACENODE;
break; break;
/* case VF_PLOT: /* case VF_PLOT:
d->db_type = DB_IPLOT;
db_type = DB_IPLOT;
break; */ break; */
case VF_ACCUM: case VF_ACCUM:
d->db_type = DB_SAVE;
db_type = DB_SAVE;
break; break;
} }
/* v(2) --> 2, i(vds) --> vds#branch */ /* v(2) --> 2, i(vds) --> vds#branch */
d->db_nodename1 = copynode(s);
db_nodename1 = copynode(s);
/* wrd_chtrace(s, TRUE, what); */ /* wrd_chtrace(s, TRUE, what); */
} }
tfree(s); /*DG avoid memoy leak */ tfree(s); /*DG avoid memoy leak */
d = TMALLOC(struct dbcomm, 1);
d->db_analysis = name;
d->db_type = db_type;
d->db_nodename1 = db_nodename1;
d->db_number = debugnumber++;
if (last) if (last)
last->db_next = d; last->db_next = d;
@ -108,8 +111,6 @@ settrace(wordlist *wl, int what, char *name)
ft_curckt->ci_dbs = dbs = d; ft_curckt->ci_dbs = dbs = d;
last = d; last = d;
wl = wl->wl_next;
} }
} }

Loading…
Cancel
Save