This is the mail archive of the gdb-patches@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]

[PATCH] Fix gdbserver + stap-probe.exp


Hello,

Pedro noticed this bug yesterday, and I spend some time fixing it.
`stap-probe.exp' was unecessarily using `rerun_to_main' in order to
restart GDB.  This is not necessary because the order of the commands
was:

    delete_breakpoints
    rerun_to_main
    if {[runto "-pstap probe"]} {
      pass "OK"
    }

However, since `runto' already restarts GDB, `rerun_to_main' was doing
absolutely nothing because `delete_breakpoints' had deleted all the
breakpoints (including the `main' bp)...

...which, in turn, made me wonder about `rerun_to_main's behaviour.
When using native GDB, `rerun_to_main' checks for messages like "The
program has been started already.*", or "Starting program.*".  This is
not correct IMO.  For example, when using GDBserver, the function
correctly expects to see a message like ".*Breakpoint .*main
.*$gdb_prompt $".

I will submit another patch with a proposed fix shortly.  For now,
please take a look at this patch.

The patch below doesn't cause any regression.  OK to apply?

-- 
Sergio

gdb/testsuite/ChangeLog:
2012-05-11  Sergio Durigan Junior  <sergiodj@redhat.com>

	* gdb.base/stap-probe.exp (stap_test): Remove call to
	`rerun_to_main'.
	(stap_test_no_debuginfo): Likewise.

diff --git a/gdb/testsuite/gdb.base/stap-probe.exp b/gdb/testsuite/gdb.base/stap-probe.exp
index 30ca427..5c173b3 100644
--- a/gdb/testsuite/gdb.base/stap-probe.exp
+++ b/gdb/testsuite/gdb.base/stap-probe.exp
@@ -59,7 +59,6 @@ proc stap_test {exec_name {arg ""}} {
 
     # Reinit GDB, set a breakpoint on probe m4.
     delete_breakpoints
-    rerun_to_main
     if {[runto "-pstap test:m4"]} {
       pass "run to -pstap test:m4"
     } else {
@@ -79,7 +78,6 @@ proc stap_test {exec_name {arg ""}} {
 
     # Reinit GDB, set a breakpoint on probe ps.
     delete_breakpoints
-    rerun_to_main
     if {[runto "-pstap test:ps"]} {
       pass "run to -pstap test:m4"
     } else {
@@ -127,7 +125,6 @@ proc stap_test_no_debuginfo {exec_name {arg ""}} {
 
     # Reinit GDB, set a breakpoint on probe m4.
     delete_breakpoints
-    rerun_to_main
     if {[runto "-pstap test:m4"]} {
       pass "run to -pstap test:m4"
     } else {
@@ -147,7 +144,6 @@ proc stap_test_no_debuginfo {exec_name {arg ""}} {
 
     # Reinit GDB, set a breakpoint on probe ps.
     delete_breakpoints
-    rerun_to_main
     if {[runto "-pstap test:ps"]} {
       pass "run to -pstap test:m4"
     } else {


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