summaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2003-03-10 23:37:29 +0000
committerDaniel Jacobowitz <dan@debian.org>2003-03-10 23:37:29 +0000
commit24929381cb0c53dc396915b959aee9953157b7ad (patch)
tree09260707716f88db1a37224995c77c95f48cc1c7 /gdb/breakpoint.c
parentde05c1e66e25b331cac8865cb788734a0ba73511 (diff)
downloadgdb-24929381cb0c53dc396915b959aee9953157b7ad.tar.gz
* breakpoint.c (bpstat_copy): Copy the command lines as well
as the old value, to match what is freed in bpstat_clear.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index f27f3fc556e..638935c274e 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1816,6 +1816,11 @@ bpstat_copy (bpstat bs)
{
tmp = (bpstat) xmalloc (sizeof (*tmp));
memcpy (tmp, bs, sizeof (*tmp));
+ if (bs->commands != NULL)
+ tmp->commands = copy_command_lines (bs->commands);
+ if (bs->old_val != NULL)
+ tmp->old_val = value_copy (bs->old_val);
+
if (p == NULL)
/* This is the first thing in the chain. */
retval = tmp;