* Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
@ 2003-04-04 20:41 Michael Elizabeth Chastain
2003-04-04 21:31 ` Stephane Carrez
0 siblings, 1 reply; 10+ messages in thread
From: Michael Elizabeth Chastain @ 2003-04-04 20:41 UTC (permalink / raw)
To: stcarrez; +Cc: gdb-patches
I could be wrong, but I don't think you can put comments in the
middle of a gdb_expect block like this.
+ # marker4() is defined at line 46 when compiled with -DPROTOTYPES
+ -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
+ pass "run until breakpoint set at small function, optimized file"
+ }
I think you have to do this:
-re "Breakpoint ... void marker.*" {
# marker4() is defined at line 46 when compiled with -DPROTOTYPES
pass "run until breakpoint set at small function, optimized file"
}
Michael C
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
2003-04-04 20:41 [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES Michael Elizabeth Chastain
@ 2003-04-04 21:31 ` Stephane Carrez
2003-04-04 22:29 ` Daniel Jacobowitz
0 siblings, 1 reply; 10+ messages in thread
From: Stephane Carrez @ 2003-04-04 21:31 UTC (permalink / raw)
To: Michael Elizabeth Chastain; +Cc: gdb-patches
Hi!
Michael Elizabeth Chastain wrote:
> I could be wrong, but I don't think you can put comments in the
> middle of a gdb_expect block like this.
>
> + # marker4() is defined at line 46 when compiled with -DPROTOTYPES
> + -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
> + pass "run until breakpoint set at small function, optimized file"
> + }
>
> I think you have to do this:
>
> -re "Breakpoint ... void marker.*" {
> # marker4() is defined at line 46 when compiled with -DPROTOTYPES
> pass "run until breakpoint set at small function, optimized file"
> }
>
> Michael C
>
>
I wasn't sure too..
But I verified that it worked before the commit...
Stephane
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
2003-04-04 21:31 ` Stephane Carrez
@ 2003-04-04 22:29 ` Daniel Jacobowitz
2003-04-05 10:46 ` Stephane Carrez
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2003-04-04 22:29 UTC (permalink / raw)
To: Stephane Carrez; +Cc: Michael Elizabeth Chastain, gdb-patches
On Fri, Apr 04, 2003 at 11:31:37PM +0200, Stephane Carrez wrote:
> Hi!
>
> Michael Elizabeth Chastain wrote:
> >I could be wrong, but I don't think you can put comments in the
> >middle of a gdb_expect block like this.
> >
> > + # marker4() is defined at line 46 when compiled with -DPROTOTYPES
> > + -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at
> > .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
> > + pass "run until breakpoint set at small function, optimized file"
> > + }
> >
> >I think you have to do this:
> >
> > -re "Breakpoint ... void marker.*" {
> > # marker4() is defined at line 46 when compiled with -DPROTOTYPES
> > pass "run until breakpoint set at small function, optimized file"
> > }
> >
> >Michael C
> >
> >
> I wasn't sure too..
>
> But I verified that it worked before the commit...
It may have worked, but Michael is right. It will parse the comment as
a series of patterns and code blocks.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
2003-04-04 22:29 ` Daniel Jacobowitz
@ 2003-04-05 10:46 ` Stephane Carrez
2003-04-05 13:20 ` Andrew Cagney
0 siblings, 1 reply; 10+ messages in thread
From: Stephane Carrez @ 2003-04-05 10:46 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Michael Elizabeth Chastain, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1153 bytes --]
Hi!
Daniel Jacobowitz wrote:
> On Fri, Apr 04, 2003 at 11:31:37PM +0200, Stephane Carrez wrote:
>
>>Hi!
>>
>>Michael Elizabeth Chastain wrote:
>>
>>>I could be wrong, but I don't think you can put comments in the
>>>middle of a gdb_expect block like this.
>>>
>>> + # marker4() is defined at line 46 when compiled with -DPROTOTYPES
>>> + -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at
>>> .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
>>> + pass "run until breakpoint set at small function, optimized file"
>>> + }
>>>
>>>I think you have to do this:
>>>
>>> -re "Breakpoint ... void marker.*" {
>>> # marker4() is defined at line 46 when compiled with -DPROTOTYPES
>>> pass "run until breakpoint set at small function, optimized file"
>>> }
>>>
>>>Michael C
>>>
>>>
>>
>>I wasn't sure too..
>>
>>But I verified that it worked before the commit...
>
>
> It may have worked, but Michael is right. It will parse the comment as
> a series of patterns and code blocks.
>
Ok, it's very bad then. I've removed the patch.
Stephane
2003-04-05 Stephane Carrez <stcarrez@nerim.fr>
* gdb.base/break.exp: Revert last patch.
[-- Attachment #2: break.exp.diffs --]
[-- Type: text/plain, Size: 920 bytes --]
Index: gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.15
diff -u -p -r1.15 break.exp
--- gdb.base/break.exp 4 Apr 2003 20:03:46 -0000 1.15
+++ gdb.base/break.exp 5 Apr 2003 10:40:04 -0000
@@ -914,10 +914,6 @@ gdb_expect {
-re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
- # marker4() is defined at line 46 when compiled with -DPROTOTYPES
- -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
- pass "run until breakpoint set at small function, optimized file"
- }
-re ".*$gdb_prompt " {
fail "run until breakpoint set at small function, optimized file"
}
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
2003-04-05 10:46 ` Stephane Carrez
@ 2003-04-05 13:20 ` Andrew Cagney
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Cagney @ 2003-04-05 13:20 UTC (permalink / raw)
To: Stephane Carrez
Cc: Daniel Jacobowitz, Michael Elizabeth Chastain, gdb-patches
It just needs a tweak vis:
> - -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
> - # marker4() is defined at line 46 when compiled with -DPROTOTYPES
> - pass "run until breakpoint set at small function, optimized file"
> - }
and that works just fine. The problem you encountered is just a weird
querk of tcl. Since `#' is a command, and not a comment, it can only be
used where other commands can be used.
Andrew
^ permalink raw reply [flat|nested] 10+ messages in thread
* [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
@ 2003-02-24 21:19 Stephane Carrez
2003-02-24 21:34 ` Elena Zannoni
2003-04-04 20:09 ` Stephane Carrez
0 siblings, 2 replies; 10+ messages in thread
From: Stephane Carrez @ 2003-02-24 21:19 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 502 bytes --]
Hi!
In the gdb.base/break.c test, the function marker4() is defined at line 46 when
the test is compiled with -DPROTOTYPES and at line 51 otherwise. The break.exp
test only check for line 51.
This patch adds the missing regexp for marker4 at line 46.
(tested with make check for m6811-elf; break.exp passes completely)
Can you approve it?
Thanks,
Stephane
2003-02-24 Stephane Carrez <stcarrez@nerim.fr>
* gdb.base/break.exp: marker4() is defined at line 46 when compiled
with -DPROTOTYPES.
[-- Attachment #2: break.exp.diffs --]
[-- Type: text/plain, Size: 1169 bytes --]
Index: gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.14
diff -u -p -r1.14 break.exp
--- gdb.base/break.exp 16 Jan 2003 01:56:15 -0000 1.14
+++ gdb.base/break.exp 24 Feb 2003 21:13:24 -0000
@@ -907,11 +907,16 @@ if ![target_info exists use_gdb_stub] {
# as if it were in the middle of a line rather than at the beginning.
send_gdb "continue\n"
+# marker4() is defined at line 46 when compiled with -DPROTOTYPES
+# and at line 51 otherwise.
gdb_expect {
-re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
-re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
+ pass "run until breakpoint set at small function, optimized file"
+ }
+ -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
-re ".*$gdb_prompt " {
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
2003-02-24 21:19 Stephane Carrez
@ 2003-02-24 21:34 ` Elena Zannoni
2003-02-24 21:46 ` Stephane Carrez
2003-04-04 20:09 ` Stephane Carrez
1 sibling, 1 reply; 10+ messages in thread
From: Elena Zannoni @ 2003-02-24 21:34 UTC (permalink / raw)
To: Stephane Carrez; +Cc: gdb-patches
Stephane Carrez writes:
> Hi!
>
> In the gdb.base/break.c test, the function marker4() is defined at line 46 when
> the test is compiled with -DPROTOTYPES and at line 51 otherwise. The break.exp
> test only check for line 51.
>
> This patch adds the missing regexp for marker4 at line 46.
> (tested with make check for m6811-elf; break.exp passes completely)
>
> Can you approve it?
>
Could this be fixed by adding a comment to the lines in question,
use gdb_get_line_number, and use that in the test?
elena
> Thanks,
> Stephane
>
> 2003-02-24 Stephane Carrez <stcarrez@nerim.fr>
>
> * gdb.base/break.exp: marker4() is defined at line 46 when compiled
> with -DPROTOTYPES.
> Index: gdb.base/break.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
> retrieving revision 1.14
> diff -u -p -r1.14 break.exp
> --- gdb.base/break.exp 16 Jan 2003 01:56:15 -0000 1.14
> +++ gdb.base/break.exp 24 Feb 2003 21:13:24 -0000
> @@ -907,11 +907,16 @@ if ![target_info exists use_gdb_stub] {
> # as if it were in the middle of a line rather than at the beginning.
>
> send_gdb "continue\n"
> +# marker4() is defined at line 46 when compiled with -DPROTOTYPES
> +# and at line 51 otherwise.
> gdb_expect {
> -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
> pass "run until breakpoint set at small function, optimized file"
> }
> -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
> + pass "run until breakpoint set at small function, optimized file"
> + }
> + -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
> pass "run until breakpoint set at small function, optimized file"
> }
> -re ".*$gdb_prompt " {
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
2003-02-24 21:34 ` Elena Zannoni
@ 2003-02-24 21:46 ` Stephane Carrez
2003-02-24 23:34 ` Jason Molenda
0 siblings, 1 reply; 10+ messages in thread
From: Stephane Carrez @ 2003-02-24 21:46 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
Hi Elena,
Elena Zannoni wrote:
> Stephane Carrez writes:
> > Hi!
> >
> > In the gdb.base/break.c test, the function marker4() is defined at line 46 when
> > the test is compiled with -DPROTOTYPES and at line 51 otherwise. The break.exp
> > test only check for line 51.
> >
> > This patch adds the missing regexp for marker4 at line 46.
> > (tested with make check for m6811-elf; break.exp passes completely)
> >
> > Can you approve it?
> >
>
> Could this be fixed by adding a comment to the lines in question,
> use gdb_get_line_number, and use that in the test?
>
It's not good because marker4() is defined at 2 different lines.
If we use gdb_get_line_number() it will always find the first match which is at 46
and the test will fail for targets that don't compile their tests with -DPROTOTYPES.
Stephane
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
2003-02-24 21:46 ` Stephane Carrez
@ 2003-02-24 23:34 ` Jason Molenda
0 siblings, 0 replies; 10+ messages in thread
From: Jason Molenda @ 2003-02-24 23:34 UTC (permalink / raw)
To: Stephane Carrez; +Cc: Elena Zannoni, gdb-patches
On Monday, February 24, 2003, at 01:46 PM, Stephane Carrez wrote:
> It's not good because marker4() is defined at 2 different lines.
>
> If we use gdb_get_line_number() it will always find the first match
> which is at 46
>
> and the test will fail for targets that don't compile their tests with
> -DPROTOTYPES.
Another alternative is to grab the line number when the breakpoint is
set, and compare against that. It does mean that gdb could have the
line number woefully incorrect, but at least gdb has to be consistently
incorrect. e.g. something like
send_gdb "break marker4\n"
gdb_expect {
-re "Breakpoint.*at.* file .*$srcfile, line ($decimal).*" {
set marker4_lineno $expect_out(1,string)
}
[...]
}
Or drop the PROTOTYPES-is-undefined case altogether. I have no idea if
there are cross-compilers in use that don't support prototypes, though..
J
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES
2003-02-24 21:19 Stephane Carrez
2003-02-24 21:34 ` Elena Zannoni
@ 2003-04-04 20:09 ` Stephane Carrez
1 sibling, 0 replies; 10+ messages in thread
From: Stephane Carrez @ 2003-04-04 20:09 UTC (permalink / raw)
To: Stephane Carrez; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 326 bytes --]
Hi!
Following Andrew's suggestion and approval, I've committed the attached patch.
(see also http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=1096)
2003-04-04 Stephane Carrez <stcarrez@nerim.fr>
* gdb.base/break.exp: marker4() is defined at line 46 when compiled
with -DPROTOTYPES.
[-- Attachment #2: break.exp.diffs --]
[-- Type: text/plain, Size: 895 bytes --]
Index: gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.14
diff -u -p -r1.14 break.exp
--- gdb.base/break.exp 16 Jan 2003 01:56:15 -0000 1.14
+++ gdb.base/break.exp 4 Apr 2003 20:03:15 -0000
@@ -914,6 +914,10 @@ gdb_expect {
-re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
pass "run until breakpoint set at small function, optimized file"
}
+ # marker4() is defined at line 46 when compiled with -DPROTOTYPES
+ -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:46\[\r\n\]+46\[\t \]+void marker4.*" {
+ pass "run until breakpoint set at small function, optimized file"
+ }
-re ".*$gdb_prompt " {
fail "run until breakpoint set at small function, optimized file"
}
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2003-04-05 13:20 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-04 20:41 [RFA]: Fix testsuite/gdb.base/break.exp when test compiled with -DPROTOTYPES Michael Elizabeth Chastain
2003-04-04 21:31 ` Stephane Carrez
2003-04-04 22:29 ` Daniel Jacobowitz
2003-04-05 10:46 ` Stephane Carrez
2003-04-05 13:20 ` Andrew Cagney
-- strict thread matches above, loose matches on Subject: below --
2003-02-24 21:19 Stephane Carrez
2003-02-24 21:34 ` Elena Zannoni
2003-02-24 21:46 ` Stephane Carrez
2003-02-24 23:34 ` Jason Molenda
2003-04-04 20:09 ` Stephane Carrez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox