This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
broken code
- To: Insight List <insight at sourceware dot cygnus dot com>
- Subject: broken code
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 30 Nov 2000 21:01:06 -0700
- Reply-To: tromey at cygnus dot com
I see this in gdbtk-hooks.c:
xasprintf (&buf, "gdbtk_tcl_breakpoint %s %d 0x%lx %d {%s} {%s} %d %d",
action, b->number, (long) b->address, b->line_number, filename,
bpdisp[b->disposition], b->enable, b->thread);
In general, code like this is simply broken. Using `{%s}' works for
some situations, but not others. It seems to work, since it works in
the common cases, but it makes gdbtk less robust.
If you need to build a list, you should use the Tcl DString functions.
Maybe everybody working on the code already knows this. I don't know.
I didn't look to see who writes this sort of thing (I'd rather not
know :-).
Tom