Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
@ 2001-05-18 17:38 Kevin Buettner
  2001-05-18 18:24 ` Michael Snyder
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kevin Buettner @ 2001-05-18 17:38 UTC (permalink / raw)
  To: gdb-patches

On the IA-64, a "finish" won't stop us at the statement after the call
due to the fact that the "call" instruction isn't the last instruction
in the call sequence.  (The global pointer still needs to be reset.)
The patch below tweaks the finish_void test to allow for this
eventuality.

Okay to commit?

	* gdb.base/finish.exp (finish_void): Allow "finish" command to
	stop on the call statement as well as the statement after the
	call.

Index: testsuite/gdb.base/finish.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/finish.exp,v
retrieving revision 1.3
diff -u -p -r1.3 finish.exp
--- finish.exp	2001/03/06 08:21:50	1.3
+++ finish.exp	2001/05/19 00:27:32
@@ -77,8 +77,15 @@ proc finish_void { } {
     gdb_test "continue" "Breakpoint.* void_func.*" \
 	    "continue to void_func"
     send_gdb "finish\n"
+    # Some architectures will have one or more instructions after the
+    # call instruction which still is part of the call sequence, so we
+    # must be prepared for a "finish" to show us the void_func call
+    # again as well as the statement after.
     gdb_expect {
 	-re ".*void_checkpoint.*$gdb_prompt $" {
+	    pass "finish from void_func"
+	}
+	-re ".*call to void_func.*$gdb_prompt $" {
 	    pass "finish from void_func"
 	}
 	-re ".*$gdb_prompt $" {


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
  2001-05-18 17:38 [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call Kevin Buettner
@ 2001-05-18 18:24 ` Michael Snyder
  2001-05-21 17:27 ` Kevin Buettner
  2001-05-23 17:21 ` Fernando Nasser
  2 siblings, 0 replies; 8+ messages in thread
From: Michael Snyder @ 2001-05-18 18:24 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Kevin Buettner wrote:
> 
> On the IA-64, a "finish" won't stop us at the statement after the call
> due to the fact that the "call" instruction isn't the last instruction
> in the call sequence.  (The global pointer still needs to be reset.)
> The patch below tweaks the finish_void test to allow for this
> eventuality.
> 
> Okay to commit?

Yes, this is fine.  Thanks Kevin.


>         * gdb.base/finish.exp (finish_void): Allow "finish" command to
>         stop on the call statement as well as the statement after the
>         call.
> 
> Index: testsuite/gdb.base/finish.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/finish.exp,v
> retrieving revision 1.3
> diff -u -p -r1.3 finish.exp
> --- finish.exp  2001/03/06 08:21:50     1.3
> +++ finish.exp  2001/05/19 00:27:32
> @@ -77,8 +77,15 @@ proc finish_void { } {
>      gdb_test "continue" "Breakpoint.* void_func.*" \
>             "continue to void_func"
>      send_gdb "finish\n"
> +    # Some architectures will have one or more instructions after the
> +    # call instruction which still is part of the call sequence, so we
> +    # must be prepared for a "finish" to show us the void_func call
> +    # again as well as the statement after.
>      gdb_expect {
>         -re ".*void_checkpoint.*$gdb_prompt $" {
> +           pass "finish from void_func"
> +       }
> +       -re ".*call to void_func.*$gdb_prompt $" {
>             pass "finish from void_func"
>         }
>         -re ".*$gdb_prompt $" {


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
  2001-05-18 17:38 [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call Kevin Buettner
  2001-05-18 18:24 ` Michael Snyder
@ 2001-05-21 17:27 ` Kevin Buettner
  2001-05-23 17:21 ` Fernando Nasser
  2 siblings, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2001-05-21 17:27 UTC (permalink / raw)
  To: gdb-patches

On May 18,  5:38pm, Kevin Buettner wrote:

> 	* gdb.base/finish.exp (finish_void): Allow "finish" command to
> 	stop on the call statement as well as the statement after the
> 	call.

Committed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
  2001-05-18 17:38 [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call Kevin Buettner
  2001-05-18 18:24 ` Michael Snyder
  2001-05-21 17:27 ` Kevin Buettner
@ 2001-05-23 17:21 ` Fernando Nasser
  2001-05-23 18:53   ` Kevin Buettner
  2 siblings, 1 reply; 8+ messages in thread
From: Fernando Nasser @ 2001-05-23 17:21 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Kevin Buettner wrote:
> 
> On the IA-64, a "finish" won't stop us at the statement after the call
> due to the fact that the "call" instruction isn't the last instruction
> in the call sequence.  (The global pointer still needs to be reset.)
> The patch below tweaks the finish_void test to allow for this
> eventuality.
> 
> Okay to commit?
> 

Nice catch Kevin.  Thanks.

Your second pattern needs a small improvement though.  As we are
returning to the middle of that source line, the information printed by
GDB will have the address (PC) as well.  We must make sure that we test
for that so we can differentiate between returning to the beginning of
the calling line (wrong) and returning to after where the assembler jump
to subroutine was (right).  You can test for that without binding to a
specific PC value -- there are several examples around.

After making this change, and testing that it works, of course, you can
commit your patch.  Please post the final version for the records.

Thanks again for the fix.

Regards,
Fernando





>         * gdb.base/finish.exp (finish_void): Allow "finish" command to
>         stop on the call statement as well as the statement after the
>         call.
> 
> Index: testsuite/gdb.base/finish.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/finish.exp,v
> retrieving revision 1.3
> diff -u -p -r1.3 finish.exp
> --- finish.exp  2001/03/06 08:21:50     1.3
> +++ finish.exp  2001/05/19 00:27:32
> @@ -77,8 +77,15 @@ proc finish_void { } {
>      gdb_test "continue" "Breakpoint.* void_func.*" \
>             "continue to void_func"
>      send_gdb "finish\n"
> +    # Some architectures will have one or more instructions after the
> +    # call instruction which still is part of the call sequence, so we
> +    # must be prepared for a "finish" to show us the void_func call
> +    # again as well as the statement after.
>      gdb_expect {
>         -re ".*void_checkpoint.*$gdb_prompt $" {
> +           pass "finish from void_func"
> +       }
> +       -re ".*call to void_func.*$gdb_prompt $" {
>             pass "finish from void_func"
>         }
>         -re ".*$gdb_prompt $" {

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
  2001-05-23 17:21 ` Fernando Nasser
@ 2001-05-23 18:53   ` Kevin Buettner
  2001-05-23 19:06     ` Fernando Nasser
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Buettner @ 2001-05-23 18:53 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: gdb-patches

On May 23,  8:18pm, Fernando Nasser wrote:

> Your second pattern needs a small improvement though.  As we are
> returning to the middle of that source line, the information printed by
> GDB will have the address (PC) as well.  We must make sure that we test
> for that so we can differentiate between returning to the beginning of
> the calling line (wrong) and returning to after where the assembler jump
> to subroutine was (right).  You can test for that without binding to a
> specific PC value -- there are several examples around.
> 
> After making this change, and testing that it works, of course, you can
> commit your patch.  Please post the final version for the records.

The patch you refer to has already been committed.  (Michael S. approved
it.)

I do agree that it is worthwhile to make the pattern more restrictive
and have just committed the patch below.  I've tested it on the IA-64
machine where I was previously seeing a failure.  (It still works as
expected.)

	* gdb.base/finish.exp (finish_void): Revise pattern for
	stopping on the call statement to not permit stopping at
	the start of the instructions comprising the call sequence.

Index: testsuite/gdb.base/finish.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/finish.exp,v
retrieving revision 1.4
diff -u -p -r1.4 finish.exp
--- finish.exp	2001/05/22 00:25:27	1.4
+++ finish.exp	2001/05/24 00:59:25
@@ -85,7 +85,7 @@ proc finish_void { } {
 	-re ".*void_checkpoint.*$gdb_prompt $" {
 	    pass "finish from void_func"
 	}
-	-re ".*call to void_func.*$gdb_prompt $" {
+	-re "0x\[0-9a-fA-F\]+ in main.*call to void_func.*$gdb_prompt $" {
 	    pass "finish from void_func"
 	}
 	-re ".*$gdb_prompt $" {


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
  2001-05-23 18:53   ` Kevin Buettner
@ 2001-05-23 19:06     ` Fernando Nasser
  2001-05-23 19:56       ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: Fernando Nasser @ 2001-05-23 19:06 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Kevin Buettner wrote:
> 
> On May 23,  8:18pm, Fernando Nasser wrote:
> 
> > Your second pattern needs a small improvement though.  As we are
> > returning to the middle of that source line, the information printed by
> > GDB will have the address (PC) as well.  We must make sure that we test
> > for that so we can differentiate between returning to the beginning of
> > the calling line (wrong) and returning to after where the assembler jump
> > to subroutine was (right).  You can test for that without binding to a
> > specific PC value -- there are several examples around.
> >
> > After making this change, and testing that it works, of course, you can
> > commit your patch.  Please post the final version for the records.
> 
> The patch you refer to has already been committed.  (Michael S. approved
> it.)
> 

Michael got confused, he can checkin anywhere but can only approve
patches to gdb.trace and gdb.threads (for now, at least).  But no big
deal, this is close to an obvious fix.

> I do agree that it is worthwhile to make the pattern more restrictive
> and have just committed the patch below.  I've tested it on the IA-64
> machine where I was previously seeing a failure.  (It still works as
> expected.)
> 

Yes!  That is what I meant.

Thank you very much.



>         * gdb.base/finish.exp (finish_void): Revise pattern for
>         stopping on the call statement to not permit stopping at
>         the start of the instructions comprising the call sequence.
> 
> Index: testsuite/gdb.base/finish.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/finish.exp,v
> retrieving revision 1.4
> diff -u -p -r1.4 finish.exp
> --- finish.exp  2001/05/22 00:25:27     1.4
> +++ finish.exp  2001/05/24 00:59:25
> @@ -85,7 +85,7 @@ proc finish_void { } {
>         -re ".*void_checkpoint.*$gdb_prompt $" {
>             pass "finish from void_func"
>         }
> -       -re ".*call to void_func.*$gdb_prompt $" {
> +       -re "0x\[0-9a-fA-F\]+ in main.*call to void_func.*$gdb_prompt $" {
>             pass "finish from void_func"
>         }
>         -re ".*$gdb_prompt $" {

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
  2001-05-23 19:06     ` Fernando Nasser
@ 2001-05-23 19:56       ` Michael Snyder
  2001-05-24  6:47         ` Fernando Nasser
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2001-05-23 19:56 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: Kevin Buettner, gdb-patches

Fernando Nasser wrote:
> 
> Kevin Buettner wrote:
> >
> > On May 23,  8:18pm, Fernando Nasser wrote:
> >
> > > Your second pattern needs a small improvement though.  As we are
> > > returning to the middle of that source line, the information printed by
> > > GDB will have the address (PC) as well.  We must make sure that we test
> > > for that so we can differentiate between returning to the beginning of
> > > the calling line (wrong) and returning to after where the assembler jump
> > > to subroutine was (right).  You can test for that without binding to a
> > > specific PC value -- there are several examples around.
> > >
> > > After making this change, and testing that it works, of course, you can
> > > commit your patch.  Please post the final version for the records.
> >
> > The patch you refer to has already been committed.  (Michael S. approved
> > it.)
> >
> 
> Michael got confused, he can checkin anywhere but can only approve
> patches to gdb.trace and gdb.threads (for now, at least). 

But... but... I wrote that test!  ;-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call
  2001-05-23 19:56       ` Michael Snyder
@ 2001-05-24  6:47         ` Fernando Nasser
  0 siblings, 0 replies; 8+ messages in thread
From: Fernando Nasser @ 2001-05-24  6:47 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Kevin Buettner, gdb-patches

Michael Snyder wrote:
> 
> Fernando Nasser wrote:
> >
> > Michael got confused, he can checkin anywhere but can only approve
> > patches to gdb.trace and gdb.threads (for now, at least).
> 
> But... but... I wrote that test!  ;-)

I did not make the rules :-)

Seriously, it would be nice to split the gdb.base tests among
co-maintainers (it is too large and nobody wants to get the whole
package).
Let me know the ones that you have written yourself (or has a strong
affinity with) so I can propose to the community that you are made a
co-maintainer for that group (if you wish).

Cheers,
Fernando
  

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-05-24  6:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-18 17:38 [PATCH RFA] gdb.base/finish.exp: Allow finish to stop on call Kevin Buettner
2001-05-18 18:24 ` Michael Snyder
2001-05-21 17:27 ` Kevin Buettner
2001-05-23 17:21 ` Fernando Nasser
2001-05-23 18:53   ` Kevin Buettner
2001-05-23 19:06     ` Fernando Nasser
2001-05-23 19:56       ` Michael Snyder
2001-05-24  6:47         ` Fernando Nasser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox