From ad77554a032c48a7ce5fc724ece7807f80b7cde9 Mon Sep 17 00:00:00 2001 From: drow Date: Mon, 10 Mar 2003 23:37:29 +0000 Subject: [PATCH] * breakpoint.c (bpstat_copy): Copy the command lines as well as the old value, to match what is freed in bpstat_clear. --- gdb/ChangeLog | 5 +++++ gdb/breakpoint.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e2adc4bbbe..9407556ae6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-03-10 Klee Dienes + + * breakpoint.c (bpstat_copy): Copy the command lines as well + as the old value, to match what is freed in bpstat_clear. + 2003-03-10 David Carlton * minsyms.c (add_minsym_to_hash_table): Replace diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f27f3fc556..638935c274 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; -- 2.11.0