* breakpoint.c (bpstat_copy): Copy the command lines as well

as the old value, to match what is freed in bpstat_clear.
This commit is contained in:
Daniel Jacobowitz 2003-03-10 23:37:29 +00:00
parent e515b05172
commit 31cc81e9d9
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2003-03-10 Klee Dienes <kdienes@apple.com>
* 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 <carlton@math.stanford.edu> 2003-03-10 David Carlton <carlton@math.stanford.edu>
* minsyms.c (add_minsym_to_hash_table): Replace * minsyms.c (add_minsym_to_hash_table): Replace

View file

@ -1816,6 +1816,11 @@ bpstat_copy (bpstat bs)
{ {
tmp = (bpstat) xmalloc (sizeof (*tmp)); tmp = (bpstat) xmalloc (sizeof (*tmp));
memcpy (tmp, bs, 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) if (p == NULL)
/* This is the first thing in the chain. */ /* This is the first thing in the chain. */
retval = tmp; retval = tmp;