[PATCH] gdb-comm: Script confusion with a pending breakpoint

View: New views
2 Messages — Rating Filter:   Alert me  

[PATCH] gdb-comm: Script confusion with a pending breakpoint

by Maciej W. Rozycki-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

 With the mips-sde-elf target I observe a problem with a test script from
the binutils testsuite looping as follows:

(gdb) file tmpdir/striprog
Reading symbols from [...]/tmpdir/striprog...(no debugging symbols found)...done.
(gdb) break _exit
Function "_exit" not defined.
Make breakpoint pending on future shared library load? (y or [n]) break
exit
Please answer y or [n].
Make breakpoint pending on future shared library load? (y or [n]) break
abort
Please answer y or [n].
Make breakpoint pending on future shared library load? (y or [n]) target
mdi 15:2
Please answer y or [n].
Make breakpoint pending on future shared library load? (y or [n]) WARNING:
Unable to connect to 15:2 with GDB.
quit
Please answer y or [n].
Make breakpoint pending on future shared library load? (y or [n])
Rebooting mipssim-sde

In this case the binary has been stripped, so no surprise there is no
_exit symbol to place a breakpoint on.  As seen from config/gdb-comm.exp
the breakpoint is used to catch a runaway debugger only, so it is safe to
skip it if it cannot be set straight away; the return status from the
function may be used for further processing if need be.

 The following patch fixes the problem for me.

2009-06-08  Maciej W. Rozycki  <macro@...>

        * config/gdb-comm.exp (gdb_comm_add_breakpoint): Handle pending
        breakpoints.

 Please apply.

  Maciej

dejagnu-1.4.99-gdb-comm-1.patch
diff --git a/config/gdb-comm.exp b/config/gdb-comm.exp
index b7dbfc3..3d46011 100644
--- a/config/gdb-comm.exp
+++ b/config/gdb-comm.exp
@@ -200,6 +200,10 @@ proc gdb_comm_add_breakpoint { function } {
  -re "Breakpoint.*$gdb_prompt $" { return "" }
  -re "Function.*not defined.*$gdb_prompt $" { return "undef" }
  -re "No symbol table.*$gdb_prompt $" { return "undef" }
+ -re ".*Make breakpoint pending.*\\\? \\(y or \\\[n\\\]\\) $" {
+    remote_send host "y\n"
+    return "maybe"
+ }
  default {
     return "untested"
  }


_______________________________________________
Bug-dejagnu mailing list
Bug-dejagnu@...
http://lists.gnu.org/mailman/listinfo/bug-dejagnu

Re: [PATCH] gdb-comm: Script confusion with a pending breakpoint

by Ben Elliston-37 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>  The following patch fixes the problem for me.

> * config/gdb-comm.exp (gdb_comm_add_breakpoint): Handle pending
> breakpoints.

Thanks; applied.

Ben


_______________________________________________
Bug-dejagnu mailing list
Bug-dejagnu@...
http://lists.gnu.org/mailman/listinfo/bug-dejagnu