diff options
author | Daniel Jacobowitz <drow@false.org> | 2002-12-04 04:53:13 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2002-12-04 04:53:13 +0000 |
commit | d8ef46f5faa8a4d71f626d08a6a28359435bce6b (patch) | |
tree | 23b4e11c2d51985429cd804fb8d2fdd14eca58bc /gdb/breakpoint.c | |
parent | 02ae777101c4e5debdf1277352997702fd1d4961 (diff) | |
download | gdb-d8ef46f5faa8a4d71f626d08a6a28359435bce6b.zip gdb-d8ef46f5faa8a4d71f626d08a6a28359435bce6b.tar.gz gdb-d8ef46f5faa8a4d71f626d08a6a28359435bce6b.tar.bz2 |
* breakpoint.c (create_thread_event_breakpoint): Use xasprintf.
(create_breakpoints): Make sure the addr_string field is not
NULL.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 7418c41..cf3da5e 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4010,14 +4010,12 @@ struct breakpoint * create_thread_event_breakpoint (CORE_ADDR address) { struct breakpoint *b; - char addr_string[80]; /* Surely an addr can't be longer than that. */ b = create_internal_breakpoint (address, bp_thread_event); b->enable_state = bp_enabled; /* addr_string has to be used or breakpoint_re_set will delete me. */ - sprintf (addr_string, "*0x%s", paddr (b->address)); - b->addr_string = xstrdup (addr_string); + xasprintf (&b->addr_string, "*0x%s", paddr (b->address)); return b; } @@ -4573,7 +4571,12 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string, b->number = breakpoint_count; b->cond = cond[i]; b->thread = thread; - b->addr_string = addr_string[i]; + if (addr_string[i]) + b->addr_string = addr_string[i]; + else + /* addr_string has to be used or breakpoint_re_set will delete + me. */ + xasprintf (&b->addr_string, "*0x%s", paddr (b->address)); b->cond_string = cond_string[i]; b->ignore_count = ignore_count; b->enable_state = bp_enabled; |