* [RFA/MI testsuite] mi_run_to_main/mi_next/mi_step
@ 2002-09-04 13:43 Keith Seitz
2002-09-09 19:22 ` Elena Zannoni
0 siblings, 1 reply; 6+ messages in thread
From: Keith Seitz @ 2002-09-04 13:43 UTC (permalink / raw)
To: gdb-patches
Hi,
The following patch fixes several shortcomings in the mi support for
running to main, stepping and nexting.
For mi_run_to_main, it removes the assumption that main has no arguments.
It also adds an ignore pattern to the beginning of the "000*stopped"
regexp. This is needed, for example, to ignore async output which could
show up when running threaded applications under MI.
It also fixes mi_next and mi_step, which, as far as I can tell, never
worked. The regexp pattern is wrong.
Keith
ChangeLog
2002-09-04 Keith Seitz <keiths@redhat.com>
* lib/mi-support.exp (mi_run_to_main): Allow anything to precede
regexp for stopping at main. Could have multiple event notifications.
Don't assume that main was declared with no parameters.
(mi_step_next_helper): New procedure to do step/next.
(mi_next): Use mi_step_next_helper.
(mi_step): Ditto.
Patch
Index: testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.14
diff -p -r1.14 mi-support.exp
*** testsuite/lib/mi-support.exp 29 Aug 2002 16:10:13 -0000 1.14
--- testsuite/lib/mi-support.exp 4 Sep 2002 20:36:10 -0000
***************
*** 1,4 ****
! # Copyright 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
--- 1,4 ----
! # Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
*************** proc mi_run_to_main { } {
*** 640,646 ****
mi_run_cmd
gdb_expect {
! -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"main\",args=\(\\\[\\\]\|\{\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
--- 640,646 ----
mi_run_cmd
gdb_expect {
! -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"\[0-9\]+\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"main\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
*************** proc mi_run_to_main { } {
*** 655,701 ****
}
# Next to the next statement
proc mi_next { test } {
! global suppress_flag
! if { $suppress_flag } {
! return -1
! }
! global mi_gdb_prompt
! send_gdb "220-exec-next\n"
! gdb_expect {
! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{].*[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
! pass "$test"
! return 0
! }
! timeout {
! fail "$test"
! return -1
! }
! }
}
# Step to the next statement
proc mi_step { test } {
! global suppress_flag
! if { $suppress_flag } {
! return -1
! }
! global mi_gdb_prompt
! send_gdb "220-exec-step\n"
! gdb_expect {
! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
! pass "$test"
! return 0
! }
! timeout {
! fail "$test"
! return -1
! }
! }
}
# cmd should not include the number or newline (i.e. "exec-step 3", not
--- 655,699 ----
}
+ # Helper function for mi_next and mi_step
+ # CMD is either "step" or "next"
+ # TEST is the name of the test (passed to dejagnu's pass/fail)
+ # Returns:
+ # 0 if passed
+ # 1 if failed/timeout
+ proc mi_step_next_helper {cmd test} {
+ global suppress_flag
+ if { $suppress_flag } {
+ return 1
+ }
+
+ global mi_gdb_prompt decimal hex
+ send_gdb "220-exec-$cmd\n"
+ gdb_expect {
+ -re ".*220\\^running\r\n$mi_gdb_prompt.*220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",line=\"$decimal\"\}\r\n$mi_gdb_prompt$" {
+ pass "$test"
+ return 0
+ }
+ timeout {
+ fail "$test"
+ return 1
+ }
+ }
+ }
+
# Next to the next statement
+ # For return values, see mi_step_next_helper
proc mi_next { test } {
! return [mi_step_next_helper next $test]
}
# Step to the next statement
+ # For return values, see mi_step_next_helper
proc mi_step { test } {
! return [mi_step_next_helper step $test]
}
# cmd should not include the number or newline (i.e. "exec-step 3", not
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/MI testsuite] mi_run_to_main/mi_next/mi_step
2002-09-04 13:43 [RFA/MI testsuite] mi_run_to_main/mi_next/mi_step Keith Seitz
@ 2002-09-09 19:22 ` Elena Zannoni
2002-09-10 7:25 ` Keith Seitz
0 siblings, 1 reply; 6+ messages in thread
From: Elena Zannoni @ 2002-09-09 19:22 UTC (permalink / raw)
To: Keith Seitz; +Cc: gdb-patches
Keith Seitz writes:
> Hi,
>
> The following patch fixes several shortcomings in the mi support for
> running to main, stepping and nexting.
>
> For mi_run_to_main, it removes the assumption that main has no arguments.
> It also adds an ignore pattern to the beginning of the "000*stopped"
> regexp. This is needed, for example, to ignore async output which could
> show up when running threaded applications under MI.
>
> It also fixes mi_next and mi_step, which, as far as I can tell, never
> worked. The regexp pattern is wrong.
>
Hmmm how does this interact with the mi_next_to, etc, functions that
were added back in November?
the original patch was here:
http://sources.redhat.com/ml/gdb-patches/2001-10/msg00336.html
Elena
> Keith
>
> ChangeLog
> 2002-09-04 Keith Seitz <keiths@redhat.com>
>
> * lib/mi-support.exp (mi_run_to_main): Allow anything to precede
> regexp for stopping at main. Could have multiple event notifications.
> Don't assume that main was declared with no parameters.
> (mi_step_next_helper): New procedure to do step/next.
> (mi_next): Use mi_step_next_helper.
> (mi_step): Ditto.
>
> Patch
> Index: testsuite/lib/mi-support.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
> retrieving revision 1.14
> diff -p -r1.14 mi-support.exp
> *** testsuite/lib/mi-support.exp 29 Aug 2002 16:10:13 -0000 1.14
> --- testsuite/lib/mi-support.exp 4 Sep 2002 20:36:10 -0000
> ***************
> *** 1,4 ****
> ! # Copyright 1999, 2000 Free Software Foundation, Inc.
>
> # This program is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> --- 1,4 ----
> ! # Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
>
> # This program is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> *************** proc mi_run_to_main { } {
> *** 640,646 ****
>
> mi_run_cmd
> gdb_expect {
> ! -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"main\",args=\(\\\[\\\]\|\{\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
> pass "$test"
> return 0
> }
> --- 640,646 ----
>
> mi_run_cmd
> gdb_expect {
> ! -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"\[0-9\]+\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"main\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
> pass "$test"
> return 0
> }
> *************** proc mi_run_to_main { } {
> *** 655,701 ****
> }
>
>
> # Next to the next statement
>
> proc mi_next { test } {
> ! global suppress_flag
> ! if { $suppress_flag } {
> ! return -1
> ! }
> ! global mi_gdb_prompt
> ! send_gdb "220-exec-next\n"
> ! gdb_expect {
> ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{].*[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
> ! pass "$test"
> ! return 0
> ! }
> ! timeout {
> ! fail "$test"
> ! return -1
> ! }
> ! }
> }
>
>
> # Step to the next statement
>
> proc mi_step { test } {
> ! global suppress_flag
> ! if { $suppress_flag } {
> ! return -1
> ! }
> ! global mi_gdb_prompt
> ! send_gdb "220-exec-step\n"
> ! gdb_expect {
> ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
> ! pass "$test"
> ! return 0
> ! }
> ! timeout {
> ! fail "$test"
> ! return -1
> ! }
> ! }
> }
>
> # cmd should not include the number or newline (i.e. "exec-step 3", not
> --- 655,699 ----
> }
>
>
> + # Helper function for mi_next and mi_step
> + # CMD is either "step" or "next"
> + # TEST is the name of the test (passed to dejagnu's pass/fail)
> + # Returns:
> + # 0 if passed
> + # 1 if failed/timeout
> + proc mi_step_next_helper {cmd test} {
> + global suppress_flag
> + if { $suppress_flag } {
> + return 1
> + }
> +
> + global mi_gdb_prompt decimal hex
> + send_gdb "220-exec-$cmd\n"
> + gdb_expect {
> + -re ".*220\\^running\r\n$mi_gdb_prompt.*220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",line=\"$decimal\"\}\r\n$mi_gdb_prompt$" {
> + pass "$test"
> + return 0
> + }
> + timeout {
> + fail "$test"
> + return 1
> + }
> + }
> + }
> +
> # Next to the next statement
> + # For return values, see mi_step_next_helper
>
> proc mi_next { test } {
> ! return [mi_step_next_helper next $test]
> }
>
>
> # Step to the next statement
> + # For return values, see mi_step_next_helper
>
> proc mi_step { test } {
> ! return [mi_step_next_helper step $test]
> }
>
> # cmd should not include the number or newline (i.e. "exec-step 3", not
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/MI testsuite] mi_run_to_main/mi_next/mi_step
2002-09-09 19:22 ` Elena Zannoni
@ 2002-09-10 7:25 ` Keith Seitz
2002-09-10 9:32 ` Keith Seitz
0 siblings, 1 reply; 6+ messages in thread
From: Keith Seitz @ 2002-09-10 7:25 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
On Mon, 9 Sep 2002, Elena Zannoni wrote:
> Hmmm how does this interact with the mi_next_to, etc, functions that
> were added back in November?
> the original patch was here:
> http://sources.redhat.com/ml/gdb-patches/2001-10/msg00336.html
The two pathways are completely independent, although they appear to
accomplish the same thing. The stop specification for mi_step/next_to is
more stringent, though.
This patch just fixes what is already in mi-support.exp, which doesn't
work at all. As an alternative, we could whack mi_step and mi_next (or I
we could even re-write those to use mi_step_to and mi_next_to, come to
think of it).
Keith
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/MI testsuite] mi_run_to_main/mi_next/mi_step
2002-09-10 7:25 ` Keith Seitz
@ 2002-09-10 9:32 ` Keith Seitz
2002-09-10 14:58 ` Elena Zannoni
0 siblings, 1 reply; 6+ messages in thread
From: Keith Seitz @ 2002-09-10 9:32 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
On Tue, 10 Sep 2002, Keith Seitz wrote:
> This patch just fixes what is already in mi-support.exp, which doesn't
> work at all. As an alternative, we could whack mi_step and mi_next (or I
> we could even re-write those to use mi_step_to and mi_next_to, come to
> think of it).
Ok, here's the same patch but using mi_next_to and mi_step_to.
Keith
ChangeLog
2002-09-10 Keith Seitz <keiths@redhat.com>
* lib/mi-support.exp: (mi_run_to_main): Allow anything to precede
regexp for stopping at main. Could have multiple event notifications.
Don't assume that main was declared with no parameters.
(mi_next): Use mi_step_to.
(mi_step): Use mi_next_to.
Index: testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.15
diff -p -r1.15 mi-support.exp
*** testsuite/lib/mi-support.exp 4 Sep 2002 21:05:07 -0000 1.15
--- testsuite/lib/mi-support.exp 10 Sep 2002 14:54:55 -0000
*************** proc mi_run_to_main { } {
*** 656,701 ****
# Next to the next statement
proc mi_next { test } {
! global suppress_flag
! if { $suppress_flag } {
! return -1
! }
! global mi_gdb_prompt
! send_gdb "220-exec-next\n"
! gdb_expect {
! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{].*[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
! pass "$test"
! return 0
! }
! timeout {
! fail "$test"
! return -1
! }
! }
}
# Step to the next statement
proc mi_step { test } {
! global suppress_flag
! if { $suppress_flag } {
! return -1
! }
! global mi_gdb_prompt
! send_gdb "220-exec-step\n"
! gdb_expect {
! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
! pass "$test"
! return 0
! }
! timeout {
! fail "$test"
! return -1
! }
! }
}
# cmd should not include the number or newline (i.e. "exec-step 3", not
--- 656,673 ----
# Next to the next statement
+ # For return values, see mi_run_to_helper
proc mi_next { test } {
! return [mi_next_to {.*} {.*} {.*} {.*} $test]
}
# Step to the next statement
+ # For return values, see mi_run_to_helper
proc mi_step { test } {
! return [mi_step_to {.*} {.*} {.*} {.*} $test]
}
# cmd should not include the number or newline (i.e. "exec-step 3", not
*************** proc mi_run_to_helper { cmd reason func
*** 714,724 ****
global decimal
send_gdb "220-$cmd\n"
gdb_expect {
! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
fail "$test (stopped at wrong place)"
return -1
}
--- 686,696 ----
global decimal
send_gdb "220-$cmd\n"
gdb_expect {
! -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
! -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
fail "$test (stopped at wrong place)"
return -1
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/MI testsuite] mi_run_to_main/mi_next/mi_step
2002-09-10 9:32 ` Keith Seitz
@ 2002-09-10 14:58 ` Elena Zannoni
2002-09-10 15:08 ` Keith Seitz
0 siblings, 1 reply; 6+ messages in thread
From: Elena Zannoni @ 2002-09-10 14:58 UTC (permalink / raw)
To: Keith Seitz; +Cc: Elena Zannoni, gdb-patches
Keith Seitz writes:
> On Tue, 10 Sep 2002, Keith Seitz wrote:
>
> > This patch just fixes what is already in mi-support.exp, which doesn't
> > work at all. As an alternative, we could whack mi_step and mi_next (or I
> > we could even re-write those to use mi_step_to and mi_next_to, come to
> > think of it).
>
> Ok, here's the same patch but using mi_next_to and mi_step_to.
>
Yes. Thanks!
Elena
> Keith
>
> ChangeLog
> 2002-09-10 Keith Seitz <keiths@redhat.com>
>
> * lib/mi-support.exp: (mi_run_to_main): Allow anything to precede
> regexp for stopping at main. Could have multiple event notifications.
> Don't assume that main was declared with no parameters.
> (mi_next): Use mi_step_to.
> (mi_step): Use mi_next_to.
>
> Index: testsuite/lib/mi-support.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
> retrieving revision 1.15
> diff -p -r1.15 mi-support.exp
> *** testsuite/lib/mi-support.exp 4 Sep 2002 21:05:07 -0000 1.15
> --- testsuite/lib/mi-support.exp 10 Sep 2002 14:54:55 -0000
> *************** proc mi_run_to_main { } {
> *** 656,701 ****
>
>
> # Next to the next statement
>
> proc mi_next { test } {
> ! global suppress_flag
> ! if { $suppress_flag } {
> ! return -1
> ! }
> ! global mi_gdb_prompt
> ! send_gdb "220-exec-next\n"
> ! gdb_expect {
> ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{].*[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
> ! pass "$test"
> ! return 0
> ! }
> ! timeout {
> ! fail "$test"
> ! return -1
> ! }
> ! }
> }
>
>
> # Step to the next statement
>
> proc mi_step { test } {
> ! global suppress_flag
> ! if { $suppress_flag } {
> ! return -1
> ! }
> ! global mi_gdb_prompt
> ! send_gdb "220-exec-step\n"
> ! gdb_expect {
> ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
> ! pass "$test"
> ! return 0
> ! }
> ! timeout {
> ! fail "$test"
> ! return -1
> ! }
> ! }
> }
>
> # cmd should not include the number or newline (i.e. "exec-step 3", not
> --- 656,673 ----
>
>
> # Next to the next statement
> + # For return values, see mi_run_to_helper
>
> proc mi_next { test } {
> ! return [mi_next_to {.*} {.*} {.*} {.*} $test]
> }
>
>
> # Step to the next statement
> + # For return values, see mi_run_to_helper
>
> proc mi_step { test } {
> ! return [mi_step_to {.*} {.*} {.*} {.*} $test]
> }
>
> # cmd should not include the number or newline (i.e. "exec-step 3", not
> *************** proc mi_run_to_helper { cmd reason func
> *** 714,724 ****
> global decimal
> send_gdb "220-$cmd\n"
> gdb_expect {
> ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
> pass "$test"
> return 0
> }
> ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
> fail "$test (stopped at wrong place)"
> return -1
> }
> --- 686,696 ----
> global decimal
> send_gdb "220-$cmd\n"
> gdb_expect {
> ! -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
> pass "$test"
> return 0
> }
> ! -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
> fail "$test (stopped at wrong place)"
> return -1
> }
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA/MI testsuite] mi_run_to_main/mi_next/mi_step
2002-09-10 14:58 ` Elena Zannoni
@ 2002-09-10 15:08 ` Keith Seitz
0 siblings, 0 replies; 6+ messages in thread
From: Keith Seitz @ 2002-09-10 15:08 UTC (permalink / raw)
To: gdb-patches
On Tue, 10 Sep 2002, Elena Zannoni wrote:
> Yes. Thanks!
Committed. Thank you for reviewing this.
Keith
> > ChangeLog
> > 2002-09-10 Keith Seitz <keiths@redhat.com>
> >
> > * lib/mi-support.exp: (mi_run_to_main): Allow anything to precede
> > regexp for stopping at main. Could have multiple event notifications.
> > Don't assume that main was declared with no parameters.
> > (mi_next): Use mi_step_to.
> > (mi_step): Use mi_next_to.
> >
> > Index: testsuite/lib/mi-support.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
> > retrieving revision 1.15
> > diff -p -r1.15 mi-support.exp
> > *** testsuite/lib/mi-support.exp 4 Sep 2002 21:05:07 -0000 1.15
> > --- testsuite/lib/mi-support.exp 10 Sep 2002 14:54:55 -0000
> > *************** proc mi_run_to_main { } {
> > *** 656,701 ****
> >
> >
> > # Next to the next statement
> >
> > proc mi_next { test } {
> > ! global suppress_flag
> > ! if { $suppress_flag } {
> > ! return -1
> > ! }
> > ! global mi_gdb_prompt
> > ! send_gdb "220-exec-next\n"
> > ! gdb_expect {
> > ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{].*[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
> > ! pass "$test"
> > ! return 0
> > ! }
> > ! timeout {
> > ! fail "$test"
> > ! return -1
> > ! }
> > ! }
> > }
> >
> >
> > # Step to the next statement
> >
> > proc mi_step { test } {
> > ! global suppress_flag
> > ! if { $suppress_flag } {
> > ! return -1
> > ! }
> > ! global mi_gdb_prompt
> > ! send_gdb "220-exec-step\n"
> > ! gdb_expect {
> > ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
> > ! pass "$test"
> > ! return 0
> > ! }
> > ! timeout {
> > ! fail "$test"
> > ! return -1
> > ! }
> > ! }
> > }
> >
> > # cmd should not include the number or newline (i.e. "exec-step 3", not
> > --- 656,673 ----
> >
> >
> > # Next to the next statement
> > + # For return values, see mi_run_to_helper
> >
> > proc mi_next { test } {
> > ! return [mi_next_to {.*} {.*} {.*} {.*} $test]
> > }
> >
> >
> > # Step to the next statement
> > + # For return values, see mi_run_to_helper
> >
> > proc mi_step { test } {
> > ! return [mi_step_to {.*} {.*} {.*} {.*} $test]
> > }
> >
> > # cmd should not include the number or newline (i.e. "exec-step 3", not
> > *************** proc mi_run_to_helper { cmd reason func
> > *** 714,724 ****
> > global decimal
> > send_gdb "220-$cmd\n"
> > gdb_expect {
> > ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
> > pass "$test"
> > return 0
> > }
> > ! -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
> > fail "$test (stopped at wrong place)"
> > return -1
> > }
> > --- 686,696 ----
> > global decimal
> > send_gdb "220-$cmd\n"
> > gdb_expect {
> > ! -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
> > pass "$test"
> > return 0
> > }
> > ! -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
> > fail "$test (stopped at wrong place)"
> > return -1
> > }
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-09-10 22:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-04 13:43 [RFA/MI testsuite] mi_run_to_main/mi_next/mi_step Keith Seitz
2002-09-09 19:22 ` Elena Zannoni
2002-09-10 7:25 ` Keith Seitz
2002-09-10 9:32 ` Keith Seitz
2002-09-10 14:58 ` Elena Zannoni
2002-09-10 15:08 ` Keith Seitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox