aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1996-04-28 10:49:54 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1996-04-28 10:49:54 +0000
commit39ce68291e9afa7e74fa2daf74237b2296ea8b5c (patch)
treeb6466187ad9a0916219bb069e7289b108fe0fd77 /gdb
parent6c0643e30f9b6c45fa120035893a3d1226f2ebf1 (diff)
downloadgdb-39ce68291e9afa7e74fa2daf74237b2296ea8b5c.zip
gdb-39ce68291e9afa7e74fa2daf74237b2296ea8b5c.tar.gz
gdb-39ce68291e9afa7e74fa2daf74237b2296ea8b5c.tar.bz2
* breakpoint.c (delete_breakpoint): Fix bpt->val, bpt->exp
storage leaks. (breakpoint_re_set_one): Fix b->exp, b->val, b->cond storage leaks. * infcmd.c (run_command), solib.c (locate_base): Check for target_has_execution in addition to inferior_pid, a core file from a threaded program is yielding a non-zero inferior_pid. * sparc-tdep.c (get_saved_register): Handle window registers in a dummy frame correctly.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog13
-rw-r--r--gdb/breakpoint.c14
-rw-r--r--gdb/infcmd.c9
3 files changed, 31 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2e34fe6..a583c24 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,16 @@
+Sun Apr 28 03:44:30 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * breakpoint.c (delete_breakpoint): Fix bpt->val, bpt->exp
+ storage leaks.
+ (breakpoint_re_set_one): Fix b->exp, b->val, b->cond storage leaks.
+
+ * infcmd.c (run_command), solib.c (locate_base): Check for
+ target_has_execution in addition to inferior_pid, a core file
+ from a threaded program is yielding a non-zero inferior_pid.
+
+ * sparc-tdep.c (get_saved_register): Handle window registers
+ in a dummy frame correctly.
+
Sat Apr 27 20:38:32 1996 Fred Fish <fnf@cygnus.com>
* Makefile.in (CLIBS): Move $(MMALLOC) past all other libs,
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index bb18f56..a921646 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1972,6 +1972,8 @@ set_raw_breakpoint (sal)
static int internal_breakpoint_number = -1;
+#ifdef GET_LONGJMP_TARGET
+
static void
create_longjmp_breakpoint (func_name)
char *func_name;
@@ -2007,6 +2009,8 @@ create_longjmp_breakpoint (func_name)
b->number = internal_breakpoint_number--;
}
+#endif /* #ifdef GET_LONGJMP_TARGET */
+
/* Call this routine when stepping and nexting to enable a breakpoint if we do
a longjmp(). When we hit that breakpoint, call
set_longjmp_resume_breakpoint() to figure out where we are going. */
@@ -3299,8 +3303,12 @@ delete_breakpoint (bpt)
free (bpt->cond_string);
if (bpt->addr_string != NULL)
free (bpt->addr_string);
+ if (bpt->exp != NULL)
+ free (bpt->exp);
if (bpt->exp_string != NULL)
free (bpt->exp_string);
+ if (bpt->val != NULL)
+ value_free (bpt->val);
if (bpt->source_file != NULL)
free (bpt->source_file);
@@ -3433,9 +3441,13 @@ breakpoint_re_set_one (bint)
particular level, but that's going to be less stable than filenames
or functionnames. */
/* So for now, just use a global context. */
+ if (b->exp)
+ free ((PTR)b->exp);
b->exp = parse_expression (b->exp_string);
b->exp_valid_block = innermost_block;
mark = value_mark ();
+ if (b->val)
+ value_free (b->val);
b->val = evaluate_expression (b->exp);
release_value (b->val);
if (VALUE_LAZY (b->val))
@@ -3444,6 +3456,8 @@ breakpoint_re_set_one (bint)
if (b->cond_string != NULL)
{
s = b->cond_string;
+ if (b->cond)
+ free ((PTR)b->cond);
b->cond = parse_exp_1 (&s, (struct block *)0, 0);
}
if (b->enable == enabled)
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 4aa408a..5eb749e 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -187,7 +187,7 @@ run_command (args, from_tty)
dont_repeat ();
- if (inferior_pid)
+ if (inferior_pid && target_has_execution)
{
if (
!query ("The program being debugged has been started already.\n\
@@ -1164,10 +1164,9 @@ attach_command (args, from_tty)
clear_proceed_status ();
stop_soon_quietly = 1;
-#ifndef MACH
- /* Mach 3 does not generate any traps when attaching to inferior,
- and to set up frames we can do this. */
-
+ /* No traps are generated when attaching to inferior under Mach 3
+ or GNU hurd. */
+#ifndef ATTACH_NO_WAIT
wait_for_inferior ();
#endif