This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/19546] gdb crash calling exec in the inferior


https://sourceware.org/bugzilla/show_bug.cgi?id=19546

--- Comment #3 from Keith Seitz <keiths at redhat dot com> ---
I think this is simply an oversight. It looks like momentary_breakpoint types
rely on b->location being unset and update_breakpoints_after_exec recognizing
this and deleting the breakpoint.

With the simple, obvious patch of adding a check for NULL in locations_empty_p,
the test in this bug works again. Of course, the trivial patch causes no
regressions and is pretty safe for the release.

WDYT?

diff --git a/gdb/location.c b/gdb/location.c
index e43ebf1..1762d59 100644
--- a/gdb/location.c
+++ b/gdb/location.c
@@ -690,6 +690,9 @@ string_to_event_location (char **stringp,
 int
 event_location_empty_p (const struct event_location *location)
 {
+  if (location == NULL)
+    return 1;
+
   switch (EL_TYPE (location))
     {
     case LINESPEC_LOCATION:

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]