Fix problems with finishing a dummy function call on simulators.
authorLuis Machado <lgustavo@codesourcery.com>
Mon, 6 Jul 2015 19:09:21 +0000 (16:09 -0300)
committerLuis Machado <lgustavo@codesourcery.com>
Mon, 6 Jul 2015 19:09:21 +0000 (16:09 -0300)
This fixes regressions introduced with the original change to not
consider permanent breakpoints always inserted:

  6ae8866180bf90e9ec76c2dd34c07fd826d11a83 is the first bad commit
  commit 6ae8866180bf90e9ec76c2dd34c07fd826d11a83
  Author: Luis Machado <lgustavo@codesourcery.com>
  Date:   Wed Jun 17 16:50:57 2015 -0300

      Fix problems with finishing a dummy function call on simulators.

Some checks were mistakenly left out of the original patch, which
caused the following failures:

-PASS: gdb.base/shlib-call.exp: print mainshr1(1)
-PASS: gdb.base/shlib-call.exp: step into mainshr1
+FAIL: gdb.base/shlib-call.exp: print mainshr1(1)
+FAIL: gdb.base/shlib-call.exp: step into mainshr1

-PASS: gdb.cp/chained-calls.exp: q(p())
+FAIL: gdb.cp/chained-calls.exp: q(p())

-PASS: gdb.cp/chained-calls.exp: q(p() + r())
+FAIL: gdb.cp/chained-calls.exp: q(p() + r())

-PASS: gdb.cp/chained-calls.exp: g(f(g(f() + f())) + f())
+FAIL: gdb.cp/chained-calls.exp: g(f(g(f() + f())) + f())

-PASS: gdb.cp/chained-calls.exp: *c
-PASS: gdb.cp/chained-calls.exp: *c + *c
-PASS: gdb.cp/chained-calls.exp: q(*c + *c)
+FAIL: gdb.cp/chained-calls.exp: *c
+FAIL: gdb.cp/chained-calls.exp: *c + *c
+FAIL: gdb.cp/chained-calls.exp: q(*c + *c)

-PASS: gdb.cp/classes.exp: calling method for small class
+FAIL: gdb.cp/classes.exp: calling method for small class

The above is likely caused by GDB not removing the permanent
breakpoints from the target, leading to the inferior executing
the breakpoint instruction and tripping on a SIGSEGV.

gdb/ChangeLog:
2015-07-06  Luis Machado  <lgustavo@codesourcery.com>

* breakpoint.c (remove_breakpoint_1): Don't handle permanent
breakpoints in a special way.
(remove_breakpoint): Likewise.
(mark_breakpoints_out): Likewise.

gdb/ChangeLog
gdb/breakpoint.c

index dc3973f655766a47d144833ecdb0e7c7d886f84b..0e92bf57a11ff8f5e52fb09257b9caba51d0e2a0 100644 (file)
@@ -1,3 +1,10 @@
+2015-07-06  Luis Machado  <lgustavo@codesourcery.com>
+
+       * breakpoint.c (remove_breakpoint_1): Don't handle permanent
+       breakpoints in a special way.
+       (remove_breakpoint): Likewise.
+       (mark_breakpoints_out): Likewise.
+
 2015-07-06  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * doc/gdb.texinfo (TUI): Add comma after @xref.
index 1481112ea5c527a6ca57addac39ad3acd6ef1fec..af0d16730c3f2fea7716a29c8ac3652f9a150f87 100644 (file)
@@ -3892,10 +3892,6 @@ remove_breakpoint_1 (struct bp_location *bl, insertion_state_t is)
   /* BL is never in moribund_locations by our callers.  */
   gdb_assert (bl->owner != NULL);
 
-  if (bl->permanent)
-    /* Permanent breakpoints cannot be inserted or removed.  */
-    return 0;
-
   /* The type of none suggests that owner is actually deleted.
      This should not ever happen.  */
   gdb_assert (bl->owner->type != bp_none);
@@ -4042,10 +4038,6 @@ remove_breakpoint (struct bp_location *bl, insertion_state_t is)
   /* BL is never in moribund_locations by our callers.  */
   gdb_assert (bl->owner != NULL);
 
-  if (bl->permanent)
-    /* Permanent breakpoints cannot be inserted or removed.  */
-    return 0;
-
   /* The type of none suggests that owner is actually deleted.
      This should not ever happen.  */
   gdb_assert (bl->owner->type != bp_none);
@@ -4068,8 +4060,7 @@ mark_breakpoints_out (void)
   struct bp_location *bl, **blp_tmp;
 
   ALL_BP_LOCATIONS (bl, blp_tmp)
-    if (bl->pspace == current_program_space
-       && !bl->permanent)
+    if (bl->pspace == current_program_space)
       bl->inserted = 0;
 }
 
This page took 0.032161 seconds and 4 git commands to generate.