* Re: [RFC] fullname attribute for GDB/MI stack frames
@ 2005-05-05 15:15 Dennis Brueni
2005-05-05 15:25 ` Bob Rossi
0 siblings, 1 reply; 103+ messages in thread
From: Dennis Brueni @ 2005-05-05 15:15 UTC (permalink / raw)
To: gdb-patches; +Cc: Dennis Brueni, Bob Rossi
On Wed, 4 May 2005 20:05:06 -0400, Bob Rossi wrote:
>
> This may or may not be what you mean. However, if you do
> -file-list-exec-source-files, GDB prints the filename and fullname for
> every file that it knows about. The purpose of this is to let the
front
> end know about each and every file that GDB knows about. As I've
stated
> before, I believe most if not all FE's depend on the fullname to be a
> unique key.
I think you have just struck on the right way to write the tests
for fullname with respect to stack frames. Forget regex's, we
want the value of the fullname to exactly match the same fullname
attribute pumped out by -file-list-exec-source-files. This would just
take one utility function. The test for -file-list-exec-source-files
could then be the central point for verifying the "correctness" of
fullname. I'm willing to redo my stack/fullname tests if this idea
is amenable to the group.
--Dennis
------------------------
Dennis Brueni
Software Engineer
SlickEdit Inc.
3000 Aerial Center Pkwy
Suite 120
Morrisville, NC 27560
Tel: 919.473.0132
Fax: 919.473.0080
http://www.slickedit.com
------------------------
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-05 15:15 [RFC] fullname attribute for GDB/MI stack frames Dennis Brueni
@ 2005-05-05 15:25 ` Bob Rossi
2005-05-05 15:28 ` Daniel Jacobowitz
0 siblings, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-05 15:25 UTC (permalink / raw)
To: Dennis Brueni; +Cc: gdb-patches
On Thu, May 05, 2005 at 11:15:26AM -0400, Dennis Brueni wrote:
> On Wed, 4 May 2005 20:05:06 -0400, Bob Rossi wrote:
> >
> > This may or may not be what you mean. However, if you do
> > -file-list-exec-source-files, GDB prints the filename and fullname for
> > every file that it knows about. The purpose of this is to let the
> front
> > end know about each and every file that GDB knows about. As I've
> stated
> > before, I believe most if not all FE's depend on the fullname to be a
> > unique key.
>
> I think you have just struck on the right way to write the tests
> for fullname with respect to stack frames. Forget regex's, we
> want the value of the fullname to exactly match the same fullname
> attribute pumped out by -file-list-exec-source-files. This would just
> take one utility function. The test for -file-list-exec-source-files
> could then be the central point for verifying the "correctness" of
> fullname. I'm willing to redo my stack/fullname tests if this idea
> is amenable to the group.
The value of the fullname will always match the output of
-file-list-exec-source-files. You use the same function
"source_full_path_of" and pass in the same symtab that
-file-list-exec-source-files uses. In fact, that function reuse's
symtab->fullname if it has already been calculated and is still on the
disk.
I personally think that at best, Eli's originally regex will need to be
used. For instance, I don't believe that GDB should change in order to
get the proper regex in this testcase. I believe that we should use a
regex that matches the current output of GDB. If it is determined that
GDB is broke, it can be fixed in another patch.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-05 15:25 ` Bob Rossi
@ 2005-05-05 15:28 ` Daniel Jacobowitz
2005-05-05 15:32 ` Bob Rossi
0 siblings, 1 reply; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-05 15:28 UTC (permalink / raw)
To: Dennis Brueni, gdb-patches
On Thu, May 05, 2005 at 11:25:37AM -0400, Bob Rossi wrote:
> I personally think that at best, Eli's originally regex will need to be
> used. For instance, I don't believe that GDB should change in order to
> get the proper regex in this testcase. I believe that we should use a
> regex that matches the current output of GDB. If it is determined that
> GDB is broke, it can be fixed in another patch.
I agree. I don't much care what the regular expression is; I'm just
waiting for you to take care of that before I return to the initial
patch.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-05 15:28 ` Daniel Jacobowitz
@ 2005-05-05 15:32 ` Bob Rossi
0 siblings, 0 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-05 15:32 UTC (permalink / raw)
To: Dennis Brueni, gdb-patches
On Thu, May 05, 2005 at 11:27:51AM -0400, Daniel Jacobowitz wrote:
> On Thu, May 05, 2005 at 11:25:37AM -0400, Bob Rossi wrote:
> > I personally think that at best, Eli's originally regex will need to be
> > used. For instance, I don't believe that GDB should change in order to
> > get the proper regex in this testcase. I believe that we should use a
> > regex that matches the current output of GDB. If it is determined that
> > GDB is broke, it can be fixed in another patch.
>
> I agree. I don't much care what the regular expression is; I'm just
> waiting for you to take care of that before I return to the initial
> patch.
OK, I'll do that right now.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* RE: [RFC] fullname attribute for GDB/MI stack frames
@ 2005-05-02 14:22 Dennis Brueni
2005-05-02 19:38 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Dennis Brueni @ 2005-05-02 14:22 UTC (permalink / raw)
To: gdb-patches; +Cc: Bob Rossi, Eli Zaretskii, Daniel Jacobowitz
> -----Original Message-----
>
> > > Like Dennis noted, it could be possible that the fullname
> might not
> > > start with a "/". I originally posted the patch with the fullname
> > > starting with a "/", and since then, there hasn't been any
> > > complaints. If there is a better regex that ensures that the
> > > fullname is absolute I'd be happy to change the
> mi-file.exp test to
> > > it.
> >
> > The proper regexp should be something like
> >
> > \([A-z]:\)?[/\\].*basics.c
> >
> > This assumes that \(...\) is the proper syntax for grouping
> (I don't
> > know much about the regexp syntax expected by Expect).
> >
> > (The uppercase A but lowercase z in the above are
> intentional: that's
> > because letters between Z and a can also be drive letters, amazingly
> > enough.)
>
> OK, I don't know why no one has ever posted to this list with
> testsuite failures on the mi-file.exp testcase. Maybe no one
> runs the mi testsuite
> on windows?
I tried. Many failures, unrelated to fullname, led me to
believe that configuration was not considered as supported
by the mi testsuite.
Also, in my tests at least, the fullname paths from stack frames
all come back as /cygdrive/<drive_letter>/..., so the simplistic
regex would suffice.
> Either way, I'm going to submit a patch later today which
> will add a variable to mi-support.exp similar to
> mi_gdb_prompt. The variable will describe the syntax of a
> fullname field. It will abstract the details
> and complications from new users trying to write testcase's.
>
> I'll try to find time to make this quick change tonight. If
> people don't like this idea, let me know.
This is a good idea, but as the complexity of the regex
increases it becomes more compelling to do an exact check.
Calculate what the absolute path to the source file should
be and compare that with the fullname attribute. However,
I'm not volunteering to do that. ;) It's easy to overblow
the testing for what amounts to a five line code change.
--Dennis
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 14:22 Dennis Brueni
@ 2005-05-02 19:38 ` Eli Zaretskii
0 siblings, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-02 19:38 UTC (permalink / raw)
To: Dennis Brueni; +Cc: gdb-patches, bob, drow
> Date: Mon, 2 May 2005 10:22:19 -0400
> From: "Dennis Brueni" <dbrueni@slickedit.com>
> Cc: "Bob Rossi" <bob@brasko.net>,
> "Eli Zaretskii" <eliz@gnu.org>,
> "Daniel Jacobowitz" <drow@false.org>
>
> Also, in my tests at least, the fullname paths from stack frames
> all come back as /cygdrive/<drive_letter>/..., so the simplistic
> regex would suffice.
Please don't count on that. The test suite should work for all
supported platforms, not only for Cygwin. The other non-Posix
platforms don't have the /cygdrive/<drive_letter>/ thingy.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
@ 2005-04-01 19:13 Dennis Brueni
2005-04-02 9:22 ` Eli Zaretskii
2005-04-30 19:18 ` Daniel Jacobowitz
0 siblings, 2 replies; 103+ messages in thread
From: Dennis Brueni @ 2005-04-01 19:13 UTC (permalink / raw)
To: gdb-patches; +Cc: bob
> -----Original Message-----
> From: Bob Rossi [mailto:bob@brasko.net]
> Sent: Thursday, March 31, 2005 9:40 PM
> To: Dennis Brueni
> Cc: gdb-patches@sources.redhat.com
> Subject: Re: [RFC] fullname attribute for GDB/MI stack frames
>
>
> > > I would look at mi-file.exp. Make sure the regex you use in the
> > > testsuite for matching the fullname is fullname=\"/.*/${srcfile}\"
> > >
> > > I know that I originally committed something different,
> and it ended
> > > up morphing into this, so that it could pass the testsuite in a
> > > variety of different environments.
> > >
> > > Bob Rossi
> >
> >
> > Apologies for the broken lines; I also noticed that, after
> the fact :(
> > Updated patch set follows.
> >
> > I have fixed the path issues in gdb.texinfo and also added
> ChangeLog
> > entries to the patch set.
> >
> > For the testsuite regex's, I was just trying to remain
> consistent with
> > the tests for "file=" and not break anything.
> > # # NOTE: cagney/2003-02-03: Not yet.
> > # mi_gdb_test "-exec-continue" \
> > ! #
> {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".
> *basics.c",line="8"\}} \
> > # "-interpreter-exec console \"continue to callee4\""
> > send_gdb "999-exec-continue\n"
> > gdb_expect {
> > --- 100,106 ----
> >
> > # # NOTE: cagney/2003-02-03: Not yet.
> > # mi_gdb_test "-exec-continue" \
> > ! #
> {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".
> *basics.c",fullname=".*basics.c",line="8"\}} \
> > # "-interpreter-exec console \"continue to callee4\""
> > send_gdb "999-exec-continue\n"
> > gdb_expect {
>
> Hi,
>
> Again, for the fullname regex, I would recommend using the
> same regex used in mi-file.exp. This would be like
> fullname="/.*basics.c" This forces the regex to ensure that
> the path is absolute, which the check you have does not.
>
> Bob Rossi
>
As promised, here is an updated patch set with the regex
changes you suggested, plus checking for a little more directory
information with respect to the fullname path, to the extent
that we can be sure the test case still passes in all environments.
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.7049
diff -c -p -b -r1.7049 ChangeLog
*** ChangeLog 31 Mar 2005 20:39:08 -0000 1.7049
--- ChangeLog 1 Apr 2005 16:06:42 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2005-03-29 Dennis Brueni <dennis@slickedit.com>
+
+ * stack.c (print_frame): In MI mode,
+ output fullname attribute with stack frame
+
2005-03-31 Kevin Buettner <kevinb@redhat.com>
* solib-frv.c (struct lm_info): Add new field ``lm_addr''.
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.130
diff -c -p -b -r1.130 stack.c
*** stack.c 28 Feb 2005 17:00:49 -0000 1.130
--- stack.c 1 Apr 2005 16:06:42 -0000
*************** print_frame (struct frame_info *fi,
*** 679,684 ****
--- 679,692 ----
ui_out_text (uiout, " at ");
annotate_frame_source_file ();
ui_out_field_string (uiout, "file", sal.symtab->filename);
+ if (ui_out_is_mi_like_p(uiout)) {
+ if (!sal.symtab->fullname) {
+ symtab_to_fullname(sal.symtab);
+ }
+ if (sal.symtab->fullname) {
+ ui_out_field_string (uiout, "fullname", sal.symtab->fullname);
+ }
+ }
annotate_frame_source_file_end ();
ui_out_text (uiout, ":");
annotate_frame_source_line ();
Index: doc/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/doc/ChangeLog,v
retrieving revision 1.473
diff -c -p -b -r1.473 ChangeLog
*** doc/ChangeLog 10 Mar 2005 13:12:32 -0000 1.473
--- doc/ChangeLog 1 Apr 2005 16:06:43 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2005-03-29 Dennis Brueni <dennis@slickedit.com>
+
+ * gdb.texinfo: Update docs for MI stack frames with fullname attribute.
+
2005-03-10 Bob Rossi <bob@brasko.net>
* gdb.texinfo: Update copyright
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.233
diff -c -p -b -r1.233 gdb.texinfo
*** doc/gdb.texinfo 10 Mar 2005 13:12:33 -0000 1.233
--- doc/gdb.texinfo 1 Apr 2005 16:06:47 -0000
*************** Setting a watchpoint on a variable in th
*** 15894,15900 ****
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
value=@{old="-268439212",new="55"@},
! frame=@{func="main",args=[],file="recursive2.c",line="5"@}
(@value{GDBP})
@end smallexample
--- 15894,15901 ----
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
value=@{old="-268439212",new="55"@},
! frame=@{func="main",args=[],file="recursive2.c",
! fullname="/home/foo/bar/devo/myproject/recursive2.c",line="5"@}
(@value{GDBP})
@end smallexample
*************** for the watchpoint going out of scope.
*** 15912,15925 ****
^done,reason="watchpoint-trigger",
wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
--- 15913,15928 ----
^done,reason="watchpoint-trigger",
wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
*************** enabled="y",addr="",what="C",times="0"@}
*** 15951,15957 ****
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
--- 15954,15961 ----
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
*************** enabled="y",addr="",what="C",times="-5"@
*** 15972,15978 ****
^done,reason="watchpoint-scope",wpnum="2",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
--- 15976,15983 ----
^done,reason="watchpoint-scope",wpnum="2",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
*************** On a PPC MBX board:
*** 16207,16213 ****
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
! args=[],file="try.c",line="5"@}
(@value{GDBP})
-data-list-changed-registers
^done,changed-registers=["0","1","2","4","5","6","7","8","9",
--- 16212,16218 ----
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
! args=[],file="try.c",fullname="/home/foo/bar/devo/myproject/try.c",line="5"@}
(@value{GDBP})
-data-list-changed-registers
^done,changed-registers=["0","1","2","4","5","6","7","8","9",
*************** The corresponding @value{GDBN} correspon
*** 16814,16820 ****
(@value{GDBP})
@@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
! file="hello.c",line="13"@}
(@value{GDBP})
@end smallexample
--- 16819,16825 ----
(@value{GDBP})
@@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
! file="hello.c",fullname="/home/foo/bar/devo/myproject/hello.c",line="13"@}
(@value{GDBP})
@end smallexample
*************** Function returning @code{void}.
*** 16846,16852 ****
(@value{GDBP})
@@hello from foo
*stopped,reason="function-finished",frame=@{func="main",args=[],
! file="hello.c",line="7"@}
(@value{GDBP})
@end smallexample
--- 16851,16857 ----
(@value{GDBP})
@@hello from foo
*stopped,reason="function-finished",frame=@{func="main",args=[],
! file="hello.c",fullname="/home/foo/bar/devo/myproject/hello.c",line="7"@}
(@value{GDBP})
@end smallexample
*************** value itself.
*** 16860,16866 ****
(@value{GDBP})
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
args=[@{name="a",value="1"],@{name="b",value="9"@}@},
! file="recursive2.c",line="14"@},
gdb-result-var="$1",return-value="0"
(@value{GDBP})
@end smallexample
--- 16865,16871 ----
(@value{GDBP})
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
args=[@{name="a",value="1"],@{name="b",value="9"@}@},
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
gdb-result-var="$1",return-value="0"
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 16897,16903 ****
222^done
(@value{GDBP})
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
! frame=@{addr="0x00010140",func="foo",args=[],file="try.c",line="13"@}
(@value{GDBP})
(@value{GDBP})
--- 16902,16909 ----
222^done
(@value{GDBP})
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
! frame=@{addr="0x00010140",func="foo",args=[],file="try.c",
! fullname="/home/foo/bar/devo/myproject/try.c",line="13"@}
(@value{GDBP})
(@value{GDBP})
*************** file="../../../devo/gdb/testsuite/gdb.mi
*** 16995,17001 ****
(@value{GDBP})
000*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
(@value{GDBP})
205-break-delete
205^done
--- 17001,17008 ----
(@value{GDBP})
000*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
(@value{GDBP})
205-break-delete
205^done
*************** file="../../../devo/gdb/testsuite/gdb.mi
*** 17004,17010 ****
111^done,frame=@{level="0",func="callee3",
args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
--- 17011,17018 ----
111^done,frame=@{level="0",func="callee3",
args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 17037,17043 ****
^running
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",
! frame=@{func="main",args=[],file="recursive2.c",line="4"@}
(@value{GDBP})
@end smallexample
--- 17045,17052 ----
^running
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",
! frame=@{func="main",args=[],file="recursive2.c",
! fullname="/home/foo/bar/devo/myproject/recursive2.c",line="4"@}
(@value{GDBP})
@end smallexample
*************** Stepping into a function:
*** 17090,17096 ****
(@value{GDBP})
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=[@{name="a",value="10"@},
! @{name="b",value="0"@}],file="recursive2.c",line="11"@}
(@value{GDBP})
@end smallexample
--- 17099,17106 ----
(@value{GDBP})
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=[@{name="a",value="10"@},
! @{name="b",value="0"@}],file="recursive2.c",
! fullname="/home/foo/bar/devo/myproject/recursive2.c",line="11"@}
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 17133,17146 ****
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{func="foo",args=[],file="try.c",line="10"@}
(@value{GDBP})
-exec-step-instruction
^running
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",line="10"@}
(@value{GDBP})
@end smallexample
--- 17143,17158 ----
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{func="foo",args=[],file="try.c",
! fullname="/home/foo/bar/devo/myproject/try.c",line="10"@}
(@value{GDBP})
-exec-step-instruction
^running
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",
! fullname="/home/foo/bar/devo/myproject/try.c",line="10"@}
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 17172,17178 ****
(@value{GDBP})
x = 55
*stopped,reason="location-reached",frame=@{func="main",args=[],
! file="recursive2.c",line="6"@}
(@value{GDBP})
@end smallexample
--- 17184,17190 ----
(@value{GDBP})
x = 55
*stopped,reason="location-reached",frame=@{func="main",args=[],
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="6"@}
(@value{GDBP})
@end smallexample
*************** functionality of @samp{-stack-list-argum
*** 17672,17686 ****
^done,
stack=[
frame=@{level="0",addr="0x00010734",func="callee4",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
frame=@{level="1",addr="0x0001076c",func="callee3",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
frame=@{level="2",addr="0x0001078c",func="callee2",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
frame=@{level="3",addr="0x000107b4",func="callee1",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
frame=@{level="4",addr="0x000107e0",func="main",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
(@value{GDBP})
-stack-list-arguments 0
^done,
--- 17684,17703 ----
^done,
stack=[
frame=@{level="0",addr="0x00010734",func="callee4",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
frame=@{level="1",addr="0x0001076c",func="callee3",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
frame=@{level="2",addr="0x0001078c",func="callee2",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
frame=@{level="3",addr="0x000107b4",func="callee1",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
frame=@{level="4",addr="0x000107e0",func="main",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
(@value{GDBP})
-stack-list-arguments 0
^done,
*************** Full stack backtrace:
*** 17762,17790 ****
-stack-list-frames
^done,stack=
[frame=@{level="0",addr="0x0001076c",func="foo",
! file="recursive2.c",line="11"@},
frame=@{level="1",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="2",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="6",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="7",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="8",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="9",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="10",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="11",addr="0x00010738",func="main",
! file="recursive2.c",line="4"@}]
(@value{GDBP})
@end smallexample
--- 17779,17807 ----
-stack-list-frames
^done,stack=
[frame=@{level="0",addr="0x0001076c",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="11"@},
frame=@{level="1",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="2",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="6",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="7",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="8",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="9",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="10",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="11",addr="0x00010738",func="main",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="4"@}]
(@value{GDBP})
@end smallexample
*************** Show frames between @var{low_frame} and
*** 17795,17805 ****
-stack-list-frames 3 5
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
--- 17812,17822 ----
-stack-list-frames 3 5
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
*************** Show a single frame:
*** 17810,17816 ****
-stack-list-frames 3 3
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
--- 17827,17833 ----
-stack-list-frames 3 3
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
Index: testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.1096
diff -c -p -b -r1.1096 ChangeLog
*** testsuite/ChangeLog 29 Mar 2005 20:37:18 -0000 1.1096
--- testsuite/ChangeLog 1 Apr 2005 16:06:50 -0000
***************
*** 1,3 ****
--- 1,22 ----
+ 2005-03-29 Dennis Brueni <dennis@slickedit.com>
+
+ * gdb.mi/mi-cli.exp: Add tests for fullname in stack frame.
+ * gdb.mi/mi-return.exp: Likewise.
+ * gdb.mi/mi-stack.exp: Likewise.
+ * gdb.mi/mi-stepi.exp: Likewise.
+ * gdb.mi/mi-syn-frame.exp: Likewise.
+ * gdb.mi/mi-until.exp: Likewise.
+ * gdb.mi/mi-var-display.exp: Likewise.
+ * gdb.mi/mi-watch.exp: Likewise.
+ * gdb.mi/mi2-cli.exp: Likewise.
+ * gdb.mi/mi2-return.exp: Likewise.
+ * gdb.mi/mi2-stack.exp: Likewise.
+ * gdb.mi/mi2-stepi.exp: Likewise.
+ * gdb.mi/mi2-syn-frame.exp: Likewise.
+ * gdb.mi/mi2-until.exp: Likewise.
+ * gdb.mi/mi2-var-display.exp: Likewise.
+ * lib/mi-support.exp: Likewise.
+
2005-03-29 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.base/ptr-typedef.exp, gdb.base/ptr-typedef.c: New files.
Index: testsuite/gdb.mi/mi-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-cli.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi-cli.exp
*** testsuite/gdb.mi/mi-cli.exp 15 Aug 2004 10:15:58 -0000 1.3
--- testsuite/gdb.mi/mi-cli.exp 1 Apr 2005 16:06:51 -0000
*************** mi_gdb_test "-interpreter-exec console \
*** 100,106 ****
# # NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \
# "-interpreter-exec console \"continue to callee4\""
send_gdb "999-exec-continue\n"
gdb_expect {
--- 100,106 ----
# # NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",fullname="/.*/gdb/testsuite/gdb.mi/basics.c",line="8"\}} \
# "-interpreter-exec console \"continue to callee4\""
send_gdb "999-exec-continue\n"
gdb_expect {
*************** mi_gdb_test "600-break-insert -t basics.
*** 161,171 ****
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
--- 161,171 ----
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",fullname="/.*/gdb/testsuite/gdb.mi/basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
*************** gdb_expect {
*** 175,185 ****
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! # {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=.*basics.c.,line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
--- 175,185 ----
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! # {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",fullname="/.*/gdb/testsuite/gdb.mi/basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
Index: testsuite/gdb.mi/mi-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-return.exp,v
retrieving revision 1.11
diff -c -p -b -r1.11 mi-return.exp
*** testsuite/gdb.mi/mi-return.exp 15 Aug 2004 10:15:58 -0000 1.11
--- testsuite/gdb.mi/mi-return.exp 1 Apr 2005 16:06:51 -0000
*************** proc test_return_simple {} {
*** 53,59 ****
send_gdb "111-exec-return\n"
gdb_expect {
! -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
--- 53,59 ----
send_gdb "111-exec-return\n"
gdb_expect {
! -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
Index: testsuite/gdb.mi/mi-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stack.exp,v
retrieving revision 1.14
diff -c -p -b -r1.14 mi-stack.exp
*** testsuite/gdb.mi/mi-stack.exp 15 Aug 2004 10:15:58 -0000 1.14
--- testsuite/gdb.mi/mi-stack.exp 1 Apr 2005 16:06:51 -0000
*************** proc test_stack_frame_listing {} {
*** 57,63 ****
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
! "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
--- 57,63 ----
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
! "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
*************** set line_callee4_return_0 [gdb_get_line_
*** 161,167 ****
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
--- 161,167 ----
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
Index: testsuite/gdb.mi/mi-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stepi.exp,v
retrieving revision 1.10
diff -c -p -b -r1.10 mi-stepi.exp
*** testsuite/gdb.mi/mi-stepi.exp 15 Aug 2004 10:15:58 -0000 1.10
--- testsuite/gdb.mi/mi-stepi.exp 1 Apr 2005 16:06:51 -0000
*************** proc test_stepi_nexti {} {
*** 53,59 ****
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
--- 53,59 ----
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
*************** proc test_stepi_nexti {} {
*** 67,73 ****
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
--- 67,73 ----
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
*************** proc test_stepi_nexti {} {
*** 81,87 ****
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
--- 81,87 ----
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
Index: testsuite/gdb.mi/mi-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-syn-frame.exp,v
retrieving revision 1.2
diff -c -p -b -r1.2 mi-syn-frame.exp
*** testsuite/gdb.mi/mi-syn-frame.exp 24 Feb 2003 20:15:47 -0000 1.2
--- testsuite/gdb.mi/mi-syn-frame.exp 1 Apr 2005 16:06:51 -0000
*************** gdb_expect {
*** 69,75 ****
}
}
! mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
--- 69,75 ----
}
}
! mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
*************** mi_gdb_test "406-data-evaluate-expressio
*** 83,89 ****
# We should have both a signal handler and a call dummy frame
# in this next output.
! mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"<signal handler called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
send_gdb "408-exec-continue\n"
--- 83,89 ----
# We should have both a signal handler and a call dummy frame
# in this next output.
! mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"<signal handler called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
send_gdb "408-exec-continue\n"
*************** gdb_expect {
*** 96,102 ****
}
}
! mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
--- 96,102 ----
}
}
! mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
*************** mi_gdb_test "409-stack-list-frames 0 0"
*** 104,110 ****
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
! mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
--- 104,110 ----
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
! mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
Index: testsuite/gdb.mi/mi-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v
retrieving revision 1.8
diff -c -p -b -r1.8 mi-until.exp
*** testsuite/gdb.mi/mi-until.exp 9 Aug 2004 16:32:44 -0000 1.8
--- testsuite/gdb.mi/mi-until.exp 1 Apr 2005 16:06:51 -0000
*************** proc test_until {} {
*** 78,84 ****
send_gdb "111-exec-until\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
--- 78,84 ----
send_gdb "111-exec-until\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
*************** proc test_until {} {
*** 88,94 ****
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
--- 88,94 ----
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
*************** proc test_until {} {
*** 98,104 ****
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
--- 98,104 ----
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
*************** proc test_until {} {
*** 110,116 ****
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
--- 110,116 ----
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
Index: testsuite/gdb.mi/mi-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v
retrieving revision 1.12
diff -c -p -b -r1.12 mi-var-display.exp
*** testsuite/gdb.mi/mi-var-display.exp 17 Aug 2004 09:38:29 -0000 1.12
--- testsuite/gdb.mi/mi-var-display.exp 1 Apr 2005 16:06:51 -0000
*************** mi_gdb_test "200-break-insert $line_dct_
*** 48,54 ****
mi_run_cmd
# The running part has been checked already by mi_run_cmd
gdb_expect {
! -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dct_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "run to do_children_tests"
}
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
--- 48,54 ----
mi_run_cmd
# The running part has been checked already by mi_run_cmd
gdb_expect {
! -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/var-cmd.c\",line=\"$line_dct_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "run to do_children_tests"
}
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
*************** mi_gdb_test "200-break-insert do_special
*** 332,338 ****
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" {
pass "continue to do_special_tests"
}
timeout {
--- 332,338 ----
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/var-cmd.c\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" {
pass "continue to do_special_tests"
}
timeout {
*************** mi_gdb_test "200-break-insert incr_a" \
*** 592,601 ****
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
--- 592,601 ----
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
Index: testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.11
diff -c -p -b -r1.11 mi-watch.exp
*** testsuite/gdb.mi/mi-watch.exp 15 Aug 2004 10:15:58 -0000 1.11
--- testsuite/gdb.mi/mi-watch.exp 1 Apr 2005 16:06:51 -0000
*************** proc test_watchpoint_triggering {} {
*** 139,145 ****
gdb_expect {
-re "222\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "watchpoint trigger"
}
-re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
--- 139,145 ----
gdb_expect {
-re "222\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "watchpoint trigger"
}
-re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
*************** proc test_watchpoint_triggering {} {
*** 154,160 ****
gdb_expect {
-re "223\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "wp out of scope"
}
-re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
--- 154,160 ----
gdb_expect {
-re "223\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "wp out of scope"
}
-re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
Index: testsuite/gdb.mi/mi2-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-cli.exp,v
retrieving revision 1.2
diff -c -p -b -r1.2 mi2-cli.exp
*** testsuite/gdb.mi/mi2-cli.exp 15 Aug 2004 10:15:58 -0000 1.2
--- testsuite/gdb.mi/mi2-cli.exp 1 Apr 2005 16:06:51 -0000
*************** mi_gdb_test "600-break-insert -t basics.
*** 161,171 ****
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
--- 161,171 ----
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",fullname="/.*/gdb/testsuite/gdb.mi/basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
*************** gdb_expect {
*** 175,185 ****
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! # {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=.*basics.c.,line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
--- 175,185 ----
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! # {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",fullname="/.*/gdb/testsuite/gdb.mi/basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
Index: testsuite/gdb.mi/mi2-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-return.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi2-return.exp
*** testsuite/gdb.mi/mi2-return.exp 15 Aug 2004 10:15:58 -0000 1.3
--- testsuite/gdb.mi/mi2-return.exp 1 Apr 2005 16:06:51 -0000
*************** proc test_return_simple {} {
*** 53,59 ****
send_gdb "111-exec-return\n"
gdb_expect {
! -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
--- 53,59 ----
send_gdb "111-exec-return\n"
gdb_expect {
! -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
Index: testsuite/gdb.mi/mi2-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-stack.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi2-stack.exp
*** testsuite/gdb.mi/mi2-stack.exp 15 Aug 2004 10:15:58 -0000 1.3
--- testsuite/gdb.mi/mi2-stack.exp 1 Apr 2005 16:06:51 -0000
*************** proc test_stack_frame_listing {} {
*** 57,63 ****
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
! "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
--- 57,63 ----
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
! "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
*************** set line_callee4_return_0 [gdb_get_line_
*** 160,166 ****
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
--- 160,166 ----
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
Index: testsuite/gdb.mi/mi2-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-stepi.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi2-stepi.exp
*** testsuite/gdb.mi/mi2-stepi.exp 15 Aug 2004 10:15:58 -0000 1.3
--- testsuite/gdb.mi/mi2-stepi.exp 1 Apr 2005 16:06:51 -0000
*************** proc test_stepi_nexti {} {
*** 53,59 ****
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
--- 53,59 ----
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
*************** proc test_stepi_nexti {} {
*** 67,73 ****
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
--- 67,73 ----
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
*************** proc test_stepi_nexti {} {
*** 81,87 ****
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
--- 81,87 ----
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
Index: testsuite/gdb.mi/mi2-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp,v
retrieving revision 1.1
diff -c -p -b -r1.1 mi2-syn-frame.exp
*** testsuite/gdb.mi/mi2-syn-frame.exp 7 Aug 2003 17:47:42 -0000 1.1
--- testsuite/gdb.mi/mi2-syn-frame.exp 1 Apr 2005 16:06:51 -0000
*************** gdb_expect {
*** 69,75 ****
}
}
! mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
--- 69,75 ----
}
}
! mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
*************** gdb_expect {
*** 96,102 ****
}
}
! mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
--- 96,102 ----
}
}
! mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
*************** mi_gdb_test "409-stack-list-frames 0 0"
*** 104,110 ****
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
! mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
--- 104,110 ----
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
! mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
Index: testsuite/gdb.mi/mi2-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-until.exp,v
retrieving revision 1.2
diff -c -p -b -r1.2 mi2-until.exp
*** testsuite/gdb.mi/mi2-until.exp 9 Aug 2004 22:21:54 -0000 1.2
--- testsuite/gdb.mi/mi2-until.exp 1 Apr 2005 16:06:51 -0000
*************** proc test_until {} {
*** 78,84 ****
send_gdb "111-exec-until\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
--- 78,84 ----
send_gdb "111-exec-until\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
*************** proc test_until {} {
*** 88,94 ****
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
--- 88,94 ----
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
*************** proc test_until {} {
*** 98,104 ****
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
--- 98,104 ----
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
*************** proc test_until {} {
*** 110,116 ****
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
--- 110,116 ----
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
Index: testsuite/gdb.mi/mi2-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-display.exp,v
retrieving revision 1.4
diff -c -p -b -r1.4 mi2-var-display.exp
*** testsuite/gdb.mi/mi2-var-display.exp 17 Aug 2004 09:38:29 -0000 1.4
--- testsuite/gdb.mi/mi2-var-display.exp 1 Apr 2005 16:06:51 -0000
*************** mi_gdb_test "200-break-insert incr_a" \
*** 592,601 ****
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
--- 592,601 ----
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"/.*/gdb/testsuite/gdb.mi/var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
Index: testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.26
diff -c -p -b -r1.26 mi-support.exp
*** testsuite/lib/mi-support.exp 25 Mar 2005 20:38:55 -0000 1.26
--- testsuite/lib/mi-support.exp 1 Apr 2005 16:06:51 -0000
*************** proc mi_runto {func} {
*** 813,819 ****
mi_run_cmd
gdb_expect {
! -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
--- 813,819 ----
mi_run_cmd
gdb_expect {
! -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"/.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
*************** proc mi_execute_to_helper { cmd reason f
*** 859,869 ****
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
}
--- 859,869 ----
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\",fullname=\"/.*/$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=\".*\",fullname=\"/.*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
fail "$test (stopped at wrong place)"
return -1
}
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-04-01 19:13 Dennis Brueni
@ 2005-04-02 9:22 ` Eli Zaretskii
2005-04-30 19:18 ` Daniel Jacobowitz
1 sibling, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-04-02 9:22 UTC (permalink / raw)
To: Dennis Brueni; +Cc: gdb-patches, bob
> Date: Fri, 1 Apr 2005 14:13:33 -0500
> From: "Dennis Brueni" <dbrueni@slickedit.com>
> Cc: <bob@brasko.net>
>
> As promised, here is an updated patch set with the regex
> changes you suggested, plus checking for a little more directory
> information with respect to the fullname path, to the extent
> that we can be sure the test case still passes in all environments.
Thanks.
The doco part is approved, with the following minor comment:
> + 2005-03-29 Dennis Brueni <dennis@slickedit.com>
> +
> + * gdb.texinfo: Update docs for MI stack frames with fullname attribute.
> +
Please mention in teh ChangeLog entries the names of the nodes where
you made changes (in parens, as if they were function names). For
example:
* gdb.texinfo (First Node, Second Node): Update docs for MI
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-04-01 19:13 Dennis Brueni
2005-04-02 9:22 ` Eli Zaretskii
@ 2005-04-30 19:18 ` Daniel Jacobowitz
2005-05-01 2:19 ` Bob Rossi
2005-05-18 4:44 ` Daniel Jacobowitz
1 sibling, 2 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-04-30 19:18 UTC (permalink / raw)
To: Dennis Brueni; +Cc: gdb-patches, bob
On Fri, Apr 01, 2005 at 02:13:33PM -0500, Dennis Brueni wrote:
> > Again, for the fullname regex, I would recommend using the
> > same regex used in mi-file.exp. This would be like
> > fullname="/.*basics.c" This forces the regex to ensure that
> > the path is absolute, which the check you have does not.
Will GDB always output absolute paths that start with "/"? What about
non-Cygwin Windows for example? DJGPP?
In any case, if you want to verify that fullname starts with a
full path, it can be an independent test. It doesn't need to live in
every other MI stack test.
> >
> > Bob Rossi
> >
>
> As promised, here is an updated patch set with the regex
> changes you suggested, plus checking for a little more directory
> information with respect to the fullname path, to the extent
> that we can be sure the test case still passes in all environments.
I don't think adding fullname= to the -i=mi2 output is a good idea; MI2
is supposed to be stable. Bob, what do you think? Anyone else?
A couple administrative things about submitting GDB patches:
- Please include ChangeLog entries as text, not as diff. They'll never
apply correctly when someone else wants to test or commit the patch.
- Please use full sentences. This:
> + * stack.c (print_frame): In MI mode,
> + output fullname attribute with stack frame
becomes:
* stack.c (print_frame): In MI mode, output the fullname
attribute with the stack frame.
- Follow the GNU coding standards (you can find a copy on gnu.org) in
any new code. For instance, spaces before parentheses in function
calls; and braces on new lines rather than at the end of existing
lines.
You don't need to redo the patch; I'll take care of it once my first
questions are resolved.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-04-30 19:18 ` Daniel Jacobowitz
@ 2005-05-01 2:19 ` Bob Rossi
2005-05-01 18:24 ` Eli Zaretskii
2005-05-05 16:22 ` Bob Rossi
2005-05-18 4:44 ` Daniel Jacobowitz
1 sibling, 2 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-01 2:19 UTC (permalink / raw)
To: Dennis Brueni, gdb-patches
On Sat, Apr 30, 2005 at 03:17:55PM -0400, Daniel Jacobowitz wrote:
> On Fri, Apr 01, 2005 at 02:13:33PM -0500, Dennis Brueni wrote:
> > > Again, for the fullname regex, I would recommend using the
> > > same regex used in mi-file.exp. This would be like
> > > fullname="/.*basics.c" This forces the regex to ensure that
> > > the path is absolute, which the check you have does not.
>
> Will GDB always output absolute paths that start with "/"? What about
> non-Cygwin Windows for example? DJGPP?
Like Dennis noted, it could be possible that the fullname might not
start with a "/". I originally posted the patch with the fullname
starting with a "/", and since then, there hasn't been any complaints.
If there is a better regex that ensures that the fullname is absolute
I'd be happy to change the mi-file.exp test to it.
> In any case, if you want to verify that fullname starts with a
> full path, it can be an independent test. It doesn't need to live in
> every other MI stack test.
Well, I do understand your point here but I'd prefer that all fullname
checks ensure that the path be absolute. The more I think about it, I
should probably make a variable called 'fullname_output' in the
testsuite that contains the regex output of a fullname. How does this
sound?
> > As promised, here is an updated patch set with the regex
> > changes you suggested, plus checking for a little more directory
> > information with respect to the fullname path, to the extent
> > that we can be sure the test case still passes in all environments.
>
> I don't think adding fullname= to the -i=mi2 output is a good idea; MI2
> is supposed to be stable. Bob, what do you think? Anyone else?
As far as i understand, it is acceptable to add new fields to a stable
version of MI. It is the parsers responsibility to ignore MI fields that
they are unfamiliar with. I also understand that it is acceptable to add
new commands to an MI version. Making either of the 2 changes above does
not effect the version number of the MI release (AFAIK).
With that said, I'm not quite sure what model Andrew had in mind
when releasing the MI versions. Here is 2 possibilities,
Originally there is mi-. Once it becomes stable it is released as mi2-.
mi2- is never touched again, accept for bug fixes. All development and
new features is done on mi-. When mi- becomes stable again it is turned
into mi3-.
Originally there is mi-. Once it becomes stable it is released as mi2-.
Any changes compatible with the MI2 protocol should be merged into the
mi- and mi2- testcases. Changes that are not compatible with mi2 should
be merged into mi-. When mi- becomes stable enough it could be moved
into mi3-.
I prefer the second model. I think it is more flexible and would allow
for features to get into the MI protocol faster.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-01 2:19 ` Bob Rossi
@ 2005-05-01 18:24 ` Eli Zaretskii
2005-05-01 18:34 ` Bob Rossi
` (2 more replies)
2005-05-05 16:22 ` Bob Rossi
1 sibling, 3 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-01 18:24 UTC (permalink / raw)
To: Dennis Brueni, gdb-patches
> Date: Sat, 30 Apr 2005 22:19:45 -0400
> From: Bob Rossi <bob@brasko.net>
>
> On Sat, Apr 30, 2005 at 03:17:55PM -0400, Daniel Jacobowitz wrote:
> > On Fri, Apr 01, 2005 at 02:13:33PM -0500, Dennis Brueni wrote:
> > > > Again, for the fullname regex, I would recommend using the
> > > > same regex used in mi-file.exp. This would be like
> > > > fullname="/.*basics.c" This forces the regex to ensure that
> > > > the path is absolute, which the check you have does not.
> >
> > Will GDB always output absolute paths that start with "/"? What about
> > non-Cygwin Windows for example? DJGPP?
To answer Daniel's question: no, absolute file names on DOS/Windows
systems do not necessarily begin with a slash.
> Like Dennis noted, it could be possible that the fullname might not
> start with a "/". I originally posted the patch with the fullname
> starting with a "/", and since then, there hasn't been any complaints.
> If there is a better regex that ensures that the fullname is absolute
> I'd be happy to change the mi-file.exp test to it.
The proper regexp should be something like
\([A-z]:\)?[/\\].*basics.c
This assumes that \(...\) is the proper syntax for grouping (I don't
know much about the regexp syntax expected by Expect).
(The uppercase A but lowercase z in the above are intentional: that's
because letters between Z and a can also be drive letters, amazingly
enough.)
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-01 18:24 ` Eli Zaretskii
@ 2005-05-01 18:34 ` Bob Rossi
2005-05-01 19:02 ` Daniel Jacobowitz
2005-05-02 0:54 ` Bob Rossi
2005-05-05 17:20 ` Bob Rossi
2 siblings, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-01 18:34 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Dennis Brueni, gdb-patches
> > Like Dennis noted, it could be possible that the fullname might not
> > start with a "/". I originally posted the patch with the fullname
> > starting with a "/", and since then, there hasn't been any complaints.
> > If there is a better regex that ensures that the fullname is absolute
> > I'd be happy to change the mi-file.exp test to it.
>
> The proper regexp should be something like
>
> \([A-z]:\)?[/\\].*basics.c
>
> This assumes that \(...\) is the proper syntax for grouping (I don't
> know much about the regexp syntax expected by Expect).
>
> (The uppercase A but lowercase z in the above are intentional: that's
> because letters between Z and a can also be drive letters, amazingly
> enough.)
OK, I don't know why no one has ever posted to this list with testsuite
failures on the mi-file.exp testcase. Maybe no one runs the mi testsuite
on windows?
Either way, I'm going to submit a patch later today which will add a
variable to mi-support.exp similar to mi_gdb_prompt. The variable will
describe the syntax of a fullname field. It will abstract the details
and complications from new users trying to write testcase's.
I'll try to find time to make this quick change tonight. If people don't
like this idea, let me know.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-01 18:34 ` Bob Rossi
@ 2005-05-01 19:02 ` Daniel Jacobowitz
2005-05-02 0:55 ` Bob Rossi
0 siblings, 1 reply; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-01 19:02 UTC (permalink / raw)
To: Eli Zaretskii, Dennis Brueni, gdb-patches
On Sun, May 01, 2005 at 02:34:44PM -0400, Bob Rossi wrote:
> Either way, I'm going to submit a patch later today which will add a
> variable to mi-support.exp similar to mi_gdb_prompt. The variable will
> describe the syntax of a fullname field. It will abstract the details
> and complications from new users trying to write testcase's.
>
> I'll try to find time to make this quick change tonight. If people don't
> like this idea, let me know.
How about adding a variable to lib/gdb.exp to describe the format of an
absolute path, instead? Unless you were planning to check for proper
quoting, et cetera. I think this would be more useful.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-01 19:02 ` Daniel Jacobowitz
@ 2005-05-02 0:55 ` Bob Rossi
0 siblings, 0 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-02 0:55 UTC (permalink / raw)
To: Eli Zaretskii, Dennis Brueni, gdb-patches
On Sun, May 01, 2005 at 03:02:18PM -0400, Daniel Jacobowitz wrote:
> On Sun, May 01, 2005 at 02:34:44PM -0400, Bob Rossi wrote:
> > Either way, I'm going to submit a patch later today which will add a
> > variable to mi-support.exp similar to mi_gdb_prompt. The variable will
> > describe the syntax of a fullname field. It will abstract the details
> > and complications from new users trying to write testcase's.
> >
> > I'll try to find time to make this quick change tonight. If people don't
> > like this idea, let me know.
>
> How about adding a variable to lib/gdb.exp to describe the format of an
> absolute path, instead? Unless you were planning to check for proper
> quoting, et cetera. I think this would be more useful.
OK, I'll do exactly that. Seems to be more general purpose. I've tested
the regex that Eli posted and had one quick question for him (or anyone
else). Once that is resolved, I'll post the patch.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-01 18:24 ` Eli Zaretskii
2005-05-01 18:34 ` Bob Rossi
@ 2005-05-02 0:54 ` Bob Rossi
2005-05-02 0:58 ` Daniel Jacobowitz
2005-05-02 19:30 ` Eli Zaretskii
2005-05-05 17:20 ` Bob Rossi
2 siblings, 2 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-02 0:54 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Dennis Brueni, gdb-patches
On Sun, May 01, 2005 at 09:22:31PM +0300, Eli Zaretskii wrote:
> > Date: Sat, 30 Apr 2005 22:19:45 -0400
> > From: Bob Rossi <bob@brasko.net>
> >
> > On Sat, Apr 30, 2005 at 03:17:55PM -0400, Daniel Jacobowitz wrote:
> > > On Fri, Apr 01, 2005 at 02:13:33PM -0500, Dennis Brueni wrote:
> > > > > Again, for the fullname regex, I would recommend using the
> > > > > same regex used in mi-file.exp. This would be like
> > > > > fullname="/.*basics.c" This forces the regex to ensure that
> > > > > the path is absolute, which the check you have does not.
> > >
> > > Will GDB always output absolute paths that start with "/"? What about
> > > non-Cygwin Windows for example? DJGPP?
>
> To answer Daniel's question: no, absolute file names on DOS/Windows
> systems do not necessarily begin with a slash.
>
> > Like Dennis noted, it could be possible that the fullname might not
> > start with a "/". I originally posted the patch with the fullname
> > starting with a "/", and since then, there hasn't been any complaints.
> > If there is a better regex that ensures that the fullname is absolute
> > I'd be happy to change the mi-file.exp test to it.
>
> The proper regexp should be something like
>
> \([A-z]:\)?[/\\].*basics.c
Eli, is this correct? Is a proper fullname in windows \abc? Should the
regex move the \\ into the first grouping with the drive letter?
\([A-z]:\\\)?/.*basics.c
Please let me know.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 0:54 ` Bob Rossi
@ 2005-05-02 0:58 ` Daniel Jacobowitz
2005-05-02 19:30 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-02 0:58 UTC (permalink / raw)
To: Eli Zaretskii, Dennis Brueni, gdb-patches
On Sun, May 01, 2005 at 08:54:15PM -0400, Bob Rossi wrote:
> Eli, is this correct? Is a proper fullname in windows \abc? Should the
> regex move the \\ into the first grouping with the drive letter?
>
> \([A-z]:\\\)?/.*basics.c
>
> Please let me know.
If so, you want to strip the extra slash.
([A-Za-z]:\\|/).*[\\/]$basename
Additional backslash doubling and brace escaping is necessary with TCL
"" quoting, and this is not strictly correct in that it does not handle
files directly under a root path.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 0:54 ` Bob Rossi
2005-05-02 0:58 ` Daniel Jacobowitz
@ 2005-05-02 19:30 ` Eli Zaretskii
2005-05-02 19:36 ` Bob Rossi
1 sibling, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-02 19:30 UTC (permalink / raw)
To: gdb-patches
> Date: Sun, 1 May 2005 20:54:15 -0400
> From: Bob Rossi <bob@brasko.net>
> Cc: Dennis Brueni <dbrueni@slickedit.com>, gdb-patches@sources.redhat.com
>
> > The proper regexp should be something like
> >
> > \([A-z]:\)?[/\\].*basics.c
>
> Eli, is this correct? Is a proper fullname in windows \abc?
Yes, "\abc" is a proper absolute file name on DOS/Windows. Why did
you think it wasn't?
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 19:30 ` Eli Zaretskii
@ 2005-05-02 19:36 ` Bob Rossi
2005-05-02 19:52 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-02 19:36 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Mon, May 02, 2005 at 10:28:17PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 1 May 2005 20:54:15 -0400
> > From: Bob Rossi <bob@brasko.net>
> > Cc: Dennis Brueni <dbrueni@slickedit.com>, gdb-patches@sources.redhat.com
> >
> > > The proper regexp should be something like
> > >
> > > \([A-z]:\)?[/\\].*basics.c
> >
> > Eli, is this correct? Is a proper fullname in windows \abc?
>
> Yes, "\abc" is a proper absolute file name on DOS/Windows. Why did
> you think it wasn't?
I've just never seen that before. I always thought that \abc actually
referred to A:\abc or whatever the current drive is. However, I didn't
know if the compiler would end up seeing \abc, or if it would know that
it is actually A:\abc.
Also, I realized that a network drive would have to be accounted for
(\\gateway\abc), however, if \ is a proper absolute file name on
DOS/Windows, then your regex accounts for network drives also.
If from my comments above you think that \abc might not be OK, let us
know, and I'll look into a new regex. Otherwise, I'll use the regex
you posted.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 19:36 ` Bob Rossi
@ 2005-05-02 19:52 ` Eli Zaretskii
2005-05-02 19:55 ` Daniel Jacobowitz
0 siblings, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-02 19:52 UTC (permalink / raw)
To: gdb-patches
> Date: Mon, 2 May 2005 15:36:38 -0400
> From: Bob Rossi <bob@brasko.net>
> Cc: gdb-patches@sources.redhat.com
>
> I've just never seen that before. I always thought that \abc actually
> referred to A:\abc or whatever the current drive is.
It does refer to the current drive. But it's still okay to treat that
as an absolute file name.
> However, I didn't know if the compiler would end up seeing \abc, or
> if it would know that it is actually A:\abc.
It doesn't matter, both will work.
> Also, I realized that a network drive would have to be accounted for
> (\\gateway\abc), however, if \ is a proper absolute file name on
> DOS/Windows, then your regex accounts for network drives also.
Right.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 19:52 ` Eli Zaretskii
@ 2005-05-02 19:55 ` Daniel Jacobowitz
2005-05-02 20:42 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-02 19:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Mon, May 02, 2005 at 10:49:13PM +0300, Eli Zaretskii wrote:
> > Date: Mon, 2 May 2005 15:36:38 -0400
> > From: Bob Rossi <bob@brasko.net>
> > Cc: gdb-patches@sources.redhat.com
> >
> > I've just never seen that before. I always thought that \abc actually
> > referred to A:\abc or whatever the current drive is.
>
> It does refer to the current drive. But it's still okay to treat that
> as an absolute file name.
How can that be? The usual definition of absolute is that it doesn't
rely on current state to resolve it. If you don't have the drive, then
you don't know where the file is.
What have I missed?
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 19:55 ` Daniel Jacobowitz
@ 2005-05-02 20:42 ` Eli Zaretskii
2005-05-02 20:49 ` Daniel Jacobowitz
0 siblings, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-02 20:42 UTC (permalink / raw)
To: gdb-patches
> Date: Mon, 2 May 2005 15:55:15 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> The usual definition of absolute is that it doesn't rely on current
> state to resolve it.
DOS/Windows file names can be gray, not only white or black. Examples
include \abc and d:foo. While not entirely free of ``current''
something, they are much closer to absolute file names than to
relative file names, in the sense that you don't prepend cwd to them
to get an absolute file name (which is what 99.99% of programs
_really_ want to know when they are testing a file name for being
absolute).
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 20:42 ` Eli Zaretskii
@ 2005-05-02 20:49 ` Daniel Jacobowitz
2005-05-02 21:20 ` Bob Rossi
2005-05-03 3:42 ` Eli Zaretskii
0 siblings, 2 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-02 20:49 UTC (permalink / raw)
To: gdb-patches
On Mon, May 02, 2005 at 11:40:18PM +0300, Eli Zaretskii wrote:
> > Date: Mon, 2 May 2005 15:55:15 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb-patches@sources.redhat.com
> >
> > The usual definition of absolute is that it doesn't rely on current
> > state to resolve it.
>
> DOS/Windows file names can be gray, not only white or black. Examples
> include \abc and d:foo. While not entirely free of ``current''
> something, they are much closer to absolute file names than to
> relative file names, in the sense that you don't prepend cwd to them
> to get an absolute file name (which is what 99.99% of programs
> _really_ want to know when they are testing a file name for being
> absolute).
That's not what we're testing for in the testsuite, though. I think
that we should reject both \abc and d:foo here. We're trying to output
a full pathname.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 20:49 ` Daniel Jacobowitz
@ 2005-05-02 21:20 ` Bob Rossi
2005-05-03 3:49 ` Eli Zaretskii
2005-05-03 3:42 ` Eli Zaretskii
1 sibling, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-02 21:20 UTC (permalink / raw)
To: gdb-patches
On Mon, May 02, 2005 at 04:49:00PM -0400, Daniel Jacobowitz wrote:
> On Mon, May 02, 2005 at 11:40:18PM +0300, Eli Zaretskii wrote:
> > > Date: Mon, 2 May 2005 15:55:15 -0400
> > > From: Daniel Jacobowitz <drow@false.org>
> > > Cc: gdb-patches@sources.redhat.com
> > >
> > > The usual definition of absolute is that it doesn't rely on current
> > > state to resolve it.
> >
> > DOS/Windows file names can be gray, not only white or black. Examples
> > include \abc and d:foo. While not entirely free of ``current''
> > something, they are much closer to absolute file names than to
> > relative file names, in the sense that you don't prepend cwd to them
> > to get an absolute file name (which is what 99.99% of programs
> > _really_ want to know when they are testing a file name for being
> > absolute).
>
> That's not what we're testing for in the testsuite, though. I think
> that we should reject both \abc and d:foo here. We're trying to output
> a full pathname.
The question is, will GDB will return \abc or d:foo from source.c:openp?
I see that IS_ABSOLUTE_PATH is being used, which specifically says it
allows the case \abc and d:foo.
So, the next question is, does xfullpath change \abc or d:foo into a
real absolute path or not?
Notice the comment in utils.c:3021
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
/* We need to be careful when filename is of the form 'd:foo', which
is equivalent of d:./foo, which is totally different from d:/foo. */
if (strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] == ':')
{
dir_name[2] = '.';
dir_name[3] = '\000';
}
#endif
That above comment broke my brain :)
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 21:20 ` Bob Rossi
@ 2005-05-03 3:49 ` Eli Zaretskii
0 siblings, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-03 3:49 UTC (permalink / raw)
To: gdb-patches
> Date: Mon, 2 May 2005 17:20:43 -0400
> From: Bob Rossi <bob@brasko.net>
>
> The question is, will GDB will return \abc or d:foo from source.c:openp?
Yes.
> I see that IS_ABSOLUTE_PATH is being used, which specifically says it
> allows the case \abc and d:foo.
Exactly.
> So, the next question is, does xfullpath change \abc or d:foo into a
> real absolute path or not?
It can't do anything with \abc (except perhaps convert it into /abc,
but that's not a given). For d:foo, it converts it into d:./foo,
which is still not 100% absolute, but xfullpath cannot do anything
about it, since it doesn't know how to resolve "." (i.e., what was the
cwd at the time of the compilation).
> Notice the comment in utils.c:3021
>
> #ifdef HAVE_DOS_BASED_FILE_SYSTEM
> /* We need to be careful when filename is of the form 'd:foo', which
> is equivalent of d:./foo, which is totally different from d:/foo. */
> if (strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] == ':')
> {
> dir_name[2] = '.';
> dir_name[3] = '\000';
> }
> #endif
>
> That above comment broke my brain :)
If you mean that it isn't clear, let me know and I will try to
clarify.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-02 20:49 ` Daniel Jacobowitz
2005-05-02 21:20 ` Bob Rossi
@ 2005-05-03 3:42 ` Eli Zaretskii
2005-05-03 3:46 ` Daniel Jacobowitz
1 sibling, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-03 3:42 UTC (permalink / raw)
To: gdb-patches
> Date: Mon, 2 May 2005 16:49:00 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> > DOS/Windows file names can be gray, not only white or black. Examples
> > include \abc and d:foo. While not entirely free of ``current''
> > something, they are much closer to absolute file names than to
> > relative file names, in the sense that you don't prepend cwd to them
> > to get an absolute file name (which is what 99.99% of programs
> > _really_ want to know when they are testing a file name for being
> > absolute).
>
> That's not what we're testing for in the testsuite, though.
What _are_ we trying to test?
> I think that we should reject both \abc and d:foo here.
I don't think so.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 3:42 ` Eli Zaretskii
@ 2005-05-03 3:46 ` Daniel Jacobowitz
2005-05-03 19:36 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-03 3:46 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Tue, May 03, 2005 at 06:40:15AM +0300, Eli Zaretskii wrote:
> > Date: Mon, 2 May 2005 16:49:00 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> >
> > > DOS/Windows file names can be gray, not only white or black. Examples
> > > include \abc and d:foo. While not entirely free of ``current''
> > > something, they are much closer to absolute file names than to
> > > relative file names, in the sense that you don't prepend cwd to them
> > > to get an absolute file name (which is what 99.99% of programs
> > > _really_ want to know when they are testing a file name for being
> > > absolute).
> >
> > That's not what we're testing for in the testsuite, though.
>
> What _are_ we trying to test?
GDB is outputting an absolute path, which will be used by either the
user or by a front end. In either case, it should locate the file
entirely unambiguously. Otherwise the IDE may display the wrong source
file to the user, et cetera.
> > I think that we should reject both \abc and d:foo here.
>
> I don't think so.
Could you explain why? What should the front end receiving this
information do with it?
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 3:46 ` Daniel Jacobowitz
@ 2005-05-03 19:36 ` Eli Zaretskii
2005-05-03 19:49 ` Daniel Jacobowitz
` (2 more replies)
0 siblings, 3 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-03 19:36 UTC (permalink / raw)
To: gdb-patches
> Date: Mon, 2 May 2005 23:46:05 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> > > That's not what we're testing for in the testsuite, though.
> >
> > What _are_ we trying to test?
>
> GDB is outputting an absolute path, which will be used by either the
> user or by a front end. In either case, it should locate the file
> entirely unambiguously.
If that is what we want to test, then the test is IMHO inappropriate:
we shouldn't try to identify an absolute file name, we should see if
the name it produces corresponds to a real file. I.e., try to stat
the file, or maybe cmp it against the source whose path we know, or
something like that.
> > > I think that we should reject both \abc and d:foo here.
> >
> > I don't think so.
>
> Could you explain why?
Because (as I said in my other mail this morning) such semi-absolute
file names can be recorded in the debug info, albeit under somewhat
unusual circumstances. Since we don't own the compiler's code that
records file and directory names in the debug info, we can never be
100% sure such file names will never end up there. When they do,
there's nothing we can do about them in GDB but try to find them, see
below. Failing the test because we see such file names will thus do a
misservice to us: it will mark a perfrctly legitimate result as a
failure.
> What should the front end receiving this information do with it?
It should do the best it can: try to access the file under the
assumption that the missing drive in "\abc" is the current one and the
missing directory in d:foo is the current directory on drive d:
(which could be different from the current drive). If that works, we
win; if not, tough. The failure case is the same situation as when
the front end receives a file name which does not exist on the machine
(e.g., a module from a library that was compiled on a different
computer): GDB tries its best to find the file, but if the directory
cannot be found by any algorithm known to us, we give up. What else
can we do?
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 19:36 ` Eli Zaretskii
@ 2005-05-03 19:49 ` Daniel Jacobowitz
2005-05-03 20:05 ` Bob Rossi
2005-05-03 20:49 ` Eli Zaretskii
2005-05-03 19:57 ` Bob Rossi
2005-05-03 22:50 ` Bob Rossi
2 siblings, 2 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-03 19:49 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Tue, May 03, 2005 at 10:34:15PM +0300, Eli Zaretskii wrote:
> > Date: Mon, 2 May 2005 23:46:05 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb-patches@sources.redhat.com
> >
> > > > That's not what we're testing for in the testsuite, though.
> > >
> > > What _are_ we trying to test?
> >
> > GDB is outputting an absolute path, which will be used by either the
> > user or by a front end. In either case, it should locate the file
> > entirely unambiguously.
>
> If that is what we want to test, then the test is IMHO inappropriate:
> we shouldn't try to identify an absolute file name, we should see if
> the name it produces corresponds to a real file. I.e., try to stat
> the file, or maybe cmp it against the source whose path we know, or
> something like that.
Round and round we go... I believe I just argued the same point you're
making here a little earlier, but gave in to Bob's wishes.
These tests are not for the fullname feature. They merely include a
fullname in their output. I'm all for putting fullname=".*basics.c" in
them and leaving it at that. But if we're going to be more precise,
then we should try to be completely precise; the regexp can be easily
centralized.
> > > > I think that we should reject both \abc and d:foo here.
> > >
> > > I don't think so.
> >
> > Could you explain why?
>
> Because (as I said in my other mail this morning) such semi-absolute
> file names can be recorded in the debug info, albeit under somewhat
> unusual circumstances. Since we don't own the compiler's code that
> records file and directory names in the debug info, we can never be
> 100% sure such file names will never end up there. When they do,
> there's nothing we can do about them in GDB but try to find them, see
> below. Failing the test because we see such file names will thus do a
> misservice to us: it will mark a perfrctly legitimate result as a
> failure.
>
> > What should the front end receiving this information do with it?
>
> It should do the best it can: try to access the file under the
> assumption that the missing drive in "\abc" is the current one and the
> missing directory in d:foo is the current directory on drive d:
> (which could be different from the current drive). If that works, we
> win; if not, tough. The failure case is the same situation as when
> the front end receives a file name which does not exist on the machine
> (e.g., a module from a library that was compiled on a different
> computer): GDB tries its best to find the file, but if the directory
> cannot be found by any algorithm known to us, we give up. What else
> can we do?
This is where we disagree. GDB should do the search, yes. But it
should never ask the user to do any guessing again. GDB has to settle
on a path eventually, whether or not that path ends up containing the
file. I believe that GDB should settle on a path and report it
precisely to the user.
The path still has value in this case even if it doesn't exist! We
can't show the user the file, but we can use it to unambiguously place
a breakpoint in the correct file. Of course, if GDB is reduced to
guessing, it may decide that two files who differ only in their current
directory are the same. That's a limitation of the input debug
information in some circumstances.
First of all, in the testsuite we know the file will exist. If GDB can
not find it, that's a bug. No matter what. It may be a bug in GDB or
a bug in the compiler, but it is a bug, and I want the testsuite to
detect it. If we don't, who will? We can't do simple things like
"list" if we can't find the source files.
Secondly, if we get bogus information from the compiler we will try to
resolve it. We should not be showing the raw data to a front end, only
the resolved path.
I can see justification in reporting a non-absolute path to the user
when GDB is absolutely stumped, but that's not this case.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 19:49 ` Daniel Jacobowitz
@ 2005-05-03 20:05 ` Bob Rossi
2005-05-03 20:49 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-03 20:05 UTC (permalink / raw)
To: Eli Zaretskii, gdb-patches
On Tue, May 03, 2005 at 03:48:56PM -0400, Daniel Jacobowitz wrote:
> On Tue, May 03, 2005 at 10:34:15PM +0300, Eli Zaretskii wrote:
> > > Date: Mon, 2 May 2005 23:46:05 -0400
> > > From: Daniel Jacobowitz <drow@false.org>
> > > Cc: gdb-patches@sources.redhat.com
> > >
> > > > > That's not what we're testing for in the testsuite, though.
> > > >
> > > > What _are_ we trying to test?
> > >
> > > GDB is outputting an absolute path, which will be used by either the
> > > user or by a front end. In either case, it should locate the file
> > > entirely unambiguously.
> >
> > If that is what we want to test, then the test is IMHO inappropriate:
> > we shouldn't try to identify an absolute file name, we should see if
> > the name it produces corresponds to a real file. I.e., try to stat
> > the file, or maybe cmp it against the source whose path we know, or
> > something like that.
>
> Round and round we go... I believe I just argued the same point you're
> making here a little earlier, but gave in to Bob's wishes.
>
> These tests are not for the fullname feature. They merely include a
> fullname in their output. I'm all for putting fullname=".*basics.c" in
> them and leaving it at that. But if we're going to be more precise,
> then we should try to be completely precise; the regexp can be easily
> centralized.
I would be more than willing to make the initial regex variable be '/.*'
or even '.*' to get this patch resolved.
Later, the burden will be on me to update the regex to an appropriate
value.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 19:49 ` Daniel Jacobowitz
2005-05-03 20:05 ` Bob Rossi
@ 2005-05-03 20:49 ` Eli Zaretskii
2005-05-04 13:34 ` Daniel Jacobowitz
1 sibling, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-03 20:49 UTC (permalink / raw)
To: gdb-patches
> Date: Tue, 3 May 2005 15:48:56 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> Round and round we go... I believe I just argued the same point you're
> making here a little earlier, but gave in to Bob's wishes.
Sorry, I joined the discussion in this thread only after you asked a
question about the fullname regexp on non-Posix platforms. So _I_ am
not going round.
> This is where we disagree. GDB should do the search, yes. But it
> should never ask the user to do any guessing again.
I'm not sure we understand each other: who said anything about
guessing or asking the user to do so?
> GDB has to settle on a path eventually, whether or not that path
> ends up containing the file. I believe that GDB should settle on a
> path and report it precisely to the user.
And where does this contradict anything that I said? For that matter,
how is this at all related to the issue we are discussing, which I
thought was how to test the output of the fullname attribute?
> The path still has value in this case even if it doesn't exist!
The same can be said about "\abc" or "d:foo".
> We can't show the user the file, but we can use it to unambiguously
> place a breakpoint in the correct file.
The same can be said about "\abc" or "d:foo".
> First of all, in the testsuite we know the file will exist. If GDB can
> not find it, that's a bug. No matter what. It may be a bug in GDB or
> a bug in the compiler, but it is a bug, and I want the testsuite to
> detect it.
Then let's do what I suggested: take the value of fullname and see if
we can reach the file it names. There's no need for any regexp at
all; moreover, even if we agree on some regexp, it is only a fuzzy
test, since the fact that the output matches does not yet mean that
the output is correct.
> Secondly, if we get bogus information from the compiler we will try to
> resolve it.
Unfortunately, there's no specification known to me as to what can and
cannot be recorded in the directory name of the source file in the
debug info, at least not for Windows filesystems. I think I once saw
a "../../foo/bar/baz.c" there, for example. So we cannot easily
detect ``bogus'' here.
> We should not be showing the raw data to a front end, only
> the resolved path.
I don't think this is a good idea, because we don't have enough
information. If we try to resolve and the path winds up with
incorrect value, the user will be unable to access the source file.
OTOH, if we leave these semi-absolute file names intact, the user
could remedy the situation by using the `cd' command from inside GDB.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 20:49 ` Eli Zaretskii
@ 2005-05-04 13:34 ` Daniel Jacobowitz
2005-05-04 13:51 ` Bob Rossi
2005-05-04 18:05 ` Eli Zaretskii
0 siblings, 2 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-04 13:34 UTC (permalink / raw)
To: gdb-patches
On Tue, May 03, 2005 at 11:46:26PM +0300, Eli Zaretskii wrote:
> > This is where we disagree. GDB should do the search, yes. But it
> > should never ask the user to do any guessing again.
>
> I'm not sure we understand each other: who said anything about
> guessing or asking the user to do so?
I consider printing "d:foo.c" to be "asking the user to guess". We
didn't tell them where the file was.
> > GDB has to settle on a path eventually, whether or not that path
> > ends up containing the file. I believe that GDB should settle on a
> > path and report it precisely to the user.
>
> And where does this contradict anything that I said? For that matter,
> how is this at all related to the issue we are discussing, which I
> thought was how to test the output of the fullname attribute?
If GDB has settled on a path, it can fully resolve it and display it to
the user. For instance, suppose that the best GDB can glean from the
debug information is "d:foo". That's equivalent to "d:./foo". I
presume that DJGPP has some concept of "get the current directory on
drive D". So GDB could print out "d:/some/directory/foo" instead.
I also presume that there's an equivalent "get current drive" for the
"\foo" case.
Why don't you want it to do that?
> > The path still has value in this case even if it doesn't exist!
>
> The same can be said about "\abc" or "d:foo".
Everything has value... but that has less, because of this:
> > We can't show the user the file, but we can use it to unambiguously
> > place a breakpoint in the correct file.
>
> The same can be said about "\abc" or "d:foo".
No, I don't think it can. The difference between an absolute path and
a partially relative path is that an absolute path has no implicit
information. If GDB reports that one file includes a header c:\abc and
another includes \abc, the front end has to guess whether GDB considers
those the same file or not.
> > First of all, in the testsuite we know the file will exist. If GDB can
> > not find it, that's a bug. No matter what. It may be a bug in GDB or
> > a bug in the compiler, but it is a bug, and I want the testsuite to
> > detect it.
>
> Then let's do what I suggested: take the value of fullname and see if
> we can reach the file it names. There's no need for any regexp at
> all; moreover, even if we agree on some regexp, it is only a fuzzy
> test, since the fact that the output matches does not yet mean that
> the output is correct.
Then the value GDB uses will be based on its current directory or
drive, and the value the testsuite uses will be based on its own
current directory or drive. I don't think that's an improvement.
> > Secondly, if we get bogus information from the compiler we will try to
> > resolve it.
>
> Unfortunately, there's no specification known to me as to what can and
> cannot be recorded in the directory name of the source file in the
> debug info, at least not for Windows filesystems. I think I once saw
> a "../../foo/bar/baz.c" there, for example. So we cannot easily
> detect ``bogus'' here.
What I meant here by "resolve" is the same as I meant below. If we get
../../foo/bar/baz.c in the debug information, that's fine; GDB will try
to resolve it relative to $cdir if it can. If it can, then it will
pass the whole thing to lrealpath.
> > We should not be showing the raw data to a front end, only
> > the resolved path.
>
> I don't think this is a good idea, because we don't have enough
> information. If we try to resolve and the path winds up with
> incorrect value, the user will be unable to access the source file.
> OTOH, if we leave these semi-absolute file names intact, the user
> could remedy the situation by using the `cd' command from inside GDB.
"info source" exists to show the user this sort of detail.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 13:34 ` Daniel Jacobowitz
@ 2005-05-04 13:51 ` Bob Rossi
2005-05-04 13:52 ` Daniel Jacobowitz
2005-05-04 17:51 ` Eli Zaretskii
2005-05-04 18:05 ` Eli Zaretskii
1 sibling, 2 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-04 13:51 UTC (permalink / raw)
To: gdb-patches
> > > We can't show the user the file, but we can use it to unambiguously
> > > place a breakpoint in the correct file.
> >
> > The same can be said about "\abc" or "d:foo".
>
> No, I don't think it can. The difference between an absolute path and
> a partially relative path is that an absolute path has no implicit
> information. If GDB reports that one file includes a header c:\abc and
> another includes \abc, the front end has to guess whether GDB considers
> those the same file or not.
This is very true. This will break CGDB for instance. It use's the
fullname as a unique key to a file. If GDB says that c:\abc has 2
breakpoints and \abc has 1, CGDB will have 2 source files the user can
choose and each will contain it's own breakpoints.
It should just think there is 1 file.
What would 'info sources' do in this case anyways?
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 13:51 ` Bob Rossi
@ 2005-05-04 13:52 ` Daniel Jacobowitz
2005-05-04 17:51 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-04 13:52 UTC (permalink / raw)
To: gdb-patches
On Wed, May 04, 2005 at 09:51:22AM -0400, Bob Rossi wrote:
> > > > We can't show the user the file, but we can use it to unambiguously
> > > > place a breakpoint in the correct file.
> > >
> > > The same can be said about "\abc" or "d:foo".
> >
> > No, I don't think it can. The difference between an absolute path and
> > a partially relative path is that an absolute path has no implicit
> > information. If GDB reports that one file includes a header c:\abc and
> > another includes \abc, the front end has to guess whether GDB considers
> > those the same file or not.
>
> This is very true. This will break CGDB for instance. It use's the
> fullname as a unique key to a file. If GDB says that c:\abc has 2
> breakpoints and \abc has 1, CGDB will have 2 source files the user can
> choose and each will contain it's own breakpoints.
>
> It should just think there is 1 file.
>
> What would 'info sources' do in this case anyways?
Display them both, I presume.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 13:51 ` Bob Rossi
2005-05-04 13:52 ` Daniel Jacobowitz
@ 2005-05-04 17:51 ` Eli Zaretskii
2005-05-04 18:06 ` Bob Rossi
1 sibling, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 17:51 UTC (permalink / raw)
To: bob; +Cc: gdb-patches
> Date: Wed, 4 May 2005 09:51:22 -0400
> From: Bob Rossi <bob@brasko.net>
> >
> > No, I don't think it can. The difference between an absolute path and
> > a partially relative path is that an absolute path has no implicit
> > information. If GDB reports that one file includes a header c:\abc and
> > another includes \abc, the front end has to guess whether GDB considers
> > those the same file or not.
>
> This is very true. This will break CGDB for instance. It use's the
> fullname as a unique key to a file. If GDB says that c:\abc has 2
> breakpoints and \abc has 1, CGDB will have 2 source files the user can
> choose and each will contain it's own breakpoints.
That's just a bug in CGDB (or at least in its Windows port, if it
exists): it should use smarter checks for identity of files, like the
equivalent of the Posix inode test.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 17:51 ` Eli Zaretskii
@ 2005-05-04 18:06 ` Bob Rossi
2005-05-04 20:32 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-04 18:06 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Wed, May 04, 2005 at 01:51:21PM -0400, Eli Zaretskii wrote:
> > Date: Wed, 4 May 2005 09:51:22 -0400
> > From: Bob Rossi <bob@brasko.net>
> > >
> > > No, I don't think it can. The difference between an absolute path and
> > > a partially relative path is that an absolute path has no implicit
> > > information. If GDB reports that one file includes a header c:\abc and
> > > another includes \abc, the front end has to guess whether GDB considers
> > > those the same file or not.
> >
> > This is very true. This will break CGDB for instance. It use's the
> > fullname as a unique key to a file. If GDB says that c:\abc has 2
> > breakpoints and \abc has 1, CGDB will have 2 source files the user can
> > choose and each will contain it's own breakpoints.
>
> That's just a bug in CGDB (or at least in its Windows port, if it
> exists): it should use smarter checks for identity of files, like the
> equivalent of the Posix inode test.
Now that's just a difference of opinion. I think GDB should do the
smarter checking and CGDB should get the data. That way there are N
front ends that can assume the data that GDB is outputting is good.
As it stands now, the doco says that the fullname is absolute, and
therefor, CGDB expects that filename to be a unqiue key.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 18:06 ` Bob Rossi
@ 2005-05-04 20:32 ` Eli Zaretskii
0 siblings, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 20:32 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 14:06:32 -0400
> From: Bob Rossi <bob@brasko.net>
> Cc: gdb-patches@sources.redhat.com
>
> > > This is very true. This will break CGDB for instance. It use's the
> > > fullname as a unique key to a file. If GDB says that c:\abc has 2
> > > breakpoints and \abc has 1, CGDB will have 2 source files the user can
> > > choose and each will contain it's own breakpoints.
> >
> > That's just a bug in CGDB (or at least in its Windows port, if it
> > exists): it should use smarter checks for identity of files, like the
> > equivalent of the Posix inode test.
>
> Now that's just a difference of opinion.
Well, of course it's a difference of opinion! The question is whose
opinion is more correct and based on more experience of dragging Posix
programs screaming and kicking into the wonderful world of Microsoft
filesystems.
More to the point: are you saying that CGDB is comparing file names
using strcmp, and if so, are you claiming that the code which does
that is ``correct'', including on Windows? My experience tells me
that the assumption that file names can be compared as strings is very
Posix-centric, and breaks easily on Windows. If you compare file
names as strings, you will fail to find that d:/foo and d:\Foo are the
same file, for example. You will also fail to find that d:/foo/bar
and f:/bar are the same file because f: is a result of the SUBST
command. And then there's the case of a network share that is mapped
to a drive letter, so \\foo\bar\baz and x:/baz, say, could both point
to the same file.
I could go on and on like that, but the bottom line is that file names
are not strings when you wish to check them for equality. If CGDB
does that, it needs to be fixed, at least on Windows. (I'd also fix
it on Unix, since even on Unix there are hardlinks that exibit similar
issues.)
> As it stands now, the doco says that the fullname is absolute, and
> therefor, CGDB expects that filename to be a unqiue key.
The file names \abc and d:foo _are_ absolute, they are just not
``fully qualified''. These two notions are identical on Unix, but not
on Windows. It's a mess that we shouldn't enter without a very good
reason, and the one which started this thread is far from that.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 13:34 ` Daniel Jacobowitz
2005-05-04 13:51 ` Bob Rossi
@ 2005-05-04 18:05 ` Eli Zaretskii
2005-05-04 18:32 ` Daniel Jacobowitz
1 sibling, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 18:05 UTC (permalink / raw)
To: drow; +Cc: gdb-patches
> Date: Wed, 4 May 2005 09:34:37 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> I consider printing "d:foo.c" to be "asking the user to guess". We
> didn't tell them where the file was.
We did, as well as we could.
> If GDB has settled on a path, it can fully resolve it and display it to
> the user. For instance, suppose that the best GDB can glean from the
> debug information is "d:foo". That's equivalent to "d:./foo". I
> presume that DJGPP has some concept of "get the current directory on
> drive D". So GDB could print out "d:/some/directory/foo" instead.
> I also presume that there's an equivalent "get current drive" for the
> "\foo" case.
We could do all that, but (1) it would add more ugly OS-dependent
ifdef's to openp, with no good reason, and (2) for the case in point,
i.e., fixing file names recorded in the debug info, there's still no
guarantee that the result will be correct, for the reasons I already
explained here many times.
> > Then let's do what I suggested: take the value of fullname and see if
> > we can reach the file it names. There's no need for any regexp at
> > all; moreover, even if we agree on some regexp, it is only a fuzzy
> > test, since the fact that the output matches does not yet mean that
> > the output is correct.
>
> Then the value GDB uses will be based on its current directory or
> drive, and the value the testsuite uses will be based on its own
> current directory or drive. I don't think that's an improvement.
Okay, I give up: I no longer care what you do for the test suite in
this case. Just please, PLEASE, don't change anything in openp or in
xfullpath to ``fix'' this test. Can we leave this at that?
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 18:05 ` Eli Zaretskii
@ 2005-05-04 18:32 ` Daniel Jacobowitz
2005-05-04 20:53 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-04 18:32 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Wed, May 04, 2005 at 02:05:22PM -0400, Eli Zaretskii wrote:
> > Date: Wed, 4 May 2005 09:34:37 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> >
> > I consider printing "d:foo.c" to be "asking the user to guess". We
> > didn't tell them where the file was.
>
> We did, as well as we could.
If we're returning a fullname at all, we've decided where to open the
file; we can share that decision with the user/client.
> > If GDB has settled on a path, it can fully resolve it and display it to
> > the user. For instance, suppose that the best GDB can glean from the
> > debug information is "d:foo". That's equivalent to "d:./foo". I
> > presume that DJGPP has some concept of "get the current directory on
> > drive D". So GDB could print out "d:/some/directory/foo" instead.
> > I also presume that there's an equivalent "get current drive" for the
> > "\foo" case.
>
> We could do all that, but (1) it would add more ugly OS-dependent
> ifdef's to openp, with no good reason, and (2) for the case in point,
This would not be in openp. It would, I think, go to lrealpath in
libiberty - which already has Windows-specific bits for this.
> i.e., fixing file names recorded in the debug info, there's still no
> guarantee that the result will be correct, for the reasons I already
> explained here many times.
There's never any guarantee anything we read from the debug information
will be correct. It could be completely bogus; it could be completely
correct, but the file missing from this system. The question is what a
front end can expect from GDB. The documentation says it can expect an
absolute path, not a semi-absolute path.
> > > Then let's do what I suggested: take the value of fullname and see if
> > > we can reach the file it names. There's no need for any regexp at
> > > all; moreover, even if we agree on some regexp, it is only a fuzzy
> > > test, since the fact that the output matches does not yet mean that
> > > the output is correct.
> >
> > Then the value GDB uses will be based on its current directory or
> > drive, and the value the testsuite uses will be based on its own
> > current directory or drive. I don't think that's an improvement.
>
> Okay, I give up: I no longer care what you do for the test suite in
> this case. Just please, PLEASE, don't change anything in openp or in
> xfullpath to ``fix'' this test. Can we leave this at that?
No. The pattern that I believe is correct, and I think that Chris
Faylor does also, is stricter than what you are willing to make GDB
output; so testing for it in the testsuite before we commit to
outputting it would be a little inconsistent. I'd like to reach a
consensus here.
I'm trying not to be antagonistic. You're very worked up about this.
Of course, does it matter in practice? Does DJGPP support 'expect'?
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 18:32 ` Daniel Jacobowitz
@ 2005-05-04 20:53 ` Eli Zaretskii
2005-05-04 21:07 ` Daniel Jacobowitz
2005-05-04 23:37 ` Christopher Faylor
0 siblings, 2 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 20:53 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 14:31:28 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> If we're returning a fullname at all, we've decided where to open the
> file; we can share that decision with the user/client.
That is perhaps true for openp, but not for xfullpath or gdb_realpath:
those functions don't open the file, they just manipulate the string
that is handed to them.
> The question is what a front end can expect from GDB. The
> documentation says it can expect an absolute path, not a
> semi-absolute path.
If the front end is going to open the file, it doesn't matter. If it
is going to compare files for equality, it should not use string
comparison, for the reasons I explained in another message.
> You're very worked up about this.
Because it took me quite an effort to make GDB DTRT with MS-style file
names. So I don't want to see it go down the drain because of some
test case. The main reason for these functions is to handle files
which GDB needs to work with, not to display standardized names. That
is, the ultimate test is whether opening the file will work or not,
not if they look canonical. Canonicalization is a means, not an end
in itself, except in the test that started this. So I'm willing to
give up on this test, but not on what the code does, because I don't
want us to break much more important situations where the current code
works.
> Of course, does it matter in practice? Does DJGPP support 'expect'?
It doesn't. That's why I only care for the functions involved in
this, not about the test case itself.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 20:53 ` Eli Zaretskii
@ 2005-05-04 21:07 ` Daniel Jacobowitz
2005-05-04 21:42 ` Eli Zaretskii
2005-05-04 23:40 ` Christopher Faylor
2005-05-04 23:37 ` Christopher Faylor
1 sibling, 2 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-04 21:07 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Wed, May 04, 2005 at 11:51:08PM +0300, Eli Zaretskii wrote:
> > Date: Wed, 4 May 2005 14:31:28 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb-patches@sources.redhat.com
> >
> > If we're returning a fullname at all, we've decided where to open the
> > file; we can share that decision with the user/client.
>
> That is perhaps true for openp, but not for xfullpath or gdb_realpath:
> those functions don't open the file, they just manipulate the string
> that is handed to them.
I'm still just not following you. The value of those functions if they
can not find the file is _nil_. You can't resolve symlinks in a
directory path, for instance, if you can't find the directory.
realpath() returns ENOENT if you hand it a path that does not exist.
There are five calls to xfullpath in GDB. One is for debugging use
(maint print msymbols). Two are interested in canonicalizing
paths which already meet IS_ABSOLUTE_PATH, for the purposes of
comparison. And the last two are in openp, after successfully opening
the file.
There are six calls to gdb_realpath. One is QNX-specific and I'm not
precisely sure what it's for. Four are used on symtabs for string
comparison. And the last one is in the implementation of xfullpath.
> > The question is what a front end can expect from GDB. The
> > documentation says it can expect an absolute path, not a
> > semi-absolute path.
>
> If the front end is going to open the file, it doesn't matter. If it
> is going to compare files for equality, it should not use string
> comparison, for the reasons I explained in another message.
If it's going to open files, it _does_ matter. You said that the
current directory (and presumably the current drive) are global on this
platform. But the current directory is not stable across time. If the
front end changes the current directory after talking to GDB, suddenly
it won't be able to open files.
> Because it took me quite an effort to make GDB DTRT with MS-style file
> names. So I don't want to see it go down the drain because of some
> test case. The main reason for these functions is to handle files
> which GDB needs to work with, not to display standardized names. That
> is, the ultimate test is whether opening the file will work or not,
> not if they look canonical. Canonicalization is a means, not an end
> in itself, except in the test that started this. So I'm willing to
> give up on this test, but not on what the code does, because I don't
> want us to break much more important situations where the current code
> works.
Can you give me an example of when canonicalization would be harmful?
The only one I can think of is "the current directory was wrong when we
tried to open the file, so we change the current directory and things
start working". This relies on a DJGPP specific property; if you want
this behavior, the right way to do it is to make GDB re-resolve
filenames when its current directory changes.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 21:07 ` Daniel Jacobowitz
@ 2005-05-04 21:42 ` Eli Zaretskii
2005-05-04 22:01 ` Daniel Jacobowitz
2005-05-04 23:40 ` Christopher Faylor
1 sibling, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 21:42 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 17:07:17 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> The value of those functions if they can not find the file is _nil_.
No, it's not. Given enough information, e.g., the leading directories
and the basename, one can reconstruct the absolute file name even if
it no longer exists.
> realpath() returns ENOENT if you hand it a path that does not exist.
Does GetFullPathName on Windows fails in similar ways for non-existent
files?
In any case, the fact that realpath fails for non-existent files does
not seem to be documented, and I, for one, would not necessarily
expect that, as some similar functions and system calls I've met over
the years on other platforms didn't fail like that.
> There are five calls to xfullpath in GDB. One is for debugging use
> (maint print msymbols). Two are interested in canonicalizing
> paths which already meet IS_ABSOLUTE_PATH, for the purposes of
> comparison. And the last two are in openp, after successfully opening
> the file.
>
> There are six calls to gdb_realpath. One is QNX-specific and I'm not
> precisely sure what it's for. Four are used on symtabs for string
> comparison. And the last one is in the implementation of xfullpath.
I don't follow the rationale for enumerating the current uses. These
are sufficiently general-purpose functions; even if today they are
used in certain contexts, tomorrow someone could use them in a
different context. We need to think about potential uses even if they
aren't currently in the sources.
> > If the front end is going to open the file, it doesn't matter. If it
> > is going to compare files for equality, it should not use string
> > comparison, for the reasons I explained in another message.
>
> If it's going to open files, it _does_ matter. You said that the
> current directory (and presumably the current drive) are global on this
> platform. But the current directory is not stable across time. If the
> front end changes the current directory after talking to GDB, suddenly
> it won't be able to open files.
In some (hopefully rare) cases, yes. \abc will remain correct as long
as you don't change the drive; d:foo and d:./foo will remain correct
as long as you don't change the cwd on drive d:. Both changes are
rare in practice.
However, similar changes that invalidate file names can happen on Unix
as well: mounted file systems can be unmounted, symlinks can be
broken, etc. When that happens, GDB will no longer be able to open the
file, even if its name is 100% absolute.
> Can you give me an example of when canonicalization would be harmful?
It's gratuitous, even if the result is correct. And we don't know how
to detect when it is correct.
> The only one I can think of is "the current directory was wrong when we
> tried to open the file, so we change the current directory and things
> start working". This relies on a DJGPP specific property
??? What DJGPP specific property? What I had in mind was the GDB "cd"
command typed by the user (who presumably knows where to go), not
something specific to DJGPP.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 21:42 ` Eli Zaretskii
@ 2005-05-04 22:01 ` Daniel Jacobowitz
2005-05-04 23:42 ` Christopher Faylor
2005-05-05 4:15 ` Eli Zaretskii
0 siblings, 2 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-04 22:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
I'm responding to two messages here in a futile attempt to cut down the
branching factor. I can't follow this conversation any more.
On Thu, May 05, 2005 at 12:40:26AM +0300, Eli Zaretskii wrote:
> > Date: Wed, 4 May 2005 17:07:17 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb-patches@sources.redhat.com
> >
> > The value of those functions if they can not find the file is _nil_.
>
> No, it's not. Given enough information, e.g., the leading directories
> and the basename, one can reconstruct the absolute file name even if
> it no longer exists.
All they take as an argument is a single filename. If it doesn't
exist, how can they add any value to that?
> > realpath() returns ENOENT if you hand it a path that does not exist.
>
> Does GetFullPathName on Windows fails in similar ways for non-existent
> files?
No, it doesn't look like it does. However, most of what that function
appears to do is what I would want DJGPP to do - add the current drive
and the current directory.
> In any case, the fact that realpath fails for non-existent files does
> not seem to be documented, and I, for one, would not necessarily
> expect that, as some similar functions and system calls I've met over
> the years on other platforms didn't fail like that.
Can you give me an example? FYI, realpath in POSIX has this property,
so I don't know what you mean by "not documented".
http://www.opengroup.org/onlinepubs/009695399/functions/realpath.html
[ENOENT]
A component of file_name does not name an existing file or
file_name points to an empty string.
canonicalize_file_name is slightly different but still requires the
directory to exist:
In any of the path components except the last one is missing the
function returns a NULL pointer. This is also what is returned if
the length of the path reaches or exceeds `PATH_MAX' characters.
In any case `errno' is set accordingly.
Not sure what standard that conforms to.
> > There are five calls to xfullpath in GDB. One is for debugging use
> > (maint print msymbols). Two are interested in canonicalizing
> > paths which already meet IS_ABSOLUTE_PATH, for the purposes of
> > comparison. And the last two are in openp, after successfully opening
> > the file.
> >
> > There are six calls to gdb_realpath. One is QNX-specific and I'm not
> > precisely sure what it's for. Four are used on symtabs for string
> > comparison. And the last one is in the implementation of xfullpath.
>
> I don't follow the rationale for enumerating the current uses. These
> are sufficiently general-purpose functions; even if today they are
> used in certain contexts, tomorrow someone could use them in a
> different context. We need to think about potential uses even if they
> aren't currently in the sources.
My point was that absolutely none of these users are both valid and
relevant according to the point you were making: i.e. don't open the
file, just do string games with it, and then don't use string
comparison to determine if two files are the same.
> > > If the front end is going to open the file, it doesn't matter. If it
> > > is going to compare files for equality, it should not use string
> > > comparison, for the reasons I explained in another message.
> >
> > If it's going to open files, it _does_ matter. You said that the
> > current directory (and presumably the current drive) are global on this
> > platform. But the current directory is not stable across time. If the
> > front end changes the current directory after talking to GDB, suddenly
> > it won't be able to open files.
>
> In some (hopefully rare) cases, yes. \abc will remain correct as long
> as you don't change the drive; d:foo and d:./foo will remain correct
> as long as you don't change the cwd on drive d:. Both changes are
> rare in practice.
>
> However, similar changes that invalidate file names can happen on Unix
> as well: mounted file systems can be unmounted, symlinks can be
> broken, etc. When that happens, GDB will no longer be able to open the
> file, even if its name is 100% absolute.
These are changes to the system rather than what is generally seen as a
change to the user environment, even if in the DJGPP environment it's a
piece of global state. Someone could remove the disk, too. I'm not
sure of the relevance.
> > Can you give me an example of when canonicalization would be harmful?
>
> It's gratuitous, even if the result is correct. And we don't know how
> to detect when it is correct.
If it's incorrect, it's harmful. That's what I want an example of. I
don't agree that it's gratuitous - I think it's vital.
> > The only one I can think of is "the current directory was wrong when we
> > tried to open the file, so we change the current directory and things
> > start working". This relies on a DJGPP specific property
>
> ??? What DJGPP specific property? What I had in mind was the GDB "cd"
> command typed by the user (who presumably knows where to go), not
> something specific to DJGPP.
I was referring to the global CWD, and the front end's perspective.
The front end changes the current directory, and then it can open this
file GDB told it about a while earlier. The opposite of the broken
case above.
In any case I think there is no point to continuing this discussion.
In particular you wrote:
> Because of 2 reasons: (1) there's nothing wrong with d:foo, so
> resolving the cwd on drive d: would mean gratuitous DOS-specific code
> in a general-purpose source file, which I try to avoid; and (2) because
> years I spent porting dozens of GNU packages to DJGPP led me to this
> engineering decision which I found to work well in _all_ of the many
> packages I ported. I'm not going to go back and recollect all of the
> complicated situations and reiterate hundreds of hours of testing and
> debugging, just so that openp and xfullpath will look logically
> perfect to an outsider.
For (1), lrealpath already has Windows-specific code so I don't see why
DOS-specific code is inappropriate; for (2) there's nothing I can
possibly say to that since it's an argument of the form "I know
better than you do".
I have no personal involvement in how GDB works on DJGPP. I don't know
if DJGPP offers the necessary functionality for any MI-based front end.
So I'm willing to leave the documentation saying that the MI returns
absolute, or fully qualified if you prefer, paths on every system even
if that isn't accurate on DJGPP. I think it's a quality of
implementation improvement to always fully qualify these paths. You
think it's evil. So let's continue to not do it on DJGPP; we already
do it everywhere else.
> Beware: you might break things by this change, since currently
> lrealpath returns file names with backslashes, which is not a good
> idea in a program that came from the Posix world.
GDB already handles pathnames with backslashes. So does GCC. So do
the GNU binutils. Those are the only programs I know of which use
libiberty, and except for GDB they use lrealpath already. The original
implementation of lrealpath was based on gdb_realpath, FYI. A Windows
developer did the work to make things work properly when using
GetFullPathName.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 22:01 ` Daniel Jacobowitz
@ 2005-05-04 23:42 ` Christopher Faylor
2005-05-05 4:15 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Christopher Faylor @ 2005-05-04 23:42 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Wed, May 04, 2005 at 06:01:47PM -0400, Daniel Jacobowitz wrote:
>> Does GetFullPathName on Windows fails in similar ways for non-existent
>> files?
>
>No, it doesn't look like it does.
It doesn't AFAICT.
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 22:01 ` Daniel Jacobowitz
2005-05-04 23:42 ` Christopher Faylor
@ 2005-05-05 4:15 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-05 4:15 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 18:01:47 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> > No, it's not. Given enough information, e.g., the leading directories
> > and the basename, one can reconstruct the absolute file name even if
> > it no longer exists.
>
> All they take as an argument is a single filename. If it doesn't
> exist, how can they add any value to that?
If cwd is /foo/bar and the file name passed to lrealpath is
"../abc/def", I can compute the absolute name /foo/abc/def even if
neither /foo/bar nor ../abc/def exist.
> > In any case, the fact that realpath fails for non-existent files does
> > not seem to be documented, and I, for one, would not necessarily
> > expect that, as some similar functions and system calls I've met over
> > the years on other platforms didn't fail like that.
>
> Can you give me an example? FYI, realpath in POSIX has this property,
> so I don't know what you mean by "not documented".
Sorry, too many similar names. I meant that lrealpath does not
document that it fails for non-existent files.
> > Beware: you might break things by this change, since currently
> > lrealpath returns file names with backslashes, which is not a good
> > idea in a program that came from the Posix world.
>
> GDB already handles pathnames with backslashes. So does GCC. So do
> the GNU binutils. Those are the only programs I know of which use
> libiberty, and except for GDB they use lrealpath already. The original
> implementation of lrealpath was based on gdb_realpath, FYI. A Windows
> developer did the work to make things work properly when using
> GetFullPathName.
I replied to this in my other message: it's IMHO unsafe to return a
name with backslashes, becaues it might be passed to a program that
doesn't handle them well, like Bash or Make.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 21:07 ` Daniel Jacobowitz
2005-05-04 21:42 ` Eli Zaretskii
@ 2005-05-04 23:40 ` Christopher Faylor
2005-05-05 0:05 ` Bob Rossi
2005-05-05 4:02 ` Eli Zaretskii
1 sibling, 2 replies; 103+ messages in thread
From: Christopher Faylor @ 2005-05-04 23:40 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Wed, May 04, 2005 at 05:07:17PM -0400, Daniel Jacobowitz wrote:
>If it's going to open files, it _does_ matter. You said that the
>current directory (and presumably the current drive) are global on this
>platform. But the current directory is not stable across time. If the
>front end changes the current directory after talking to GDB, suddenly
>it won't be able to open files.
Right. Presumably, on windows 9x you could do something like:
(gdb) shell
d:
cd \foo
exit
and end up invalidating anything which was previously pointing to
d:foo.
Although, hmm. That assumes that all of the filenames had been
previously resolved of course. I don't think that's necessarily true in
gdb is it? Wouldn't some filenames be canonicalized only as needed?
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 23:40 ` Christopher Faylor
@ 2005-05-05 0:05 ` Bob Rossi
2005-05-05 4:02 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-05 0:05 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Wed, May 04, 2005 at 07:40:35PM -0400, Christopher Faylor wrote:
> On Wed, May 04, 2005 at 05:07:17PM -0400, Daniel Jacobowitz wrote:
> >If it's going to open files, it _does_ matter. You said that the
> >current directory (and presumably the current drive) are global on this
> >platform. But the current directory is not stable across time. If the
> >front end changes the current directory after talking to GDB, suddenly
> >it won't be able to open files.
>
> Right. Presumably, on windows 9x you could do something like:
>
> (gdb) shell
> d:
> cd \foo
> exit
>
> and end up invalidating anything which was previously pointing to
> d:foo.
>
> Although, hmm. That assumes that all of the filenames had been
> previously resolved of course. I don't think that's necessarily true in
> gdb is it? Wouldn't some filenames be canonicalized only as needed?
This may or may not be what you mean. However, if you do
-file-list-exec-source-files, GDB prints the filename and fullname for
every file that it knows about. The purpose of this is to let the front
end know about each and every file that GDB knows about. As I've stated
before, I believe most if not all FE's depend on the fullname to be a
unique key.
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 23:40 ` Christopher Faylor
2005-05-05 0:05 ` Bob Rossi
@ 2005-05-05 4:02 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-05 4:02 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 19:40:35 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> On Wed, May 04, 2005 at 05:07:17PM -0400, Daniel Jacobowitz wrote:
> >If it's going to open files, it _does_ matter. You said that the
> >current directory (and presumably the current drive) are global on this
> >platform. But the current directory is not stable across time. If the
> >front end changes the current directory after talking to GDB, suddenly
> >it won't be able to open files.
>
> Right. Presumably, on windows 9x you could do something like:
>
> (gdb) shell
> d:
> cd \foo
> exit
>
> and end up invalidating anything which was previously pointing to
> d:foo.
It would be a bug if this happened. That is why we have this fragment
in cli-cmds.c:shell_escape:
#ifdef GLOBAL_CURDIR
/* Make sure to return to the directory GDB thinks it is, in case the
shell command we just ran changed it. */
chdir (current_directory);
#endif
The DJGPP's version of chdir changes the drive as well as the
directory if its argument mentions a drive different from the current
one.
(It looks like GLOBAL_CURDIR is defined on defs.h only for the DJGPP
port, so I think perhaps the MinGW port should do that as well.)
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 20:53 ` Eli Zaretskii
2005-05-04 21:07 ` Daniel Jacobowitz
@ 2005-05-04 23:37 ` Christopher Faylor
2005-05-05 4:05 ` Eli Zaretskii
1 sibling, 1 reply; 103+ messages in thread
From: Christopher Faylor @ 2005-05-04 23:37 UTC (permalink / raw)
To: gdb-patches
On Wed, May 04, 2005 at 11:51:08PM +0300, Eli Zaretskii wrote:
>> Of course, does it matter in practice? Does DJGPP support 'expect'?
>
>It doesn't. That's why I only care for the functions involved in
>this, not about the test case itself.
But, conceivably a MinGW port could support expect. I'd like to see a
native Windows port provide fully qualified paths, even if that isn't a
requirement for DJGPP.
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 23:37 ` Christopher Faylor
@ 2005-05-05 4:05 ` Eli Zaretskii
0 siblings, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-05 4:05 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 19:37:03 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> >It doesn't. That's why I only care for the functions involved in
> >this, not about the test case itself.
>
> But, conceivably a MinGW port could support expect. I'd like to see a
> native Windows port provide fully qualified paths, even if that isn't a
> requirement for DJGPP.
Me too. That is why I suggested a regex for this test case in the
first place. But if the result is that changes will be made that I
don't approve of and cannot afford to continue arguing about, then all
I _reallY_ care about is that the DJGPP port will continue doing what
it does now.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 19:36 ` Eli Zaretskii
2005-05-03 19:49 ` Daniel Jacobowitz
@ 2005-05-03 19:57 ` Bob Rossi
2005-05-03 21:15 ` Eli Zaretskii
2005-05-03 22:50 ` Bob Rossi
2 siblings, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-03 19:57 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Tue, May 03, 2005 at 10:34:15PM +0300, Eli Zaretskii wrote:
> > Date: Mon, 2 May 2005 23:46:05 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb-patches@sources.redhat.com
> >
> > > > That's not what we're testing for in the testsuite, though.
> > >
> > > What _are_ we trying to test?
> >
> > GDB is outputting an absolute path, which will be used by either the
> > user or by a front end. In either case, it should locate the file
> > entirely unambiguously.
>
> If that is what we want to test, then the test is IMHO inappropriate:
> we shouldn't try to identify an absolute file name, we should see if
> the name it produces corresponds to a real file. I.e., try to stat
> the file, or maybe cmp it against the source whose path we know, or
> something like that.
OK, I think I can solve some confusion here. At least, I feel that I
just understood why you have your position to allow paths that are not
absolute to be acceptable in the fullname output.
When I originally added the field fullname, I purposely picked that name
because I was unsure if the path would always be absolute. However, it
was to my understand, that it would always be. Thus, in the manual I
put,
Synopsis
-file-list-exec-source-file
List the line number, the current source file, and the absolute path to
the current source file for the current executable.
I always expected the fullname to be absolute. This is why I made the
original regex /.*
> > > > I think that we should reject both \abc and d:foo here.
> > >
> > > I don't think so.
> >
> > Could you explain why?
>
> Because (as I said in my other mail this morning) such semi-absolute
> file names can be recorded in the debug info, albeit under somewhat
> unusual circumstances. Since we don't own the compiler's code that
> records file and directory names in the debug info, we can never be
> 100% sure such file names will never end up there. When they do,
> there's nothing we can do about them in GDB but try to find them, see
> below. Failing the test because we see such file names will thus do a
> misservice to us: it will mark a perfrctly legitimate result as a
> failure.
Currently, any front end using the fullname output is expecting the
output to be an absolute path to a file. If this is not the case in all
circumstances, then the documentation and expections of the FE
developers need's to change.
I think it would be helpful if we could discover a case in
which GDB would not be able to output an absolute path, but would still
think that it has an absolute path. If that case is possible, than the
doco needs to be updated and the fullname would consider absolute paths
and some other special cases (\abc d:foo). If that case is not
possible, then we can consider only absolute paths. Does this sound
correct?
The code to look at is source.c:openp. The filename_opened parameter is
either
- NULL
- xfullpath (filename) where filename is potentially any file
- xfullpath (current_directory/filename)
Does anyone know what xfullpath would do if d:foo or \abc was passed to
it? I look more into this...
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 19:57 ` Bob Rossi
@ 2005-05-03 21:15 ` Eli Zaretskii
2005-05-03 21:39 ` Bob Rossi
2005-05-03 21:39 ` Christopher Faylor
0 siblings, 2 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-03 21:15 UTC (permalink / raw)
To: gdb-patches
> Date: Tue, 3 May 2005 15:56:50 -0400
> From: Bob Rossi <bob@brasko.net>
> Cc: gdb-patches@sources.redhat.com
>
> When I originally added the field fullname, I purposely picked that name
> because I was unsure if the path would always be absolute. However, it
> was to my understand, that it would always be. Thus, in the manual I
> put,
>
> Synopsis
> -file-list-exec-source-file
>
> List the line number, the current source file, and the absolute path to
> the current source file for the current executable.
>
> I always expected the fullname to be absolute.
As I tried to explain, the Windows file names have a semi-absolute
form. That form is generally treated like an absolute file name
because the single most important cause for a program to test a file
name for being absolute is to decide whether we need to prepend the
cwd to it; d:foo and \abc certainly don't need that! The fullname
field uses the machinery that was invented mainly for that purpose, so
it inherits the same behavior.
> Currently, any front end using the fullname output is expecting the
> output to be an absolute path to a file. If this is not the case in all
> circumstances, then the documentation and expections of the FE
> developers need's to change.
As I explained in my previous messages, there's nothing the FE can do
but try accessing the file as if it were handed an absolute file name.
So the FE doesn't need to worry about this and doesn't need to change
its expectations in any way, because no change in expectations will
ever succeed in resurrecting the missing information (the drive letter
in the case of \abc and the current directory on drive d: in the case
of d:foo).
> I think it would be helpful if we could discover a case in
> which GDB would not be able to output an absolute path, but would still
> think that it has an absolute path. If that case is possible, than the
> doco needs to be updated and the fullname would consider absolute paths
> and some other special cases (\abc d:foo). If that case is not
> possible, then we can consider only absolute paths. Does this sound
> correct?
I cannot say if this is correct because I cannot figure out what are
you saying. What does it mean for fullname to consider absolute file
names and also special cases like \abc? How will it ``consider''
them?
> The code to look at is source.c:openp. The filename_opened parameter is
> either
> - NULL
> - xfullpath (filename) where filename is potentially any file
> - xfullpath (current_directory/filename)
>
> Does anyone know what xfullpath would do if d:foo or \abc was passed to
> it?
I already answered that in this thread: it will leave \abc intact, and
d:foo will be converted into d:./foo. (On Windows, that is, and
assuming that there's no realpath or canonicalize_file_name in MinGW.)
So xfullpath does not change anything with these cases on Windows (and
can't, since the necessary information is missing).
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 21:15 ` Eli Zaretskii
@ 2005-05-03 21:39 ` Bob Rossi
2005-05-03 22:14 ` Christopher Faylor
2005-05-04 4:18 ` Eli Zaretskii
2005-05-03 21:39 ` Christopher Faylor
1 sibling, 2 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-03 21:39 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Wed, May 04, 2005 at 12:12:48AM +0300, Eli Zaretskii wrote:
> > Date: Tue, 3 May 2005 15:56:50 -0400
> > From: Bob Rossi <bob@brasko.net>
> > Cc: gdb-patches@sources.redhat.com
> >
> > When I originally added the field fullname, I purposely picked that name
> > because I was unsure if the path would always be absolute. However, it
> > was to my understand, that it would always be. Thus, in the manual I
> > put,
> >
> > Synopsis
> > -file-list-exec-source-file
> >
> > List the line number, the current source file, and the absolute path to
> > the current source file for the current executable.
> >
> > I always expected the fullname to be absolute.
>
> As I tried to explain, the Windows file names have a semi-absolute
> form. That form is generally treated like an absolute file name
> because the single most important cause for a program to test a file
> name for being absolute is to decide whether we need to prepend the
> cwd to it; d:foo and \abc certainly don't need that! The fullname
> field uses the machinery that was invented mainly for that purpose, so
> it inherits the same behavior.
OK, I'm going to add the examples d:foo and \abc to the doco. This could
potentially help FE developers understand these odd case's when they
appear. Also, it's important to say that the fullname is not necessarily
absolute, but simply the most precise file name that GDB has.
> > Currently, any front end using the fullname output is expecting the
> > output to be an absolute path to a file. If this is not the case in all
> > circumstances, then the documentation and expections of the FE
> > developers need's to change.
>
> As I explained in my previous messages, there's nothing the FE can do
> but try accessing the file as if it were handed an absolute file name.
> So the FE doesn't need to worry about this and doesn't need to change
> its expectations in any way, because no change in expectations will
> ever succeed in resurrecting the missing information (the drive letter
> in the case of \abc and the current directory on drive d: in the case
> of d:foo).
Agreed.
> > I think it would be helpful if we could discover a case in
> > which GDB would not be able to output an absolute path, but would still
> > think that it has an absolute path. If that case is possible, than the
> > doco needs to be updated and the fullname would consider absolute paths
> > and some other special cases (\abc d:foo). If that case is not
> > possible, then we can consider only absolute paths. Does this sound
> > correct?
>
> I cannot say if this is correct because I cannot figure out what are
> you saying. What does it mean for fullname to consider absolute file
> names and also special cases like \abc? How will it ``consider''
> them?
>
> > The code to look at is source.c:openp. The filename_opened parameter is
> > either
> > - NULL
> > - xfullpath (filename) where filename is potentially any file
> > - xfullpath (current_directory/filename)
> >
> > Does anyone know what xfullpath would do if d:foo or \abc was passed to
> > it?
>
> I already answered that in this thread: it will leave \abc intact, and
> d:foo will be converted into d:./foo. (On Windows, that is, and
> assuming that there's no realpath or canonicalize_file_name in MinGW.)
> So xfullpath does not change anything with these cases on Windows (and
> can't, since the necessary information is missing).
What I was trying to say was, if d:foo and d:./foo will currently return in
the fullpath field, then fullname does not always return absolute paths.
I should document -file-list-exec-source-file to state this. Also, the
regex should match the existing functionality (which does not force
absolute paths).
It was Daniel's initial suggestion to not check for an absolute path. I
suggested we should, since I was under the impreession that the fullname
should always check for an absolute path. As Daniel pointed out since
then, it's probably OK to have the regex check for an absolute path,
since we are sure that the testsuite is always going to display that
property.
As a separate issue, we can discuess if fullname should always return as
an absolute path. For now, I'd like to document and test GDB's current
behavior.
Thanks for clearing things up.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 21:39 ` Bob Rossi
@ 2005-05-03 22:14 ` Christopher Faylor
2005-05-04 4:08 ` Eli Zaretskii
2005-05-04 4:18 ` Eli Zaretskii
1 sibling, 1 reply; 103+ messages in thread
From: Christopher Faylor @ 2005-05-03 22:14 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Tue, May 03, 2005 at 05:39:43PM -0400, Bob Rossi wrote:
>On Wed, May 04, 2005 at 12:12:48AM +0300, Eli Zaretskii wrote:
>> > Date: Tue, 3 May 2005 15:56:50 -0400
>> > From: Bob Rossi <bob@brasko.net>
>> > Cc: gdb-patches@sources.redhat.com
>> >
>> > When I originally added the field fullname, I purposely picked that name
>> > because I was unsure if the path would always be absolute. However, it
>> > was to my understand, that it would always be. Thus, in the manual I
>> > put,
>> >
>> > Synopsis
>> > -file-list-exec-source-file
>> >
>> > List the line number, the current source file, and the absolute path to
>> > the current source file for the current executable.
>> >
>> > I always expected the fullname to be absolute.
>>
>> As I tried to explain, the Windows file names have a semi-absolute
>> form. That form is generally treated like an absolute file name
>> because the single most important cause for a program to test a file
>> name for being absolute is to decide whether we need to prepend the
>> cwd to it; d:foo and \abc certainly don't need that! The fullname
>> field uses the machinery that was invented mainly for that purpose, so
>> it inherits the same behavior.
>
>OK, I'm going to add the examples d:foo and \abc to the doco. This
>could potentially help FE developers understand these odd case's when
>they appear. Also, it's important to say that the fullname is not
>necessarily absolute, but simply the most precise file name that GDB
>has.
Wouldn't it make more sense to fix the fullpath machinery?
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 22:14 ` Christopher Faylor
@ 2005-05-04 4:08 ` Eli Zaretskii
2005-05-04 13:39 ` Daniel Jacobowitz
0 siblings, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 4:08 UTC (permalink / raw)
To: gdb-patches
> Date: Tue, 3 May 2005 18:13:40 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> Wouldn't it make more sense to fix the fullpath machinery?
The fullpath machinery is fine, it doesn't need any fixing.
Please, let's not break something that works just because some test
case doesn't seem 100% correct. Let's keep things in the right
perspective here. The fullpath machinery was invented to let GDB
process file names for its internal purposes, and it does its job
well, because for those purposes, treating d:foo as absolute file
names is _exactly_ right.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 4:08 ` Eli Zaretskii
@ 2005-05-04 13:39 ` Daniel Jacobowitz
2005-05-04 17:49 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-04 13:39 UTC (permalink / raw)
To: gdb-patches
On Wed, May 04, 2005 at 07:05:40AM +0300, Eli Zaretskii wrote:
> > Date: Tue, 3 May 2005 18:13:40 -0400
> > From: Christopher Faylor <me@cgf.cx>
> >
> > Wouldn't it make more sense to fix the fullpath machinery?
>
> The fullpath machinery is fine, it doesn't need any fixing.
>
> Please, let's not break something that works just because some test
> case doesn't seem 100% correct. Let's keep things in the right
> perspective here. The fullpath machinery was invented to let GDB
> process file names for its internal purposes, and it does its job
> well, because for those purposes, treating d:foo as absolute file
> names is _exactly_ right.
Huh? That's not true. xfullpath was created to avoid canonicalizing
certain file symlinks, not to change anything having to do with
absolute paths or directory links. Are you talking about some
different function?
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 13:39 ` Daniel Jacobowitz
@ 2005-05-04 17:49 ` Eli Zaretskii
0 siblings, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 17:49 UTC (permalink / raw)
To: drow; +Cc: gdb-patches
> Date: Wed, 4 May 2005 09:39:36 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> > The fullpath machinery was invented to let GDB
> > process file names for its internal purposes, and it does its job
> > well, because for those purposes, treating d:foo as absolute file
> > names is _exactly_ right.
>
> Huh? That's not true. xfullpath was created to avoid canonicalizing
> certain file symlinks, not to change anything having to do with
> absolute paths or directory links. Are you talking about some
> different function?
I was talking about openp, which is the core of resolving incomplete
file names.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 21:39 ` Bob Rossi
2005-05-03 22:14 ` Christopher Faylor
@ 2005-05-04 4:18 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 4:18 UTC (permalink / raw)
To: gdb-patches
> Date: Tue, 3 May 2005 17:39:43 -0400
> From: Bob Rossi <bob@brasko.net>
> Cc: gdb-patches@sources.redhat.com
>
> OK, I'm going to add the examples d:foo and \abc to the doco.
Please don't bother, cause I'm going to reject any such text. You are
going to confuse FE developers with no real reason.
> This could potentially help FE developers understand these odd
> case's when they appear.
I already explained more than once that they don't need to bother.
Please re-read my messages, and if something is unclear, please ask
specific questions (but not the same ones you already asked).
> Also, it's important to say that the fullname is not necessarily
> absolute, but simply the most precise file name that GDB has.
There's no need to say things like that because FE developers won't
know what to do about it.
> What I was trying to say was, if d:foo and d:./foo will currently return in
> the fullpath field, then fullname does not always return absolute paths.
It returns the best approximation it can come up with.
> I should document -file-list-exec-source-file to state this. Also, the
> regex should match the existing functionality (which does not force
> absolute paths).
The regexp I suggested does just that. So why are we still arguing?
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 21:15 ` Eli Zaretskii
2005-05-03 21:39 ` Bob Rossi
@ 2005-05-03 21:39 ` Christopher Faylor
2005-05-03 22:24 ` Daniel Jacobowitz
2005-05-04 4:27 ` Eli Zaretskii
1 sibling, 2 replies; 103+ messages in thread
From: Christopher Faylor @ 2005-05-03 21:39 UTC (permalink / raw)
To: gdb-patches
On Wed, May 04, 2005 at 12:12:48AM +0300, Eli Zaretskii wrote:
>> Date: Tue, 3 May 2005 15:56:50 -0400
>> From: Bob Rossi
>> Does anyone know what xfullpath would do if d:foo or \abc was passed to
>> it?
>
>I already answered that in this thread: it will leave \abc intact, and
>d:foo will be converted into d:./foo. (On Windows, that is, and
>assuming that there's no realpath or canonicalize_file_name in MinGW.)
>So xfullpath does not change anything with these cases on Windows (and
>can't, since the necessary information is missing).
Cygwin has realpath and Windows has an equivalent function. AFAIK, it
will correctly translate \abc to x:\abc. I don't know what it will do
with d:foo. NT+ shells treat that as "the current directory on drive
d:" but that's just something that is special to a shell. Probably it
should be resolved as "d:\foo". Hopefully the Windows routine for
producing absolute paths will do something sensical.
Anyway, it seems like the mingw port should be using GetFullPathName()
in gdb_realpath().
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 21:39 ` Christopher Faylor
@ 2005-05-03 22:24 ` Daniel Jacobowitz
2005-05-03 22:27 ` Christopher Faylor
2005-05-04 4:12 ` Eli Zaretskii
2005-05-04 4:27 ` Eli Zaretskii
1 sibling, 2 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-03 22:24 UTC (permalink / raw)
To: gdb-patches
On Tue, May 03, 2005 at 05:39:11PM -0400, Christopher Faylor wrote:
> On Wed, May 04, 2005 at 12:12:48AM +0300, Eli Zaretskii wrote:
> >> Date: Tue, 3 May 2005 15:56:50 -0400
> >> From: Bob Rossi
> >> Does anyone know what xfullpath would do if d:foo or \abc was passed to
> >> it?
> >
> >I already answered that in this thread: it will leave \abc intact, and
> >d:foo will be converted into d:./foo. (On Windows, that is, and
> >assuming that there's no realpath or canonicalize_file_name in MinGW.)
> >So xfullpath does not change anything with these cases on Windows (and
> >can't, since the necessary information is missing).
>
> Cygwin has realpath and Windows has an equivalent function. AFAIK, it
> will correctly translate \abc to x:\abc. I don't know what it will do
> with d:foo. NT+ shells treat that as "the current directory on drive
> d:" but that's just something that is special to a shell. Probably it
> should be resolved as "d:\foo". Hopefully the Windows routine for
> producing absolute paths will do something sensical.
>
> Anyway, it seems like the mingw port should be using GetFullPathName()
> in gdb_realpath().
libiberty/lbasename.h:
/* cygwin has realpath, so it won't get here. */
# if defined (_WIN32)
# define WIN32_LEAN_AND_MEAN
# include <windows.h> /* for GetFullPathName */
# endif
So we call Cygwin's realpath or Window's GetFullPathName if we fall
through to the lrealpath call.
I don't know any of this affects DJGPP...
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 22:24 ` Daniel Jacobowitz
@ 2005-05-03 22:27 ` Christopher Faylor
2005-05-04 2:32 ` Bob Rossi
2005-05-04 4:12 ` Eli Zaretskii
1 sibling, 1 reply; 103+ messages in thread
From: Christopher Faylor @ 2005-05-03 22:27 UTC (permalink / raw)
To: gdb-patches
On Tue, May 03, 2005 at 06:24:01PM -0400, Daniel Jacobowitz wrote:
>On Tue, May 03, 2005 at 05:39:11PM -0400, Christopher Faylor wrote:
>> Anyway, it seems like the mingw port should be using GetFullPathName()
>> in gdb_realpath().
>
>libiberty/lbasename.h:
>
> /* cygwin has realpath, so it won't get here. */
># if defined (_WIN32)
># define WIN32_LEAN_AND_MEAN
># include <windows.h> /* for GetFullPathName */
># endif
>
>So we call Cygwin's realpath or Window's GetFullPathName if we fall
>through to the lrealpath call.
>
>I don't know any of this affects DJGPP...
Ah. Sorry. I didn't dig far enough.
So, I guess I don't understand Eli's comments, then.
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 22:27 ` Christopher Faylor
@ 2005-05-04 2:32 ` Bob Rossi
2005-05-04 3:05 ` Christopher Faylor
2005-05-04 17:42 ` Eli Zaretskii
0 siblings, 2 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-04 2:32 UTC (permalink / raw)
To: gdb-patches
On Tue, May 03, 2005 at 06:26:47PM -0400, Christopher Faylor wrote:
> On Tue, May 03, 2005 at 06:24:01PM -0400, Daniel Jacobowitz wrote:
> >On Tue, May 03, 2005 at 05:39:11PM -0400, Christopher Faylor wrote:
> >> Anyway, it seems like the mingw port should be using GetFullPathName()
> >> in gdb_realpath().
> >
> >libiberty/lbasename.h:
> >
> > /* cygwin has realpath, so it won't get here. */
> ># if defined (_WIN32)
> ># define WIN32_LEAN_AND_MEAN
> ># include <windows.h> /* for GetFullPathName */
> ># endif
> >
> >So we call Cygwin's realpath or Window's GetFullPathName if we fall
> >through to the lrealpath call.
> >
> >I don't know any of this affects DJGPP...
>
> Ah. Sorry. I didn't dig far enough.
>
> So, I guess I don't understand Eli's comments, then.
I begin to make up a patch, and realized that the issue below needs to be
resolved before anything can be done.
Basically, Eli believes it is possible for GDB to return in the fullname
field, a file name that is not absolute. Two examples were \abc or
d:foo. He also mentioned that he might have once even seen a relative path.
http://sources.redhat.com/ml/gdb-patches/2005-05/msg00091.html
If what Eli believes is true (a point which I think is not worth debating,
it could go either depending on the input to GDB), then there is 2 philosophies
the testsuite can take to validating the fullname:
- Use .* as a regex and say anthing goes
- Use a regex that represents absolute paths. When this breaks, fix
the fullname machinery.
Does anyone have an opinion on what is a better approach? My humble
opinion is to say that fullname should be an absolute path. If there is
a valid argument for why it is impossible to get an absolute path from a
fullname, then the first approach must be taken.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 2:32 ` Bob Rossi
@ 2005-05-04 3:05 ` Christopher Faylor
2005-05-04 17:42 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Christopher Faylor @ 2005-05-04 3:05 UTC (permalink / raw)
To: gdb-patches
On Tue, May 03, 2005 at 10:32:12PM -0400, Bob Rossi wrote:
>On Tue, May 03, 2005 at 06:26:47PM -0400, Christopher Faylor wrote:
>> On Tue, May 03, 2005 at 06:24:01PM -0400, Daniel Jacobowitz wrote:
>> >On Tue, May 03, 2005 at 05:39:11PM -0400, Christopher Faylor wrote:
>> >> Anyway, it seems like the mingw port should be using GetFullPathName()
>> >> in gdb_realpath().
>> >
>> >libiberty/lbasename.h:
>> >
>> > /* cygwin has realpath, so it won't get here. */
>> ># if defined (_WIN32)
>> ># define WIN32_LEAN_AND_MEAN
>> ># include <windows.h> /* for GetFullPathName */
>> ># endif
>> >
>> >So we call Cygwin's realpath or Window's GetFullPathName if we fall
>> >through to the lrealpath call.
>> >
>> >I don't know any of this affects DJGPP...
>>
>> Ah. Sorry. I didn't dig far enough.
>>
>> So, I guess I don't understand Eli's comments, then.
>
>I begin to make up a patch, and realized that the issue below needs to be
>resolved before anything can be done.
>
>Basically, Eli believes it is possible for GDB to return in the fullname
>field, a file name that is not absolute. Two examples were \abc or
>d:foo. He also mentioned that he might have once even seen a relative path.
> http://sources.redhat.com/ml/gdb-patches/2005-05/msg00091.html
>
>If what Eli believes is true (a point which I think is not worth
>debating, it could go either depending on the input to GDB), then there
>is 2 philosophies the testsuite can take to validating the fullname:
I don't think I've seen it mentioned but absolute paths in windows
either look like this:
d:\foo\bar
or this:
\\share\foo\bar
There are other variations of the \\ form but I don't think they are
important for gdb right now and I don't see any reason why gdb shouldn't
always provide things in one or the other form.
I don't know if this matters to the discussion, but I thought I'd mention
it.
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 2:32 ` Bob Rossi
2005-05-04 3:05 ` Christopher Faylor
@ 2005-05-04 17:42 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 17:42 UTC (permalink / raw)
To: bob; +Cc: gdb-patches
> Date: Tue, 3 May 2005 22:32:12 -0400
> From: Bob Rossi <bob@brasko.net>
>
> - Use .* as a regex and say anthing goes
> - Use a regex that represents absolute paths. When this breaks, fix
> the fullname machinery.
There's also the 3rd possibility: decide that it is okay to return
\abc and d:foo and use the regexp I suggested.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 22:24 ` Daniel Jacobowitz
2005-05-03 22:27 ` Christopher Faylor
@ 2005-05-04 4:12 ` Eli Zaretskii
2005-05-04 13:00 ` Daniel Jacobowitz
1 sibling, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 4:12 UTC (permalink / raw)
To: gdb-patches
> Date: Tue, 3 May 2005 18:24:01 -0400
> From: Daniel Jacobowitz <drow@false.org>
>
> libiberty/lbasename.h:
??? Where did you see this file? It isn't in libiberty/ that comes
with GDB.
> /* cygwin has realpath, so it won't get here. */
> # if defined (_WIN32)
> # define WIN32_LEAN_AND_MEAN
> # include <windows.h> /* for GetFullPathName */
> # endif
>
> So we call Cygwin's realpath or Window's GetFullPathName if we fall
> through to the lrealpath call.
>
> I don't know any of this affects DJGPP...
It doesn't (and it shouldn't).
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 4:12 ` Eli Zaretskii
@ 2005-05-04 13:00 ` Daniel Jacobowitz
0 siblings, 0 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-04 13:00 UTC (permalink / raw)
To: gdb-patches
On Wed, May 04, 2005 at 07:10:19AM +0300, Eli Zaretskii wrote:
> > Date: Tue, 3 May 2005 18:24:01 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> >
> > libiberty/lbasename.h:
>
> ??? Where did you see this file? It isn't in libiberty/ that comes
> with GDB.
libiberty/lrealpath.c. I must've been doing too many things at once.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 21:39 ` Christopher Faylor
2005-05-03 22:24 ` Daniel Jacobowitz
@ 2005-05-04 4:27 ` Eli Zaretskii
2005-05-04 11:48 ` Bob Rossi
` (2 more replies)
1 sibling, 3 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 4:27 UTC (permalink / raw)
To: gdb-patches
> Date: Tue, 3 May 2005 17:39:11 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> Cygwin has realpath and Windows has an equivalent function. AFAIK, it
> will correctly translate \abc to x:\abc.
No, it will _incorrectly_ translate them: the current drive and
directory that are in effect when we call these functions are _not_
what they were when the compiler compiled the source and recorded its
file name in the debug info.
> I don't know what it will do with d:foo. NT+ shells treat that as
> "the current directory on drive d:" but that's just something that
> is special to a shell.
Not true: the notion of a current directory on drive d: is maintained
by the OS. There's a special OS data structure where it holds the
current directory for each drive. Also, unlike on Unix, the current
directory on each drive is globally in effect for all the processes
that run in the current VM.
> Probably it should be resolved as "d:\foo".
Please! I'm gonna cry! you are suggesting to revert the code that took
hard work to get right! openp used to do d:foo -> d:/foo, but that
was blatantly wrong and caused bugs. Let's not go that way just
because some test case doesn't seem 100% right!
I am frustrated by my evident inability to communicate to you all the
simple truth: openp IS OKAY, IT DOESN'T NEED ANY FIXING!
> Hopefully the Windows
> routine for producing absolute paths will do something sensical.
They won't; see above.
> Anyway, it seems like the mingw port should be using GetFullPathName()
> in gdb_realpath().
I don't see this in my sandbox.
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 4:27 ` Eli Zaretskii
@ 2005-05-04 11:48 ` Bob Rossi
2005-05-04 14:55 ` Christopher Faylor
2005-05-04 13:45 ` Daniel Jacobowitz
2005-05-04 14:52 ` Christopher Faylor
2 siblings, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-04 11:48 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
> Please! I'm gonna cry! you are suggesting to revert the code that took
> hard work to get right! openp used to do d:foo -> d:/foo, but that
> was blatantly wrong and caused bugs. Let's not go that way just
> because some test case doesn't seem 100% right!
>
> I am frustrated by my evident inability to communicate to you all the
> simple truth: openp IS OKAY, IT DOESN'T NEED ANY FIXING!
From this email, I understand completly why it would be impossible for
GDB to translate \abc into an absolute path. If the compiler was nieve
enought to put \abc, it's possible that the current drive is different
when GDB looks for the file then when the user compiled it. (Sorry, I
know you already said this, but I believe if I type it all out, it just
might sink in)
I asked a question in this Email,
http://sources.redhat.com/ml/gdb-patches/2005-05/msg00100.html
From the understanding I have now, there is still two options,
- Use .* as a regex and say anthing goes
- Use a regex that detects absolute paths and the 2 special case's
you know of. When this breaks, fix the fullname machinery.
Now, if from the beggining, your original regex was solving the second
problem, I've very sorry for the trouble my hard head put you through.
Would the second solution above satisfy you? anyone else? I'd prefer
that solution.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 11:48 ` Bob Rossi
@ 2005-05-04 14:55 ` Christopher Faylor
2005-05-04 15:02 ` Bob Rossi
2005-05-04 17:43 ` Eli Zaretskii
0 siblings, 2 replies; 103+ messages in thread
From: Christopher Faylor @ 2005-05-04 14:55 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Wed, May 04, 2005 at 07:48:21AM -0400, Bob Rossi wrote:
>> Please! I'm gonna cry! you are suggesting to revert the code that took
>> hard work to get right! openp used to do d:foo -> d:/foo, but that
>> was blatantly wrong and caused bugs. Let's not go that way just
>> because some test case doesn't seem 100% right!
>>
>> I am frustrated by my evident inability to communicate to you all the
>> simple truth: openp IS OKAY, IT DOESN'T NEED ANY FIXING!
>
From this email, I understand completly why it would be impossible for
>GDB to translate \abc into an absolute path. If the compiler was nieve
>enought to put \abc, it's possible that the current drive is different
>when GDB looks for the file then when the user compiled it. (Sorry, I
>know you already said this, but I believe if I type it all out, it just
>might sink in)
>
>I asked a question in this Email,
>http://sources.redhat.com/ml/gdb-patches/2005-05/msg00100.html
Has anyone actually confirmed that gcc will put \abc or x:abc in source
files?
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 14:55 ` Christopher Faylor
@ 2005-05-04 15:02 ` Bob Rossi
2005-05-04 17:43 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-04 15:02 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Wed, May 04, 2005 at 10:55:35AM -0400, Christopher Faylor wrote:
> On Wed, May 04, 2005 at 07:48:21AM -0400, Bob Rossi wrote:
> >> Please! I'm gonna cry! you are suggesting to revert the code that took
> >> hard work to get right! openp used to do d:foo -> d:/foo, but that
> >> was blatantly wrong and caused bugs. Let's not go that way just
> >> because some test case doesn't seem 100% right!
> >>
> >> I am frustrated by my evident inability to communicate to you all the
> >> simple truth: openp IS OKAY, IT DOESN'T NEED ANY FIXING!
> >
> >From this email, I understand completly why it would be impossible for
> >GDB to translate \abc into an absolute path. If the compiler was nieve
> >enought to put \abc, it's possible that the current drive is different
> >when GDB looks for the file then when the user compiled it. (Sorry, I
> >know you already said this, but I believe if I type it all out, it just
> >might sink in)
> >
> >I asked a question in this Email,
> >http://sources.redhat.com/ml/gdb-patches/2005-05/msg00100.html
>
> Has anyone actually confirmed that gcc will put \abc or x:abc in source
> files?
Well, utils.c:xfullpath in GDB has a comment I posted earlier,
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
/* We need to be careful when filename is of the form 'd:foo', which
is equivalent of d:./foo, which is totally different from d:/foo. */
if (strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] == ':')
{
dir_name[2] = '.';
dir_name[3] = '\000';
}
#endif
That leads me to believe that at some point, GDB was getting d:foo from
the compiler as a path. This may have been a compiler bug that was fixed
however.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 14:55 ` Christopher Faylor
2005-05-04 15:02 ` Bob Rossi
@ 2005-05-04 17:43 ` Eli Zaretskii
2005-05-04 17:58 ` Christopher Faylor
1 sibling, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 17:43 UTC (permalink / raw)
To: me; +Cc: gdb-patches
> Date: Wed, 4 May 2005 10:55:35 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> Has anyone actually confirmed that gcc will put \abc or x:abc in source
> files?
I did (as I told elsewhere in this thread).
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 17:43 ` Eli Zaretskii
@ 2005-05-04 17:58 ` Christopher Faylor
2005-05-04 18:29 ` Eli Zaretskii
2005-05-04 20:39 ` Eli Zaretskii
0 siblings, 2 replies; 103+ messages in thread
From: Christopher Faylor @ 2005-05-04 17:58 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Wed, May 04, 2005 at 01:43:21PM -0400, Eli Zaretskii wrote:
>> Date: Wed, 4 May 2005 10:55:35 -0400
>> From: Christopher Faylor <me@cgf.cx>
>>
>> Has anyone actually confirmed that gcc will put \abc or x:abc in source
>> files?
>
>I did (as I told elsewhere in this thread).
Sorry, I joined the discussion in this thread only after I noticed that
you were wondering if windows had a realpath or canonicalize_file_name.
I have now read most of the responses from you and, so far, I've only
seen "I think I've seen" or "gcc can do this in some cases".
Nevertheless, I think it is irrelevant what could possibly show up
in debug info since it is possible to convert everything into the
x:\y or \\x\y form by using libiberty's lrealpath. That
would reduce the regex for an absolute path on windows to:
[a-zA-Z]:\\.*\|\\\\[^\\][^\\]*\\[^\\].*
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 17:58 ` Christopher Faylor
@ 2005-05-04 18:29 ` Eli Zaretskii
2005-05-04 20:39 ` Eli Zaretskii
1 sibling, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 18:29 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 13:58:02 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> Nevertheless, I think it is irrelevant what could possibly show up
> in debug info since it is possible to convert everything into the
> x:\y or \\x\y form by using libiberty's lrealpath. That
> would reduce the regex for an absolute path on windows to:
>
> [a-zA-Z]:\\.*\|\\\\[^\\][^\\]*\\[^\\].*
I think it's not needed, but if you disagree, it's okay with me to
change the regex in that test.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 17:58 ` Christopher Faylor
2005-05-04 18:29 ` Eli Zaretskii
@ 2005-05-04 20:39 ` Eli Zaretskii
2005-05-04 23:34 ` Christopher Faylor
1 sibling, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 20:39 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 13:58:02 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> Nevertheless, I think it is irrelevant what could possibly show up
> in debug info since it is possible to convert everything into the
> x:\y or \\x\y form by using libiberty's lrealpath. That
> would reduce the regex for an absolute path on windows to:
>
> [a-zA-Z]:\\.*\|\\\\[^\\][^\\]*\\[^\\].*
This will fail UNCs, btw. So I think you should at least allow for
two consecutive backslashes at the beginning.
Also, I think lrealpath is the wrong place for converting everything
to backslashes, since it presumably is (or is intended to be) used in
many programs ported from Unix or GNU/Linux, and those programs
tolerate backslashes much less well than they do forward slashes. If
at all, convert everything to forward slashes.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 20:39 ` Eli Zaretskii
@ 2005-05-04 23:34 ` Christopher Faylor
2005-05-05 4:08 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Christopher Faylor @ 2005-05-04 23:34 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Wed, May 04, 2005 at 11:37:21PM +0300, Eli Zaretskii wrote:
>> Date: Wed, 4 May 2005 13:58:02 -0400
>> From: Christopher Faylor <me@cgf.cx>
>>
>> Nevertheless, I think it is irrelevant what could possibly show up
>> in debug info since it is possible to convert everything into the
>> x:\y or \\x\y form by using libiberty's lrealpath. That
>> would reduce the regex for an absolute path on windows to:
>>
>> [a-zA-Z]:\\.*\|\\\\[^\\][^\\]*\\[^\\].*
>
>This will fail UNCs, btw. So I think you should at least allow for
>two consecutive backslashes at the beginning.
That is what is supposed to be happening on the right side of the |.
I'm assuming that there won't be any of the strange \\.\ or \\?\
>Also, I think lrealpath is the wrong place for converting everything
>to backslashes, since it presumably is (or is intended to be) used in
>many programs ported from Unix or GNU/Linux, and those programs
>tolerate backslashes much less well than they do forward slashes. If
>at all, convert everything to forward slashes.
But lrealpath is presumably used in the gcc and binutils mingw ports
isn't it?
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 23:34 ` Christopher Faylor
@ 2005-05-05 4:08 ` Eli Zaretskii
0 siblings, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-05 4:08 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 19:34:11 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> But lrealpath is presumably used in the gcc and binutils mingw ports
> isn't it?
I don't know. But even if it does, I suggest to change the Windows
branch to produce forward slashes. Trouble will happen when you pass
the result to some shell command and the shell happens to be Bash.
It's not safe, so it's not good engineering, IMHO.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 4:27 ` Eli Zaretskii
2005-05-04 11:48 ` Bob Rossi
@ 2005-05-04 13:45 ` Daniel Jacobowitz
2005-05-04 20:20 ` Eli Zaretskii
2005-05-04 14:52 ` Christopher Faylor
2 siblings, 1 reply; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-04 13:45 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Wed, May 04, 2005 at 07:24:47AM +0300, Eli Zaretskii wrote:
> > Date: Tue, 3 May 2005 17:39:11 -0400
> > From: Christopher Faylor <me@cgf.cx>
> >
> > Cygwin has realpath and Windows has an equivalent function. AFAIK, it
> > will correctly translate \abc to x:\abc.
>
> No, it will _incorrectly_ translate them: the current drive and
> directory that are in effect when we call these functions are _not_
> what they were when the compiler compiled the source and recorded its
> file name in the debug info.
Eli, this is inconsistent with the rest of the world. In the rest of
the world, realpath() and canonicalize_file_name() call getcwd() (or
the operating system's equivalent function). Can you explain to us why
it is correct for other OSes to do this resolution in xfullpath (or
wherever else), and for DJGPP not to?
> > Anyway, it seems like the mingw port should be using GetFullPathName()
> > in gdb_realpath().
>
> I don't see this in my sandbox.
It doesn't. It should. More precisely, gdb_realpath should be removed
and replaced with libiberty's lrealpath(). I was under the impression
that I had done this when I added the function to libiberty, but
obviously I forgot.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 13:45 ` Daniel Jacobowitz
@ 2005-05-04 20:20 ` Eli Zaretskii
2005-05-04 20:30 ` Daniel Jacobowitz
0 siblings, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 20:20 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 09:45:38 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> > No, it will _incorrectly_ translate them: the current drive and
> > directory that are in effect when we call these functions are _not_
> > what they were when the compiler compiled the source and recorded its
> > file name in the debug info.
>
> Eli, this is inconsistent with the rest of the world. In the rest of
> the world, realpath() and canonicalize_file_name() call getcwd() (or
> the operating system's equivalent function). Can you explain to us why
> it is correct for other OSes to do this resolution in xfullpath (or
> wherever else), and for DJGPP not to?
We are again talking past each other. What you describe is correct
for all platforms, including DJGPP and Windows, but not in the
specific circumstances which led us to this endless thread, which is
to find a fully qualified file name using the information recorded in
the debug info.
The primary use of realpath and its ilk is when we need to take apart
the absolute file name, or see if two file names belong to the same
directory, or some other similar test. In these cases, we know that
cwd is the same for both file names, and making file names absolute
simplifies the rest of the code in these cases. But that is not our
situation.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 20:20 ` Eli Zaretskii
@ 2005-05-04 20:30 ` Daniel Jacobowitz
2005-05-04 21:24 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-04 20:30 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
On Wed, May 04, 2005 at 11:17:23PM +0300, Eli Zaretskii wrote:
> > Date: Wed, 4 May 2005 09:45:38 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> > Cc: gdb-patches@sources.redhat.com
> >
> > > No, it will _incorrectly_ translate them: the current drive and
> > > directory that are in effect when we call these functions are _not_
> > > what they were when the compiler compiled the source and recorded its
> > > file name in the debug info.
> >
> > Eli, this is inconsistent with the rest of the world. In the rest of
> > the world, realpath() and canonicalize_file_name() call getcwd() (or
> > the operating system's equivalent function). Can you explain to us why
> > it is correct for other OSes to do this resolution in xfullpath (or
> > wherever else), and for DJGPP not to?
>
> We are again talking past each other. What you describe is correct
> for all platforms, including DJGPP and Windows, but not in the
> specific circumstances which led us to this endless thread, which is
> to find a fully qualified file name using the information recorded in
> the debug info.
This is where you have completely lost me. I need for you to explain
why it is OK for the "fully qualified file name" not to be an absolute
path on DJGPP.
If we successfully find a file, openp will already call xfullpath,
after optionally prepending the current notion of current directory (in
the correct circumstances, i.e. !IS_ABSOLUTE_PATH, though I have begun
to think that that macro is seriously misnamed).
xfullpath calls gdb_realpath. At the moment that doesn't include the
MinGW32 bits to call resolve Windows paths to include the correct
drive/directory. That's simply an oversight; when this discussion is
over, I intend to fix it by using the implementation from libiberty,
which GCC already uses.
So, with that fix and on any system but DJGPP, the path returned in
*FILENAME_OPENED will always be canonicalized via realpath, with the
exception of the basename, as described in the comments around the
call.
So why shouldn't we do this same thing for DJGPP? If you'll tell me
the appropriate DJGPP interfaces and test the result I'll even write
the code myself; I can't do it from scratch since I have no hardware
set up to deal with DJGPP.
With that change, the special case code in xfullpath to turn "d:foo"
into "d:.\foo" (which I do understand and see the justification for)
could almost be replaced by an assertion that the path never looks like
"d:foo". In fact it can't; that's because some callers of xfullpath
may pass filenames that don't exist, so we may not get an absolute path
back from realpath.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 20:30 ` Daniel Jacobowitz
@ 2005-05-04 21:24 ` Eli Zaretskii
0 siblings, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 21:24 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 16:29:59 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sources.redhat.com
>
> This is where you have completely lost me. I need for you to explain
> why it is OK for the "fully qualified file name" not to be an absolute
> path on DJGPP.
Because of 2 reasons: (1) there's nothing wrong with d:foo, so
resolving the cwd on drive d: would mean gratuitous DOS-specific code
in a general-purpose source file, which I try to avoid; and (2) because
years I spent porting dozens of GNU packages to DJGPP led me to this
engineering decision which I found to work well in _all_ of the many
packages I ported. I'm not going to go back and recollect all of the
complicated situations and reiterate hundreds of hours of testing and
debugging, just so that openp and xfullpath will look logically
perfect to an outsider.
> If we successfully find a file, openp will already call xfullpath,
Please let's not forget that xfullpath and gdb_realpath are also
functions on their own. Not every file they deal with is going to be
opened with openp. Thus, some transformations of the file names is
not going to be positively validated by opening the resulting name.
> after optionally prepending the current notion of current directory (in
> the correct circumstances, i.e. !IS_ABSOLUTE_PATH, though I have begun
> to think that that macro is seriously misnamed).
See, that's exactly what I was afraid of: first, you want to make the
regex right, then you question functions that worked for years since I
fixed them, then you question IS_ABSOLUTE_PATH which works for I don't
remember how much time in I don't remember how many ports I made...
IS_ABSOLUTE_PATH says that d:foo is an absolute file name for a very
good reason: that non-absolute file names are treated in a way that is
blatantly incorrect on Windows (e.g., by prepending the cwd to them).
If you want a better name, think of it as ISNT_NOT_ABSOLUTE_PATH,
okay?
> xfullpath calls gdb_realpath. At the moment that doesn't include the
> MinGW32 bits to call resolve Windows paths to include the correct
> drive/directory. That's simply an oversight; when this discussion is
> over, I intend to fix it by using the implementation from libiberty,
> which GCC already uses.
Beware: you might break things by this change, since currently
lrealpath returns file names with backslashes, which is not a good
idea in a program that came from the Posix world.
And even after that, there will be problems with UNCs and other
subtleties.
> With that change, the special case code in xfullpath to turn "d:foo"
> into "d:.\foo" (which I do understand and see the justification for)
d:./foo has the same issues you didn't like in d:foo: it still doesn't
resolve the current directory. So I don't understand why it is better
for you.
The reason that d:foo is converted to d:./foo is that the rest of the
code needs at least one slash in the file name. So we supply one.
Adding a syscall to find the cwd on drive d: would be an unjustified
complication: another syscall, the need to deal with errors, etc.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 4:27 ` Eli Zaretskii
2005-05-04 11:48 ` Bob Rossi
2005-05-04 13:45 ` Daniel Jacobowitz
@ 2005-05-04 14:52 ` Christopher Faylor
2005-05-04 17:48 ` Eli Zaretskii
2 siblings, 1 reply; 103+ messages in thread
From: Christopher Faylor @ 2005-05-04 14:52 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Wed, May 04, 2005 at 07:24:47AM +0300, Eli Zaretskii wrote:
>> Date: Tue, 3 May 2005 17:39:11 -0400
>> From: Christopher Faylor <me@cgf.cx>
>>
>> Cygwin has realpath and Windows has an equivalent function. AFAIK, it
>> will correctly translate \abc to x:\abc.
>
>No, it will _incorrectly_ translate them: the current drive and
>directory that are in effect when we call these functions are _not_
>what they were when the compiler compiled the source and recorded its
>file name in the debug info.
>
>> I don't know what it will do with d:foo. NT+ shells treat that as
>> "the current directory on drive d:" but that's just something that
>> is special to a shell.
>
>Not true: the notion of a current directory on drive d: is maintained
>by the OS.
The current directory on another drive is maintained by the "OS" only on
Windows 9x variants and on MS-DOS. Otherwise the current directory is
stored in hidden environment variables by the shell. XP/NT and 9x
differ in this regard.
>There's a special OS data structure where it holds the current
>directory for each drive. Also, unlike on Unix, the current directory
>on each drive is globally in effect for all the processes that run in
>the current VM.
This is true only on 9x/Me (and MS-DOS).
>> Probably it should be resolved as "d:\foo".
>
>Please! I'm gonna cry! you are suggesting to revert the code that took
>hard work to get right! openp used to do d:foo -> d:/foo, but that
>was blatantly wrong and caused bugs. Let's not go that way just
>because some test case doesn't seem 100% right!
>
>I am frustrated by my evident inability to communicate to you all the
>simple truth: openp IS OKAY, IT DOESN'T NEED ANY FIXING!
I just built a simple test case (tm) using a mingw version of lrealpath
from libiberty. It fully canonicalizes the path and it even works on XP,
so, apparently, GetFullPathName understand the hidden environment variables.
So, if I type:
myrealpath d:foo
and the cwd on d: is set to \tmp:
c:\>./myrealpath d:foo
d:\tmp\foo
c:\>env - ./myrealpath d:foo
d:\foo
So, AFAICT, libiberty is working fine and it should be safe to expect
that canonicalized names on windows will either be in the form of
x:\y\z or \\x\y\z if this is used.
>> Hopefully the Windows
>> routine for producing absolute paths will do something sensical.
>
>They won't; see above.
>
>> Anyway, it seems like the mingw port should be using GetFullPathName()
>> in gdb_realpath().
>
>I don't see this in my sandbox.
I don't see any calls to lrealpath in gdb either. So, it seems like
gdb isn't using this functionality but maybe it should be.
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 14:52 ` Christopher Faylor
@ 2005-05-04 17:48 ` Eli Zaretskii
2005-05-04 18:03 ` Christopher Faylor
0 siblings, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 17:48 UTC (permalink / raw)
To: me; +Cc: gdb-patches
> Date: Wed, 4 May 2005 10:52:00 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> >Not true: the notion of a current directory on drive d: is maintained
> >by the OS.
>
> The current directory on another drive is maintained by the "OS" only on
> Windows 9x variants and on MS-DOS.
Okay, but we still support those versions of Windows, right?
> c:\>./myrealpath d:foo
> d:\tmp\foo
> c:\>env - ./myrealpath d:foo
> d:\foo
>
> So, AFAICT, libiberty is working fine and it should be safe to expect
> that canonicalized names on windows will either be in the form of
> x:\y\z or \\x\y\z if this is used.
Yes, libiberty is working fine, except that GDB is not using
lrealpath, AFAIK.
And then the question is whether it is correct to resolve d:foo
etc. assuming thath the current drive and directories are identical to
what they were when the source was compiled. Many projects use
recursive Makefiles that cause the compiler change directories at
will.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 17:48 ` Eli Zaretskii
@ 2005-05-04 18:03 ` Christopher Faylor
2005-05-04 18:26 ` Eli Zaretskii
0 siblings, 1 reply; 103+ messages in thread
From: Christopher Faylor @ 2005-05-04 18:03 UTC (permalink / raw)
To: gdb-patches
On Wed, May 04, 2005 at 01:47:47PM -0400, Eli Zaretskii wrote:
>> Date: Wed, 4 May 2005 10:52:00 -0400
>> From: Christopher Faylor <me@cgf.cx>
>>
>> >Not true: the notion of a current directory on drive d: is maintained
>> >by the OS.
>>
>> The current directory on another drive is maintained by the "OS" only on
>> Windows 9x variants and on MS-DOS.
>
>Okay, but we still support those versions of Windows, right?
Yes, we do. I was clarifying your global statement.
>> c:\>./myrealpath d:foo
>> d:\tmp\foo
>> c:\>env - ./myrealpath d:foo
>> d:\foo
>>
>> So, AFAICT, libiberty is working fine and it should be safe to expect
>> that canonicalized names on windows will either be in the form of
>> x:\y\z or \\x\y\z if this is used.
>>[snip]
>>I don't see any calls to lrealpath in gdb either. So, it seems like
>>gdb isn't using this functionality but maybe it should be.
>
>Yes, libiberty is working fine, except that GDB is not using
>lrealpath, AFAIK.
"So, it seems like gdb isn't using this functionality but maybe it
should be."
>And then the question is whether it is correct to resolve d:foo
>etc. assuming thath the current drive and directories are identical to
>what they were when the source was compiled. Many projects use
>recursive Makefiles that cause the compiler change directories at
>will.
I thought you were advocating that d:foo means "the current directory on
drive d:" no matter what it might have meant at compile time. I don't
see that we have any choice but to do anything but that and, apparently,
that is what lrealpath will do, as long as the environment is not
perturbed on XP.
So, why not just use lrealpath?
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-04 18:03 ` Christopher Faylor
@ 2005-05-04 18:26 ` Eli Zaretskii
0 siblings, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 18:26 UTC (permalink / raw)
To: gdb-patches
> Date: Wed, 4 May 2005 14:03:03 -0400
> From: Christopher Faylor <me@cgf.cx>
>
> >And then the question is whether it is correct to resolve d:foo
> >etc. assuming thath the current drive and directories are identical to
> >what they were when the source was compiled. Many projects use
> >recursive Makefiles that cause the compiler change directories at
> >will.
>
> I thought you were advocating that d:foo means "the current directory on
> drive d:" no matter what it might have meant at compile time. I don't
> see that we have any choice but to do anything but that and, apparently,
> that is what lrealpath will do, as long as the environment is not
> perturbed on XP.
We have a choice: leave it as it is now.
> So, why not just use lrealpath?
Because it might be wrong, if the environment _was_ perturbed (as it
frequently is, since the compiletr could have been in a totally
different directory when it recorded d:foo).
But if I still fail to convince you and others, go ahead and use
lrealpath, since at least it doesn't do anything for the DJGPP port,
so things will remain there as they are now.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 19:36 ` Eli Zaretskii
2005-05-03 19:49 ` Daniel Jacobowitz
2005-05-03 19:57 ` Bob Rossi
@ 2005-05-03 22:50 ` Bob Rossi
2005-05-04 4:04 ` Eli Zaretskii
2 siblings, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-03 22:50 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
> > What should the front end receiving this information do with it?
>
> It should do the best it can: try to access the file under the
> assumption that the missing drive in "\abc" is the current one and the
> missing directory in d:foo is the current directory on drive d:
> (which could be different from the current drive). If that works, we
> win; if not, tough. The failure case is the same situation as when
> the front end receives a file name which does not exist on the machine
> (e.g., a module from a library that was compiled on a different
> computer): GDB tries its best to find the file, but if the directory
> cannot be found by any algorithm known to us, we give up. What else
> can we do?
In the second case here, "when the front end receives a file name which
does not exist on the machine ..."
The comment for source.c:openp states that the FILENAME_OPENED output
variable will always start with a "/". So, I'm assuming from what we've
talked about, that this comment is wrong.
I just realized that filename_opened is only populated if the
variable "filename" was opened successfully by GDB. Then filename_opened
is generated by doing xfullpath magic on the variable filename. The bad
thing about that, is that GDB never attempts to open filename_opened to
make sure that the file is there and is valid.
Should openp attempt to open filename_opened to make sure that it is
there? That would be one more step in the direction of making sure that
the fullname is at least valid on the disk. That way, absolute or not,
the front end will be able to rely on the fullname file being on the
disk.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-03 22:50 ` Bob Rossi
@ 2005-05-04 4:04 ` Eli Zaretskii
0 siblings, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-04 4:04 UTC (permalink / raw)
To: gdb-patches
> Date: Tue, 3 May 2005 18:50:12 -0400
> From: Bob Rossi <bob@brasko.net>
> Cc: gdb-patches@sources.redhat.com
>
> The comment for source.c:openp states that the FILENAME_OPENED output
> variable will always start with a "/". So, I'm assuming from what we've
> talked about, that this comment is wrong.
Well, of course it's wrong!
> Should openp attempt to open filename_opened to make sure that it is
> there?
openp is fine; let's not fix what isn't broken.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-01 18:24 ` Eli Zaretskii
2005-05-01 18:34 ` Bob Rossi
2005-05-02 0:54 ` Bob Rossi
@ 2005-05-05 17:20 ` Bob Rossi
2005-05-05 18:04 ` Eli Zaretskii
2005-05-05 19:18 ` Christopher Faylor
2 siblings, 2 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-05 17:20 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Dennis Brueni, gdb-patches
> The proper regexp should be something like
>
> \([A-z]:\)?[/\\].*basics.c
I sent this question to Eli, but thought others might be interested.
The regex above woks on /.* and d:\.* and \\.* and \.* but it doesn't
work on d:.*. I can't see a simple way to add that last case. Does
anyone else?
This is the only way I could solve the last case,
\([A-z]:[^\].*\)|\([A-z]:\)?[/\\].*basics.c
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-05 17:20 ` Bob Rossi
@ 2005-05-05 18:04 ` Eli Zaretskii
2005-05-05 19:18 ` Christopher Faylor
1 sibling, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-05-05 18:04 UTC (permalink / raw)
To: Dennis Brueni, gdb-patches
> Date: Thu, 5 May 2005 13:19:10 -0400
> From: Bob Rossi <bob@brasko.net>
> Cc: Dennis Brueni <dbrueni@slickedit.com>, gdb-patches@sources.redhat.com
>
> > The proper regexp should be something like
> >
> > \([A-z]:\)?[/\\].*basics.c
>
> I sent this question to Eli, but thought others might be interested.
> The regex above woks on /.* and d:\.* and \\.* and \.* but it doesn't
> work on d:.*. I can't see a simple way to add that last case. Does
> anyone else?
>
> This is the only way I could solve the last case,
> \([A-z]:[^\].*\)|\([A-z]:\)?[/\\].*basics.c
How about
\(\([A-z]:.*\)\|[/\\]\).*basics.c
?
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-05 17:20 ` Bob Rossi
2005-05-05 18:04 ` Eli Zaretskii
@ 2005-05-05 19:18 ` Christopher Faylor
2005-05-05 23:53 ` Bob Rossi
1 sibling, 1 reply; 103+ messages in thread
From: Christopher Faylor @ 2005-05-05 19:18 UTC (permalink / raw)
To: Dennis Brueni, gdb-patches, Eli Zaretskii
On Thu, May 05, 2005 at 01:19:10PM -0400, Bob Rossi wrote:
>> The proper regexp should be something like
>>
>> \([A-z]:\)?[/\\].*basics.c
>
>I sent this question to Eli, but thought others might be interested.
>The regex above woks on /.* and d:\.* and \\.* and \.* but it doesn't
>work on d:.*. I can't see a simple way to add that last case. Does
>anyone else?
>
>This is the only way I could solve the last case,
> \([A-z]:[^\].*\)|\([A-z]:\)?[/\\].*basics.c
Maybe it's a minor nit but \\.* is not strictly correct for a UNC.
With, \\X\y, the X is not optional. So there has to be at least
three backslashes in a UNC path, e.g, \\\\[^\\][^\\]*\..*
cgf
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-05 19:18 ` Christopher Faylor
@ 2005-05-05 23:53 ` Bob Rossi
0 siblings, 0 replies; 103+ messages in thread
From: Bob Rossi @ 2005-05-05 23:53 UTC (permalink / raw)
To: Dennis Brueni, gdb-patches, Eli Zaretskii
On Thu, May 05, 2005 at 03:17:54PM -0400, Christopher Faylor wrote:
> On Thu, May 05, 2005 at 01:19:10PM -0400, Bob Rossi wrote:
> >> The proper regexp should be something like
> >>
> >> \([A-z]:\)?[/\\].*basics.c
> >
> >I sent this question to Eli, but thought others might be interested.
> >The regex above woks on /.* and d:\.* and \\.* and \.* but it doesn't
> >work on d:.*. I can't see a simple way to add that last case. Does
> >anyone else?
> >
> >This is the only way I could solve the last case,
> > \([A-z]:[^\].*\)|\([A-z]:\)?[/\\].*basics.c
>
> Maybe it's a minor nit but \\.* is not strictly correct for a UNC.
> With, \\X\y, the X is not optional. So there has to be at least
> three backslashes in a UNC path, e.g, \\\\[^\\][^\\]*\..*
Thanks, I'll make sure to incorporate this.
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-01 2:19 ` Bob Rossi
2005-05-01 18:24 ` Eli Zaretskii
@ 2005-05-05 16:22 ` Bob Rossi
2005-05-05 16:26 ` Daniel Jacobowitz
1 sibling, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-05 16:22 UTC (permalink / raw)
To: gdb-patches; +Cc: Daniel Jacobowitz
> Well, I do understand your point here but I'd prefer that all fullname
> checks ensure that the path be absolute. The more I think about it, I
> should probably make a variable called 'fullname_output' in the
> testsuite that contains the regex output of a fullname. How does this
> sound?
>
> > > As promised, here is an updated patch set with the regex
> > > changes you suggested, plus checking for a little more directory
> > > information with respect to the fullname path, to the extent
> > > that we can be sure the test case still passes in all environments.
> >
> > I don't think adding fullname= to the -i=mi2 output is a good idea; MI2
> > is supposed to be stable. Bob, what do you think? Anyone else?
>
> As far as i understand, it is acceptable to add new fields to a stable
> version of MI. It is the parsers responsibility to ignore MI fields that
> they are unfamiliar with. I also understand that it is acceptable to add
> new commands to an MI version. Making either of the 2 changes above does
> not effect the version number of the MI release (AFAIK).
>
> With that said, I'm not quite sure what model Andrew had in mind
> when releasing the MI versions. Here is 2 possibilities,
>
> Originally there is mi-. Once it becomes stable it is released as mi2-.
> mi2- is never touched again, accept for bug fixes. All development and
> new features is done on mi-. When mi- becomes stable again it is turned
> into mi3-.
>
> Originally there is mi-. Once it becomes stable it is released as mi2-.
> Any changes compatible with the MI2 protocol should be merged into the
> mi- and mi2- testcases. Changes that are not compatible with mi2 should
> be merged into mi-. When mi- becomes stable enough it could be moved
> into mi3-.
>
> I prefer the second model. I think it is more flexible and would allow
> for features to get into the MI protocol faster.
Ping, any decision on this? I need to know if I should be modifing mi2
testcases or just mi?
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-05 16:22 ` Bob Rossi
@ 2005-05-05 16:26 ` Daniel Jacobowitz
2005-05-05 16:46 ` Bob Rossi
0 siblings, 1 reply; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-05 16:26 UTC (permalink / raw)
To: gdb-patches
On Thu, May 05, 2005 at 12:22:33PM -0400, Bob Rossi wrote:
> > As far as i understand, it is acceptable to add new fields to a stable
> > version of MI. It is the parsers responsibility to ignore MI fields that
> > they are unfamiliar with. I also understand that it is acceptable to add
> > new commands to an MI version. Making either of the 2 changes above does
> > not effect the version number of the MI release (AFAIK).
> >
> > With that said, I'm not quite sure what model Andrew had in mind
> > when releasing the MI versions. Here is 2 possibilities,
> >
> > Originally there is mi-. Once it becomes stable it is released as mi2-.
> > mi2- is never touched again, accept for bug fixes. All development and
> > new features is done on mi-. When mi- becomes stable again it is turned
> > into mi3-.
> >
> > Originally there is mi-. Once it becomes stable it is released as mi2-.
> > Any changes compatible with the MI2 protocol should be merged into the
> > mi- and mi2- testcases. Changes that are not compatible with mi2 should
> > be merged into mi-. When mi- becomes stable enough it could be moved
> > into mi3-.
> >
> > I prefer the second model. I think it is more flexible and would allow
> > for features to get into the MI protocol faster.
>
> Ping, any decision on this? I need to know if I should be modifing mi2
> testcases or just mi?
I had no objection to your explanation. I thought you were just adding
the regex and I was going to update the testcases?
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-05 16:26 ` Daniel Jacobowitz
@ 2005-05-05 16:46 ` Bob Rossi
2005-05-05 17:17 ` Daniel Jacobowitz
0 siblings, 1 reply; 103+ messages in thread
From: Bob Rossi @ 2005-05-05 16:46 UTC (permalink / raw)
To: gdb-patches
On Thu, May 05, 2005 at 12:25:44PM -0400, Daniel Jacobowitz wrote:
> On Thu, May 05, 2005 at 12:22:33PM -0400, Bob Rossi wrote:
> > > As far as i understand, it is acceptable to add new fields to a stable
> > > version of MI. It is the parsers responsibility to ignore MI fields that
> > > they are unfamiliar with. I also understand that it is acceptable to add
> > > new commands to an MI version. Making either of the 2 changes above does
> > > not effect the version number of the MI release (AFAIK).
> > >
> > > With that said, I'm not quite sure what model Andrew had in mind
> > > when releasing the MI versions. Here is 2 possibilities,
> > >
> > > Originally there is mi-. Once it becomes stable it is released as mi2-.
> > > mi2- is never touched again, accept for bug fixes. All development and
> > > new features is done on mi-. When mi- becomes stable again it is turned
> > > into mi3-.
> > >
> > > Originally there is mi-. Once it becomes stable it is released as mi2-.
> > > Any changes compatible with the MI2 protocol should be merged into the
> > > mi- and mi2- testcases. Changes that are not compatible with mi2 should
> > > be merged into mi-. When mi- becomes stable enough it could be moved
> > > into mi3-.
> > >
> > > I prefer the second model. I think it is more flexible and would allow
> > > for features to get into the MI protocol faster.
> >
> > Ping, any decision on this? I need to know if I should be modifing mi2
> > testcases or just mi?
>
> I had no objection to your explanation. I thought you were just adding
> the regex and I was going to update the testcases?
O, I see. I was going to add the regex and update mi-file.exp. However,
I noticed that mi2-file.exp also had a fullname field and realized I
didn't know if the mi2 files were going to be modified.
I'm looking now, and just realized that Andrew didn't let me modify
mi2-file.exp to add -file-list-exec-source-files even though it was
compatible with the MI2 protocol. He only wanted me to add it to
mi-file.exp. So it looks like your initial idea was the philosophy
Andrew was taking, which is: MI2 is stable and it should not be modified.
I am going to take that approach with this patch.
I really wish the MI release philosophy could be spelled out some where.
It seems as if Andrew considered MI versions to not be at the protocol
level. For instance, MI2 and MI3 could both use the same protocol, except
that MI3 would have more functions and fields than MI2. Does this sound
correct to you? This is part of the confusion I had when trying to figure
out how GDB would handle multiple MI protocols.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-05-05 16:46 ` Bob Rossi
@ 2005-05-05 17:17 ` Daniel Jacobowitz
0 siblings, 0 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-05 17:17 UTC (permalink / raw)
To: gdb-patches
On Thu, May 05, 2005 at 12:45:43PM -0400, Bob Rossi wrote:
> O, I see. I was going to add the regex and update mi-file.exp. However,
> I noticed that mi2-file.exp also had a fullname field and realized I
> didn't know if the mi2 files were going to be modified.
Oh, those testcases. Go ahead.
> I'm looking now, and just realized that Andrew didn't let me modify
> mi2-file.exp to add -file-list-exec-source-files even though it was
> compatible with the MI2 protocol. He only wanted me to add it to
> mi-file.exp. So it looks like your initial idea was the philosophy
> Andrew was taking, which is: MI2 is stable and it should not be modified.
> I am going to take that approach with this patch.
The one doesn't follow from the other. -file-list-exec-source-files
shouldn't be tested as a part of MI2, because MI2 did not include it at
its release.
However, I don't see a problem with allowing extra fields, assuming
that you are right about frontends being accepting of this. It isn't
clearly spelled out in the manual, one way or another.
> I really wish the MI release philosophy could be spelled out some where.
> It seems as if Andrew considered MI versions to not be at the protocol
> level. For instance, MI2 and MI3 could both use the same protocol, except
> that MI3 would have more functions and fields than MI2. Does this sound
> correct to you? This is part of the confusion I had when trying to figure
> out how GDB would handle multiple MI protocols.
I'm not the one you should be asking since I don't think all the
multiple protocols work is/was useful. The model just has too many
question marks in it when you consider all those busy beavers
developing on the _rest_ of GDB. You're lucky if you get even one MI
protocol to work.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-04-30 19:18 ` Daniel Jacobowitz
2005-05-01 2:19 ` Bob Rossi
@ 2005-05-18 4:44 ` Daniel Jacobowitz
1 sibling, 0 replies; 103+ messages in thread
From: Daniel Jacobowitz @ 2005-05-18 4:44 UTC (permalink / raw)
To: Dennis Brueni, gdb-patches, bob
On Sat, Apr 30, 2005 at 03:17:55PM -0400, Daniel Jacobowitz wrote:
> On Fri, Apr 01, 2005 at 02:13:33PM -0500, Dennis Brueni wrote:
> > As promised, here is an updated patch set with the regex
> > changes you suggested, plus checking for a little more directory
> > information with respect to the fullname path, to the extent
> > that we can be sure the test case still passes in all environments.
> A couple administrative things about submitting GDB patches:
> You don't need to redo the patch; I'll take care of it once my first
> questions are resolved.
Which, eventually, they were. I have committed this revised version of
the patch; that almost completely resolves this thread (I have one
other issue to follow up on later).
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-05-17 Daniel Jacobowitz <dan@codesourcery.com>
Dennis Brueni <dennis@slickedit.com>
* stack.c (print_frame): In MI mode, output a fullname attribute
with the stack frame.
2005-05-17 Daniel Jacobowitz <dan@codesourcery.com>
Dennis Brueni <dennis@slickedit.com>
* gdb.texinfo (GDB/MI Breakpoint Table Commands)
(GDB/MI Data Manipulation, GDB/MI Program Control)
(GDB/MI Stack Manipulation): Update examples to include the fullname
attribute in stack frames.
2005-05-17 Daniel Jacobowitz <dan@codesourcery.com>
Dennis Brueni <dennis@slickedit.com>
* gdb.mi/mi-cli.exp, gdb.mi/mi-return.exp, gdb.mi/mi-stack.exp,
gdb.mi/mi-stepi.exp, gdb.mi/mi-syn-frame.exp, gdb.mi/mi-until.exp,
gdb.mi/mi-var-display.exp, gdb.mi/mi-watch.exp, gdb.mi/mi2-cli.exp,
gdb.mi/mi2-return.exp, gdb.mi/mi2-stack.exp,
gdb.mi/mi2-syn-frame.exp, gdb.mi/mi2-until.exp,
gdb.mi/mi2-var-display.exp: Expect fullname field in stack frames.
* lib/mi-support.exp (mi_runto, mi_execute_to_helper): Likewise.
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.131
diff -u -p -r1.131 stack.c
--- stack.c 12 May 2005 20:21:17 -0000 1.131
+++ stack.c 18 May 2005 03:39:14 -0000
@@ -680,6 +680,12 @@ print_frame (struct frame_info *fi,
ui_out_text (uiout, " at ");
annotate_frame_source_file ();
ui_out_field_string (uiout, "file", sal.symtab->filename);
+ if (ui_out_is_mi_like_p (uiout))
+ {
+ const char *fullname = symtab_to_fullname (sal.symtab);
+ if (fullname != NULL)
+ ui_out_field_string (uiout, "fullname", fullname);
+ }
annotate_frame_source_file_end ();
ui_out_text (uiout, ":");
annotate_frame_source_line ();
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.253
diff -u -p -r1.253 gdb.texinfo
--- doc/gdb.texinfo 12 May 2005 09:05:42 -0000 1.253
+++ doc/gdb.texinfo 18 May 2005 03:39:18 -0000
@@ -17431,7 +17431,8 @@ Setting a watchpoint on a variable in th
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
value=@{old="-268439212",new="55"@},
-frame=@{func="main",args=[],file="recursive2.c",line="5"@}
+frame=@{func="main",args=[],file="recursive2.c",
+fullname="/home/foo/bar/devo/myproject/recursive2.c",line="5"@}
(@value{GDBP})
@end smallexample
@@ -17449,14 +17450,16 @@ for the watchpoint going out of scope.
^done,reason="watchpoint-trigger",
wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
@@ -17488,7 +17491,8 @@ enabled="y",addr="",what="C",times="0"@}
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
@@ -17509,7 +17513,8 @@ enabled="y",addr="",what="C",times="-5"@
^done,reason="watchpoint-scope",wpnum="2",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
@@ -17744,7 +17749,7 @@ On a PPC MBX board:
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
-args=[],file="try.c",line="5"@}
+args=[],file="try.c",fullname="/home/foo/bar/devo/myproject/try.c",line="5"@}
(@value{GDBP})
-data-list-changed-registers
^done,changed-registers=["0","1","2","4","5","6","7","8","9",
@@ -18351,7 +18356,7 @@ The corresponding @value{GDBN} correspon
(@value{GDBP})
@@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
-file="hello.c",line="13"@}
+file="hello.c",fullname="/home/foo/bar/devo/myproject/hello.c",line="13"@}
(@value{GDBP})
@end smallexample
@@ -18383,7 +18388,7 @@ Function returning @code{void}.
(@value{GDBP})
@@hello from foo
*stopped,reason="function-finished",frame=@{func="main",args=[],
-file="hello.c",line="7"@}
+file="hello.c",fullname="/home/foo/bar/devo/myproject/hello.c",line="7"@}
(@value{GDBP})
@end smallexample
@@ -18397,7 +18402,7 @@ value itself.
(@value{GDBP})
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
args=[@{name="a",value="1"],@{name="b",value="9"@}@},
-file="recursive2.c",line="14"@},
+file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
gdb-result-var="$1",return-value="0"
(@value{GDBP})
@end smallexample
@@ -18434,7 +18439,8 @@ The corresponding @value{GDBN} command i
222^done
(@value{GDBP})
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
-frame=@{addr="0x00010140",func="foo",args=[],file="try.c",line="13"@}
+frame=@{addr="0x00010140",func="foo",args=[],file="try.c",
+fullname="/home/foo/bar/devo/myproject/try.c",line="13"@}
(@value{GDBP})
(@value{GDBP})
@@ -18532,7 +18538,8 @@ file="../../../devo/gdb/testsuite/gdb.mi
(@value{GDBP})
000*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="callee4",args=[],
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
(@value{GDBP})
205-break-delete
205^done
@@ -18541,7 +18548,8 @@ file="../../../devo/gdb/testsuite/gdb.mi
111^done,frame=@{level="0",func="callee3",
args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
@@ -18574,7 +18582,8 @@ The corresponding @value{GDBN} command i
^running
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",
-frame=@{func="main",args=[],file="recursive2.c",line="4"@}
+frame=@{func="main",args=[],file="recursive2.c",
+fullname="/home/foo/bar/devo/myproject/recursive2.c",line="4"@}
(@value{GDBP})
@end smallexample
@@ -18627,7 +18636,8 @@ Stepping into a function:
(@value{GDBP})
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=[@{name="a",value="10"@},
-@{name="b",value="0"@}],file="recursive2.c",line="11"@}
+@{name="b",value="0"@}],file="recursive2.c",
+fullname="/home/foo/bar/devo/myproject/recursive2.c",line="11"@}
(@value{GDBP})
@end smallexample
@@ -18670,14 +18680,16 @@ The corresponding @value{GDBN} command i
(@value{GDBP})
*stopped,reason="end-stepping-range",
-frame=@{func="foo",args=[],file="try.c",line="10"@}
+frame=@{func="foo",args=[],file="try.c",
+fullname="/home/foo/bar/devo/myproject/try.c",line="10"@}
(@value{GDBP})
-exec-step-instruction
^running
(@value{GDBP})
*stopped,reason="end-stepping-range",
-frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",line="10"@}
+frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",
+fullname="/home/foo/bar/devo/myproject/try.c",line="10"@}
(@value{GDBP})
@end smallexample
@@ -18709,7 +18721,7 @@ The corresponding @value{GDBN} command i
(@value{GDBP})
x = 55
*stopped,reason="location-reached",frame=@{func="main",args=[],
-file="recursive2.c",line="6"@}
+file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="6"@}
(@value{GDBP})
@end smallexample
@@ -19209,15 +19221,20 @@ functionality of @samp{-stack-list-argum
^done,
stack=[
frame=@{level="0",addr="0x00010734",func="callee4",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
frame=@{level="1",addr="0x0001076c",func="callee3",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
frame=@{level="2",addr="0x0001078c",func="callee2",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
frame=@{level="3",addr="0x000107b4",func="callee1",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
frame=@{level="4",addr="0x000107e0",func="main",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
(@value{GDBP})
-stack-list-arguments 0
^done,
@@ -19299,29 +19316,29 @@ Full stack backtrace:
-stack-list-frames
^done,stack=
[frame=@{level="0",addr="0x0001076c",func="foo",
- file="recursive2.c",line="11"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="11"@},
frame=@{level="1",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="2",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="3",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="6",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="7",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="8",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="9",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="10",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="11",addr="0x00010738",func="main",
- file="recursive2.c",line="4"@}]
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="4"@}]
(@value{GDBP})
@end smallexample
@@ -19332,11 +19349,11 @@ Show frames between @var{low_frame} and
-stack-list-frames 3 5
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@},
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@}]
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
@@ -19347,7 +19364,7 @@ Show a single frame:
-stack-list-frames 3 3
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
- file="recursive2.c",line="14"@}]
+ file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
Index: testsuite/gdb.mi/mi-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-cli.exp,v
retrieving revision 1.3
diff -u -p -r1.3 mi-cli.exp
--- testsuite/gdb.mi/mi-cli.exp 15 Aug 2004 10:15:58 -0000 1.3
+++ testsuite/gdb.mi/mi-cli.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004, 2005 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
@@ -100,7 +100,7 @@ mi_gdb_test "-interpreter-exec console \
# # NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-continue" \
-# {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \
+# {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",fullname="${fullname_syntax}${srcfile}",line="8"\}} \
# "-interpreter-exec console \"continue to callee4\""
send_gdb "999-exec-continue\n"
gdb_expect {
@@ -161,11 +161,11 @@ mi_gdb_test "600-break-insert -t basics.
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
-# {.*\*stopped.*,file=".*basics.c",line="$line_main_hello"\}} \
+# {.*\*stopped.*,file=".*basics.c",fullname="${fullname_syntax}${srcfile}",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
- -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,line=.$line_main_hello.*$mi_gdb_prompt$" {
+ -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
@@ -175,11 +175,11 @@ gdb_expect {
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
-# {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="$line_main_return"\}} \
+# {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",fullname="${fullname_syntax}${srcfile}",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
- -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=.*basics.c.,line=.$line_main_return.*$mi_gdb_prompt$" {
+ -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
Index: testsuite/gdb.mi/mi-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-return.exp,v
retrieving revision 1.11
diff -u -p -r1.11 mi-return.exp
--- testsuite/gdb.mi/mi-return.exp 15 Aug 2004 10:15:58 -0000 1.11
+++ testsuite/gdb.mi/mi-return.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002, 2004, 2005 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
@@ -46,14 +46,14 @@ mi_gdb_load ${binfile}
proc test_return_simple {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
set line_callee3_head [gdb_get_line_number "callee3 ("]
set line_callee3_close_brace [expr $line_callee3_head + 3]
send_gdb "111-exec-return\n"
gdb_expect {
- -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
+ -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
Index: testsuite/gdb.mi/mi-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stack.exp,v
retrieving revision 1.14
diff -u -p -r1.14 mi-stack.exp
--- testsuite/gdb.mi/mi-stack.exp 15 Aug 2004 10:15:58 -0000 1.14
+++ testsuite/gdb.mi/mi-stack.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,4 @@
-# Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright 2000, 2001, 2002, 2004, 2005 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
@@ -45,7 +45,7 @@ mi_gdb_load ${binfile}
proc test_stack_frame_listing {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
set line_callee4_head [gdb_get_line_number "callee4 ("]
set line_callee4_body [expr $line_callee4_head + 2]
@@ -57,7 +57,7 @@ proc test_stack_frame_listing {} {
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
- "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
+ "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
@@ -143,7 +143,7 @@ proc test_stack_info_depth {} {
proc test_stack_locals_listing {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
# Obtain lists for locals for the stack frames
# Tests:
@@ -161,7 +161,7 @@ set line_callee4_return_0 [gdb_get_line_
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
Index: testsuite/gdb.mi/mi-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stepi.exp,v
retrieving revision 1.10
diff -u -p -r1.10 mi-stepi.exp
--- testsuite/gdb.mi/mi-stepi.exp 15 Aug 2004 10:15:58 -0000 1.10
+++ testsuite/gdb.mi/mi-stepi.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002, 2004, 2005 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
@@ -45,7 +45,7 @@ mi_gdb_load ${binfile}
proc test_stepi_nexti {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
set line_main_head [gdb_get_line_number "main ("]
set line_main_body [expr $line_main_head + 2]
@@ -53,8 +53,8 @@ proc test_stepi_nexti {} {
send_gdb "111-exec-step-instruction\n"
gdb_expect {
- -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
- set line $expect_out(1,string)
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
+ set line $expect_out(2,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
} else {
@@ -67,8 +67,8 @@ proc test_stepi_nexti {} {
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
- -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
- set line $expect_out(1,string)
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
+ set line $expect_out(2,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
} else {
@@ -81,8 +81,8 @@ proc test_stepi_nexti {} {
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
- -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
- set line $expect_out(1,string)
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
+ set line $expect_out(2,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
} else {
Index: testsuite/gdb.mi/mi-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-syn-frame.exp,v
retrieving revision 1.2
diff -u -p -r1.2 mi-syn-frame.exp
--- testsuite/gdb.mi/mi-syn-frame.exp 24 Feb 2003 20:15:47 -0000 1.2
+++ testsuite/gdb.mi/mi-syn-frame.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2005 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
@@ -69,7 +69,7 @@ gdb_expect {
}
}
-mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
+mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]"
#
@@ -83,7 +83,7 @@ mi_gdb_test "406-data-evaluate-expressio
# We should have both a signal handler and a call dummy frame
# in this next output.
-mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"<signal handler called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
+mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"<signal handler called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]"
send_gdb "408-exec-continue\n"
@@ -96,7 +96,7 @@ gdb_expect {
}
}
-mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
+mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
@@ -104,7 +104,7 @@ mi_gdb_test "409-stack-list-frames 0 0"
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
-mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
+mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
Index: testsuite/gdb.mi/mi-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v
retrieving revision 1.8
diff -u -p -r1.8 mi-until.exp
--- testsuite/gdb.mi/mi-until.exp 9 Aug 2004 16:32:44 -0000 1.8
+++ testsuite/gdb.mi/mi-until.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2005 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
@@ -74,11 +74,11 @@ proc test_running_to_foo {} {
proc test_until {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
send_gdb "111-exec-until\n"
gdb_expect {
- -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
@@ -88,7 +88,7 @@ proc test_until {} {
send_gdb "222-exec-until 15\n"
gdb_expect {
- -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
@@ -98,7 +98,7 @@ proc test_until {} {
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
- -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
@@ -110,7 +110,7 @@ proc test_until {} {
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
- -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
+ -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
Index: testsuite/gdb.mi/mi-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v
retrieving revision 1.12
diff -u -p -r1.12 mi-var-display.exp
--- testsuite/gdb.mi/mi-var-display.exp 17 Aug 2004 09:38:29 -0000 1.12
+++ testsuite/gdb.mi/mi-var-display.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,5 @@
-# Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# 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
@@ -48,7 +49,7 @@ mi_gdb_test "200-break-insert $line_dct_
mi_run_cmd
# The running part has been checked already by mi_run_cmd
gdb_expect {
- -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dct_close_brace\"\}\r\n$mi_gdb_prompt$" {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dct_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "run to do_children_tests"
}
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
@@ -332,7 +333,7 @@ mi_gdb_test "200-break-insert do_special
send_gdb "-exec-continue\n"
gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" {
pass "continue to do_special_tests"
}
timeout {
@@ -592,10 +593,10 @@ mi_gdb_test "200-break-insert incr_a" \
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
Index: testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.11
diff -u -p -r1.11 mi-watch.exp
--- testsuite/gdb.mi/mi-watch.exp 15 Aug 2004 10:15:58 -0000 1.11
+++ testsuite/gdb.mi/mi-watch.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,5 @@
-# Copyright 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002, 2004, 2005
+# 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
@@ -123,7 +124,7 @@ proc test_rwatch_creation_and_listing {}
proc test_watchpoint_triggering {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
set line_callee4_return_0 [gdb_get_line_number "return 0;"]
set line_callee3_head [gdb_get_line_number "callee3 ("]
@@ -139,7 +140,7 @@ proc test_watchpoint_triggering {} {
gdb_expect {
-re "222\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
- -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
+ -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "watchpoint trigger"
}
-re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
@@ -154,7 +155,7 @@ proc test_watchpoint_triggering {} {
gdb_expect {
-re "223\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
- -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {
+ -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "wp out of scope"
}
-re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
Index: testsuite/gdb.mi/mi2-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-cli.exp,v
retrieving revision 1.2
diff -u -p -r1.2 mi2-cli.exp
--- testsuite/gdb.mi/mi2-cli.exp 15 Aug 2004 10:15:58 -0000 1.2
+++ testsuite/gdb.mi/mi2-cli.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004, 2005 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
@@ -161,11 +161,11 @@ mi_gdb_test "600-break-insert -t basics.
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
-# {.*\*stopped.*,file=".*basics.c",line="$line_main_hello"\}} \
+# {.*\*stopped.*,file=".*basics.c",fullname="${fullname_syntax}${srcfile}",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
- -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,line=.$line_main_hello.*$mi_gdb_prompt$" {
+ -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
@@ -175,11 +175,11 @@ gdb_expect {
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
-# {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="$line_main_return"\}} \
+# {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",fullname="${fullname_syntax}${srcfile}",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
- -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=.*basics.c.,line=.$line_main_return.*$mi_gdb_prompt$" {
+ -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
Index: testsuite/gdb.mi/mi2-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-return.exp,v
retrieving revision 1.3
diff -u -p -r1.3 mi2-return.exp
--- testsuite/gdb.mi/mi2-return.exp 15 Aug 2004 10:15:58 -0000 1.3
+++ testsuite/gdb.mi/mi2-return.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,5 @@
-# Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# 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
@@ -46,14 +47,14 @@ mi_gdb_load ${binfile}
proc test_return_simple {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
set line_callee3_head [gdb_get_line_number "callee3 ("]
set line_callee3_close_brace [expr $line_callee3_head + 3]
send_gdb "111-exec-return\n"
gdb_expect {
- -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
+ -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
Index: testsuite/gdb.mi/mi2-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-stack.exp,v
retrieving revision 1.3
diff -u -p -r1.3 mi2-stack.exp
--- testsuite/gdb.mi/mi2-stack.exp 15 Aug 2004 10:15:58 -0000 1.3
+++ testsuite/gdb.mi/mi2-stack.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,4 @@
-# Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 2000, 2001, 2002, 2003, 2004, 2005 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
@@ -45,7 +45,7 @@ mi_gdb_load ${binfile}
proc test_stack_frame_listing {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
set line_callee4_head [gdb_get_line_number "callee4 ("]
set line_callee4_body [expr $line_callee4_head + 2]
@@ -57,7 +57,7 @@ proc test_stack_frame_listing {} {
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
- "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
+ "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
@@ -143,7 +143,7 @@ proc test_stack_info_depth {} {
proc test_stack_locals_listing {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
# Obtain lists for locals for the stack frames
# Tests:
@@ -160,7 +160,7 @@ set line_callee4_return_0 [gdb_get_line_
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
Index: testsuite/gdb.mi/mi2-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-stepi.exp,v
retrieving revision 1.3
diff -u -p -r1.3 mi2-stepi.exp
--- testsuite/gdb.mi/mi2-stepi.exp 15 Aug 2004 10:15:58 -0000 1.3
+++ testsuite/gdb.mi/mi2-stepi.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,5 @@
-# Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# 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
@@ -45,7 +46,7 @@ mi_gdb_load ${binfile}
proc test_stepi_nexti {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
set line_main_head [gdb_get_line_number "main ("]
set line_main_body [expr $line_main_head + 2]
@@ -53,8 +54,8 @@ proc test_stepi_nexti {} {
send_gdb "111-exec-step-instruction\n"
gdb_expect {
- -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
- set line $expect_out(1,string)
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
+ set line $expect_out(2,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
} else {
@@ -67,8 +68,8 @@ proc test_stepi_nexti {} {
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
- -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
- set line $expect_out(1,string)
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
+ set line $expect_out(2,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
} else {
@@ -81,8 +82,8 @@ proc test_stepi_nexti {} {
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
- -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
- set line $expect_out(1,string)
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
+ set line $expect_out(2,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
} else {
Index: testsuite/gdb.mi/mi2-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp,v
retrieving revision 1.1
diff -u -p -r1.1 mi2-syn-frame.exp
--- testsuite/gdb.mi/mi2-syn-frame.exp 7 Aug 2003 17:47:42 -0000 1.1
+++ testsuite/gdb.mi/mi2-syn-frame.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,5 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2005
+# 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
@@ -69,7 +70,7 @@ gdb_expect {
}
}
-mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
+mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]"
#
@@ -96,7 +97,7 @@ gdb_expect {
}
}
-mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
+mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
@@ -104,7 +105,7 @@ mi_gdb_test "409-stack-list-frames 0 0"
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
-mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
+mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
Index: testsuite/gdb.mi/mi2-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-until.exp,v
retrieving revision 1.2
diff -u -p -r1.2 mi2-until.exp
--- testsuite/gdb.mi/mi2-until.exp 9 Aug 2004 22:21:54 -0000 1.2
+++ testsuite/gdb.mi/mi2-until.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,5 @@
-# Copyright 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2003, 2005
+# 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
@@ -74,11 +75,11 @@ proc test_running_to_foo {} {
proc test_until {} {
global mi_gdb_prompt
- global hex
+ global hex fullname_syntax srcfile
send_gdb "111-exec-until\n"
gdb_expect {
- -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
@@ -88,7 +89,7 @@ proc test_until {} {
send_gdb "222-exec-until 15\n"
gdb_expect {
- -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
@@ -98,7 +99,7 @@ proc test_until {} {
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
- -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
@@ -110,7 +111,7 @@ proc test_until {} {
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
- -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
+ -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
Index: testsuite/gdb.mi/mi2-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-display.exp,v
retrieving revision 1.4
diff -u -p -r1.4 mi2-var-display.exp
--- testsuite/gdb.mi/mi2-var-display.exp 17 Aug 2004 09:38:29 -0000 1.4
+++ testsuite/gdb.mi/mi2-var-display.exp 18 May 2005 03:39:18 -0000
@@ -1,4 +1,5 @@
-# Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# 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
@@ -592,10 +593,10 @@ mi_gdb_test "200-break-insert incr_a" \
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
- -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
Index: testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.26
diff -u -p -r1.26 mi-support.exp
--- testsuite/lib/mi-support.exp 25 Mar 2005 20:38:55 -0000 1.26
+++ testsuite/lib/mi-support.exp 18 May 2005 03:39:18 -0000
@@ -799,7 +799,7 @@ proc mi_runto {func} {
}
global mi_gdb_prompt expect_out
- global hex decimal
+ global hex decimal fullname_syntax
set test "mi runto $func"
mi_gdb_test "200-break-insert $func" \
@@ -813,7 +813,7 @@ proc mi_runto {func} {
mi_run_cmd
gdb_expect {
- -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
+ -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
@@ -857,13 +857,14 @@ proc mi_execute_to_helper { cmd reason f
global mi_gdb_prompt
global hex
global decimal
+ global fullname_syntax
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$" {
+ -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$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$" {
+ -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
fail "$test (stopped at wrong place)"
return -1
}
^ permalink raw reply [flat|nested] 103+ messages in thread
* RE: [RFC] fullname attribute for GDB/MI stack frames
@ 2005-04-01 15:09 Dennis Brueni
0 siblings, 0 replies; 103+ messages in thread
From: Dennis Brueni @ 2005-04-01 15:09 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb-patches
> -----Original Message-----
> From: Bob Rossi [mailto:bob@brasko.net]
> Sent: Thursday, March 31, 2005 9:40 PM
> To: Dennis Brueni
> Cc: gdb-patches@sources.redhat.com
> Subject: Re: [RFC] fullname attribute for GDB/MI stack frames
>
>
> > > I would look at mi-file.exp. Make sure the regex you use in the
> > > testsuite for matching the fullname is fullname=\"/.*/${srcfile}\"
> > >
> > > I know that I originally committed something different,
> and it ended
> > > up morphing into this, so that it could pass the testsuite in a
> > > variety of different environments.
> > >
> > > Bob Rossi
> >
> >
> > Apologies for the broken lines; I also noticed that, after
> the fact :(
> > Updated patch set follows.
> >
> > I have fixed the path issues in gdb.texinfo and also added
> ChangeLog
> > entries to the patch set.
> >
> > For the testsuite regex's, I was just trying to remain
> consistent with
> > the tests for "file=" and not break anything.
> > # # NOTE: cagney/2003-02-03: Not yet.
> > # mi_gdb_test "-exec-continue" \
> > ! #
> {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".
> *basics.c",line="8"\}} \
> > # "-interpreter-exec console \"continue to callee4\""
> > send_gdb "999-exec-continue\n"
> > gdb_expect {
> > --- 100,106 ----
> >
> > # # NOTE: cagney/2003-02-03: Not yet.
> > # mi_gdb_test "-exec-continue" \
> > ! #
> {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".
> *basics.c",fullname=".*basics.c",line="8"\}} \
> > # "-interpreter-exec console \"continue to callee4\""
> > send_gdb "999-exec-continue\n"
> > gdb_expect {
>
> Hi,
>
> Again, for the fullname regex, I would recommend using the
> same regex used in mi-file.exp. This would be like
> fullname="/.*basics.c" This forces the regex to ensure that
> the path is absolute, which the check you have does not.
>
> Bob Rossi
>
I was concerned that regex would fail in cases where the
fullname path starts with a drive letter. Nevertheless,
I will rework the patch again and post it later today.
--Dennis Brueni
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
@ 2005-03-29 20:43 Dennis Brueni
2005-03-30 4:46 ` Eli Zaretskii
2005-04-01 1:41 ` Bob Rossi
0 siblings, 2 replies; 103+ messages in thread
From: Dennis Brueni @ 2005-03-29 20:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Dennis Brueni
> On Sat, Mar 26, 2005 at 03:38:55PM +0200, Eli Zaretskii wrote:
> > > Date: Thu, 24 Mar 2005 15:48:45 -0500
> > > From: "Dennis Brueni" <dbrueni@slickedit.com>
> > > Cc: <gdb-patches@sources.redhat.com>,
> > > "Dennis Brueni" <dbrueni@slickedit.com>
> > >
> > > *** gdb/doc/gdb.texinfo 10 Mar 2005 13:12:33 -0000 1.233
> > > --- gdb/doc/gdb.texinfo 24 Mar 2005 18:34:13 -0000
> > > *************** Setting a watchpoint on a variable in th
> > > *** 15894,15900 ****
> > > ^running
> > > ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
> > > value=@{old="-268439212",new="55"@},
> > > ! frame=@{func="main",args=[],file="recursive2.c",line="5"@}
> > > (@value{GDBP})
> > > @end smallexample
> > >
> > > --- 15894,15900 ----
> > > ^running
> > > ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
> > > value=@{old="-268439212",new="55"@},
> > > !
> > > frame=@{func="main",args=[],file="recursive2.c",fullname="/.../recursive
> > > 2.c",line="5"@}
> >
> > Your mail software breaks long lines, which will be an annoyance for
> > whoever tries to apply these patches. Please resend the patches while
> > taking care that long lines are sent intact, TIA.
> >
> > > ^done,reason="watchpoint-trigger",
> > > wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
> > > frame=@{func="callee4",args=[],
> > > ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
> > > (@value{GDBP})
> > > -exec-continue
> > > ^running
> > > ^done,reason="watchpoint-scope",wpnum="5",
> > > frame=@{func="callee3",args=[@{name="strarg",
> > > value="0x11940 \"A string argument.\""@}],
> > > ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
> > > (@value{GDBP})
> > > @end smallexample
> > >
> > > --- 15912,15927 ----
> > > ^done,reason="watchpoint-trigger",
> > > wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
> > > frame=@{func="callee4",args=[],
> > > ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
> > > ! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
> > > (@value{GDBP})
> > > -exec-continue
> > > ^running
> > > ^done,reason="watchpoint-scope",wpnum="5",
> > > frame=@{func="callee3",args=[@{name="strarg",
> > > value="0x11940 \"A string argument.\""@}],
> > > ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
> > > ! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
> > > (@value{GDBP})
> > > @end smallexample
> >
> > I think these changes are confusing: the full name for
> > "../../../devo/gdb/testsuite/gdb.mi/basics.c" cannot possibly be
> > "/devo/gdb/testsuite/gdb.mi/basics.c" unless "../../.." resolves to
> > the root directory. While the latter is a possibility, it's a very
> > rare occasion, so it is better to replace "../../.." with something
> > like "/foo/bar/", not with "/". The way you did it, a user could
> > misunderstand what fullname= does: your examples look like it simply
> > removes "../../.." part.
> >
> > > (@value{GDBP})
> > > *stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
> > > ! args=[],file="try.c",line="5"@}
> > > (@value{GDBP})
> > > -data-list-changed-registers
> > > ^done,changed-registers=["0","1","2","4","5","6","7","8","9",
> > > --- 16211,16217 ----
> > >
> > > (@value{GDBP})
> > > *stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
> > > ! args=[],file="try.c",fullname="/.../try.c",line="5"@}
> >
> > Here, I don't understand the "/.../" part. Did you mean for the 3
> > dots to stand for the omitted full path from the root? If so, it's
> > less confusuing to use some invented file names, like /foo/bar/baz or
> > /dir/subdir/subsubdir.
> >
> > Other than that, the doco patch is approved. Thanks.
>
> I would look at mi-file.exp. Make sure the regex you use in the
> testsuite for matching the fullname is fullname=\"/.*/${srcfile}\"
>
> I know that I originally committed something different, and it ended up
> morphing into this, so that it could pass the testsuite in a variety of
> different environments.
>
> Bob Rossi
Apologies for the broken lines; I also noticed that, after the fact :(
Updated patch set follows.
I have fixed the path issues in gdb.texinfo and also added ChangeLog
entries to the patch set.
For the testsuite regex's, I was just trying to remain consistent
with the tests for "file=" and not break anything.
--Dennis Brueni
dennis@slickedit.com
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.7046
diff -c -p -b -r1.7046 ChangeLog
*** gdb/ChangeLog 29 Mar 2005 16:58:22 -0000 1.7046
--- gdb/ChangeLog 29 Mar 2005 20:00:07 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2005-03-29 Dennis Brueni <dennis@slickedit.com>
+
+ * stack.c (print_frame): In MI mode,
+ output fullname attribute with stack frame
+
2005-03-29 Daniel Jacobowitz <dan@codesourcery.com>
* arm-linux-nat.c (store_register, store_regs): Handle
Index: gdb/stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.130
diff -c -p -b -r1.130 stack.c
*** gdb/stack.c 28 Feb 2005 17:00:49 -0000 1.130
--- gdb/stack.c 29 Mar 2005 20:00:07 -0000
*************** print_frame (struct frame_info *fi,
*** 679,684 ****
--- 679,692 ----
ui_out_text (uiout, " at ");
annotate_frame_source_file ();
ui_out_field_string (uiout, "file", sal.symtab->filename);
+ if (ui_out_is_mi_like_p(uiout)) {
+ if (!sal.symtab->fullname) {
+ symtab_to_fullname(sal.symtab);
+ }
+ if (sal.symtab->fullname) {
+ ui_out_field_string (uiout, "fullname", sal.symtab->fullname);
+ }
+ }
annotate_frame_source_file_end ();
ui_out_text (uiout, ":");
annotate_frame_source_line ();
Index: gdb/doc/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/doc/ChangeLog,v
retrieving revision 1.473
diff -c -p -b -r1.473 ChangeLog
*** gdb/doc/ChangeLog 10 Mar 2005 13:12:32 -0000 1.473
--- gdb/doc/ChangeLog 29 Mar 2005 20:00:08 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2005-03-29 Dennis Brueni <dennis@slickedit.com>
+
+ * gdb.texinfo: Update docs for MI stack frames with fullname attribute.
+
2005-03-10 Bob Rossi <bob@brasko.net>
* gdb.texinfo: Update copyright
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.233
diff -c -p -b -r1.233 gdb.texinfo
*** gdb/doc/gdb.texinfo 10 Mar 2005 13:12:33 -0000 1.233
--- gdb/doc/gdb.texinfo 29 Mar 2005 20:00:13 -0000
*************** Setting a watchpoint on a variable in th
*** 15894,15900 ****
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
value=@{old="-268439212",new="55"@},
! frame=@{func="main",args=[],file="recursive2.c",line="5"@}
(@value{GDBP})
@end smallexample
--- 15894,15901 ----
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
value=@{old="-268439212",new="55"@},
! frame=@{func="main",args=[],file="recursive2.c",
! fullname="/home/foo/bar/devo/myproject/recursive2.c",line="5"@}
(@value{GDBP})
@end smallexample
*************** for the watchpoint going out of scope.
*** 15912,15925 ****
^done,reason="watchpoint-trigger",
wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
--- 15913,15928 ----
^done,reason="watchpoint-trigger",
wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
*************** enabled="y",addr="",what="C",times="0"@}
*** 15951,15957 ****
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
--- 15954,15961 ----
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
*************** enabled="y",addr="",what="C",times="-5"@
*** 15972,15978 ****
^done,reason="watchpoint-scope",wpnum="2",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
--- 15976,15983 ----
^done,reason="watchpoint-scope",wpnum="2",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
*************** On a PPC MBX board:
*** 16207,16213 ****
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
! args=[],file="try.c",line="5"@}
(@value{GDBP})
-data-list-changed-registers
^done,changed-registers=["0","1","2","4","5","6","7","8","9",
--- 16212,16218 ----
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
! args=[],file="try.c",fullname="/home/foo/bar/devo/myproject/try.c",line="5"@}
(@value{GDBP})
-data-list-changed-registers
^done,changed-registers=["0","1","2","4","5","6","7","8","9",
*************** The corresponding @value{GDBN} correspon
*** 16814,16820 ****
(@value{GDBP})
@@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
! file="hello.c",line="13"@}
(@value{GDBP})
@end smallexample
--- 16819,16825 ----
(@value{GDBP})
@@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
! file="hello.c",fullname="/home/foo/bar/devo/myproject/hello.c",line="13"@}
(@value{GDBP})
@end smallexample
*************** Function returning @code{void}.
*** 16846,16852 ****
(@value{GDBP})
@@hello from foo
*stopped,reason="function-finished",frame=@{func="main",args=[],
! file="hello.c",line="7"@}
(@value{GDBP})
@end smallexample
--- 16851,16857 ----
(@value{GDBP})
@@hello from foo
*stopped,reason="function-finished",frame=@{func="main",args=[],
! file="hello.c",fullname="/home/foo/bar/devo/myproject/hello.c",line="7"@}
(@value{GDBP})
@end smallexample
*************** value itself.
*** 16860,16866 ****
(@value{GDBP})
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
args=[@{name="a",value="1"],@{name="b",value="9"@}@},
! file="recursive2.c",line="14"@},
gdb-result-var="$1",return-value="0"
(@value{GDBP})
@end smallexample
--- 16865,16871 ----
(@value{GDBP})
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
args=[@{name="a",value="1"],@{name="b",value="9"@}@},
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
gdb-result-var="$1",return-value="0"
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 16897,16903 ****
222^done
(@value{GDBP})
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
! frame=@{addr="0x00010140",func="foo",args=[],file="try.c",line="13"@}
(@value{GDBP})
(@value{GDBP})
--- 16902,16909 ----
222^done
(@value{GDBP})
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
! frame=@{addr="0x00010140",func="foo",args=[],file="try.c",
! fullname="/home/foo/bar/devo/myproject/try.c",line="13"@}
(@value{GDBP})
(@value{GDBP})
*************** file="../../../devo/gdb/testsuite/gdb.mi
*** 16995,17001 ****
(@value{GDBP})
000*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
(@value{GDBP})
205-break-delete
205^done
--- 17001,17008 ----
(@value{GDBP})
000*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
(@value{GDBP})
205-break-delete
205^done
*************** file="../../../devo/gdb/testsuite/gdb.mi
*** 17004,17010 ****
111^done,frame=@{level="0",func="callee3",
args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
--- 17011,17018 ----
111^done,frame=@{level="0",func="callee3",
args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 17037,17043 ****
^running
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",
! frame=@{func="main",args=[],file="recursive2.c",line="4"@}
(@value{GDBP})
@end smallexample
--- 17045,17052 ----
^running
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",
! frame=@{func="main",args=[],file="recursive2.c",
! fullname="/home/foo/bar/devo/myproject/recursive2.c",line="4"@}
(@value{GDBP})
@end smallexample
*************** Stepping into a function:
*** 17090,17096 ****
(@value{GDBP})
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=[@{name="a",value="10"@},
! @{name="b",value="0"@}],file="recursive2.c",line="11"@}
(@value{GDBP})
@end smallexample
--- 17099,17106 ----
(@value{GDBP})
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=[@{name="a",value="10"@},
! @{name="b",value="0"@}],file="recursive2.c",
! fullname="/home/foo/bar/devo/myproject/recursive2.c",line="11"@}
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 17133,17146 ****
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{func="foo",args=[],file="try.c",line="10"@}
(@value{GDBP})
-exec-step-instruction
^running
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",line="10"@}
(@value{GDBP})
@end smallexample
--- 17143,17158 ----
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{func="foo",args=[],file="try.c",
! fullname="/home/foo/bar/devo/myproject/try.c",line="10"@}
(@value{GDBP})
-exec-step-instruction
^running
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",
! fullname="/home/foo/bar/devo/myproject/try.c",line="10"@}
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 17172,17178 ****
(@value{GDBP})
x = 55
*stopped,reason="location-reached",frame=@{func="main",args=[],
! file="recursive2.c",line="6"@}
(@value{GDBP})
@end smallexample
--- 17184,17190 ----
(@value{GDBP})
x = 55
*stopped,reason="location-reached",frame=@{func="main",args=[],
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="6"@}
(@value{GDBP})
@end smallexample
*************** functionality of @samp{-stack-list-argum
*** 17672,17686 ****
^done,
stack=[
frame=@{level="0",addr="0x00010734",func="callee4",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
frame=@{level="1",addr="0x0001076c",func="callee3",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
frame=@{level="2",addr="0x0001078c",func="callee2",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
frame=@{level="3",addr="0x000107b4",func="callee1",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
frame=@{level="4",addr="0x000107e0",func="main",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
(@value{GDBP})
-stack-list-arguments 0
^done,
--- 17684,17703 ----
^done,
stack=[
frame=@{level="0",addr="0x00010734",func="callee4",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
frame=@{level="1",addr="0x0001076c",func="callee3",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
frame=@{level="2",addr="0x0001078c",func="callee2",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
frame=@{level="3",addr="0x000107b4",func="callee1",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
frame=@{level="4",addr="0x000107e0",func="main",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
(@value{GDBP})
-stack-list-arguments 0
^done,
*************** Full stack backtrace:
*** 17762,17790 ****
-stack-list-frames
^done,stack=
[frame=@{level="0",addr="0x0001076c",func="foo",
! file="recursive2.c",line="11"@},
frame=@{level="1",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="2",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="6",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="7",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="8",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="9",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="10",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="11",addr="0x00010738",func="main",
! file="recursive2.c",line="4"@}]
(@value{GDBP})
@end smallexample
--- 17779,17807 ----
-stack-list-frames
^done,stack=
[frame=@{level="0",addr="0x0001076c",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="11"@},
frame=@{level="1",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="2",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="6",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="7",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="8",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="9",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="10",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="11",addr="0x00010738",func="main",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="4"@}]
(@value{GDBP})
@end smallexample
*************** Show frames between @var{low_frame} and
*** 17795,17805 ****
-stack-list-frames 3 5
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
--- 17812,17822 ----
-stack-list-frames 3 5
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
*************** Show a single frame:
*** 17810,17816 ****
-stack-list-frames 3 3
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
--- 17827,17833 ----
-stack-list-frames 3 3
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/home/foo/bar/devo/myproject/recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
Index: gdb/testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.1095
diff -c -p -b -r1.1095 ChangeLog
*** gdb/testsuite/ChangeLog 27 Mar 2005 00:18:54 -0000 1.1095
--- gdb/testsuite/ChangeLog 29 Mar 2005 20:00:16 -0000
***************
*** 1,3 ****
--- 1,22 ----
+ 2005-03-29 Dennis Brueni <dennis@slickedit.com>
+
+ * gdb.mi/mi-cli.exp: Add tests for fullname in stack frame.
+ * gdb.mi/mi-return.exp: Likewise.
+ * gdb.mi/mi-stack.exp: Likewise.
+ * gdb.mi/mi-stepi.exp: Likewise.
+ * gdb.mi/mi-syn-frame.exp: Likewise.
+ * gdb.mi/mi-until.exp: Likewise.
+ * gdb.mi/mi-var-display.exp: Likewise.
+ * gdb.mi/mi-watch.exp: Likewise.
+ * gdb.mi/mi2-cli.exp: Likewise.
+ * gdb.mi/mi2-return.exp: Likewise.
+ * gdb.mi/mi2-stack.exp: Likewise.
+ * gdb.mi/mi2-stepi.exp: Likewise.
+ * gdb.mi/mi2-syn-frame.exp: Likewise.
+ * gdb.mi/mi2-until.exp: Likewise.
+ * gdb.mi/mi2-var-display.exp: Likewise.
+ * lib/mi-support.exp: Likewise.
+
2005-03-27 Andreas Schwab <schwab@suse.de>
* gdb.base/bigcore.c (main): Add missing mode argument in open
Index: gdb/testsuite/gdb.mi/mi-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-cli.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi-cli.exp
*** gdb/testsuite/gdb.mi/mi-cli.exp 15 Aug 2004 10:15:58 -0000 1.3
--- gdb/testsuite/gdb.mi/mi-cli.exp 29 Mar 2005 20:00:16 -0000
*************** mi_gdb_test "-interpreter-exec console \
*** 100,106 ****
# # NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \
# "-interpreter-exec console \"continue to callee4\""
send_gdb "999-exec-continue\n"
gdb_expect {
--- 100,106 ----
# # NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",fullname=".*basics.c",line="8"\}} \
# "-interpreter-exec console \"continue to callee4\""
send_gdb "999-exec-continue\n"
gdb_expect {
*************** mi_gdb_test "600-break-insert -t basics.
*** 161,171 ****
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
--- 161,171 ----
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",fullname=".*basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=\".*basics.c\",fullname=\".*basics.c\",line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
*************** gdb_expect {
*** 175,185 ****
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! # {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=.*basics.c.,line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
--- 175,185 ----
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! # {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",fullname=".*basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=\".*basics.c\",fullname=\".*basics.c\",line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
Index: gdb/testsuite/gdb.mi/mi-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-return.exp,v
retrieving revision 1.11
diff -c -p -b -r1.11 mi-return.exp
*** gdb/testsuite/gdb.mi/mi-return.exp 15 Aug 2004 10:15:58 -0000 1.11
--- gdb/testsuite/gdb.mi/mi-return.exp 29 Mar 2005 20:00:16 -0000
*************** proc test_return_simple {} {
*** 53,59 ****
send_gdb "111-exec-return\n"
gdb_expect {
! -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
--- 53,59 ----
send_gdb "111-exec-return\n"
gdb_expect {
! -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
Index: gdb/testsuite/gdb.mi/mi-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stack.exp,v
retrieving revision 1.14
diff -c -p -b -r1.14 mi-stack.exp
*** gdb/testsuite/gdb.mi/mi-stack.exp 15 Aug 2004 10:15:58 -0000 1.14
--- gdb/testsuite/gdb.mi/mi-stack.exp 29 Mar 2005 20:00:16 -0000
*************** proc test_stack_frame_listing {} {
*** 57,63 ****
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
! "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
--- 57,63 ----
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
! "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",fullname=\".*/basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
*************** set line_callee4_return_0 [gdb_get_line_
*** 161,167 ****
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
--- 161,167 ----
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*/basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
Index: gdb/testsuite/gdb.mi/mi-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stepi.exp,v
retrieving revision 1.10
diff -c -p -b -r1.10 mi-stepi.exp
*** gdb/testsuite/gdb.mi/mi-stepi.exp 15 Aug 2004 10:15:58 -0000 1.10
--- gdb/testsuite/gdb.mi/mi-stepi.exp 29 Mar 2005 20:00:16 -0000
*************** proc test_stepi_nexti {} {
*** 53,59 ****
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
--- 53,59 ----
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
*************** proc test_stepi_nexti {} {
*** 67,73 ****
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
--- 67,73 ----
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
*************** proc test_stepi_nexti {} {
*** 81,87 ****
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
--- 81,87 ----
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
Index: gdb/testsuite/gdb.mi/mi-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-syn-frame.exp,v
retrieving revision 1.2
diff -c -p -b -r1.2 mi-syn-frame.exp
*** gdb/testsuite/gdb.mi/mi-syn-frame.exp 24 Feb 2003 20:15:47 -0000 1.2
--- gdb/testsuite/gdb.mi/mi-syn-frame.exp 29 Mar 2005 20:00:16 -0000
*************** gdb_expect {
*** 69,75 ****
}
}
! mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
--- 69,75 ----
}
}
! mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
*************** mi_gdb_test "406-data-evaluate-expressio
*** 83,89 ****
# We should have both a signal handler and a call dummy frame
# in this next output.
! mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"<signal handler called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
send_gdb "408-exec-continue\n"
--- 83,89 ----
# We should have both a signal handler and a call dummy frame
# in this next output.
! mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"<signal handler called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
send_gdb "408-exec-continue\n"
*************** gdb_expect {
*** 96,102 ****
}
}
! mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
--- 96,102 ----
}
}
! mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
*************** mi_gdb_test "409-stack-list-frames 0 0"
*** 104,110 ****
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
! mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
--- 104,110 ----
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
! mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
Index: gdb/testsuite/gdb.mi/mi-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v
retrieving revision 1.8
diff -c -p -b -r1.8 mi-until.exp
*** gdb/testsuite/gdb.mi/mi-until.exp 9 Aug 2004 16:32:44 -0000 1.8
--- gdb/testsuite/gdb.mi/mi-until.exp 29 Mar 2005 20:00:16 -0000
*************** proc test_until {} {
*** 78,84 ****
send_gdb "111-exec-until\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
--- 78,84 ----
send_gdb "111-exec-until\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
*************** proc test_until {} {
*** 88,94 ****
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
--- 88,94 ----
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
*************** proc test_until {} {
*** 98,104 ****
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
--- 98,104 ----
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
*************** proc test_until {} {
*** 110,116 ****
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
--- 110,116 ----
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
Index: gdb/testsuite/gdb.mi/mi-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v
retrieving revision 1.12
diff -c -p -b -r1.12 mi-var-display.exp
*** gdb/testsuite/gdb.mi/mi-var-display.exp 17 Aug 2004 09:38:29 -0000 1.12
--- gdb/testsuite/gdb.mi/mi-var-display.exp 29 Mar 2005 20:00:16 -0000
*************** mi_gdb_test "200-break-insert $line_dct_
*** 48,54 ****
mi_run_cmd
# The running part has been checked already by mi_run_cmd
gdb_expect {
! -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dct_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "run to do_children_tests"
}
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
--- 48,54 ----
mi_run_cmd
# The running part has been checked already by mi_run_cmd
gdb_expect {
! -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\".*var-cmd.c\",line=\"$line_dct_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "run to do_children_tests"
}
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
*************** mi_gdb_test "200-break-insert do_special
*** 332,338 ****
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" {
pass "continue to do_special_tests"
}
timeout {
--- 332,338 ----
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\".*var-cmd.c\",line=\"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" {
pass "continue to do_special_tests"
}
timeout {
*************** mi_gdb_test "200-break-insert incr_a" \
*** 592,601 ****
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
--- 592,601 ----
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\".*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\".*var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
Index: gdb/testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.11
diff -c -p -b -r1.11 mi-watch.exp
*** gdb/testsuite/gdb.mi/mi-watch.exp 15 Aug 2004 10:15:58 -0000 1.11
--- gdb/testsuite/gdb.mi/mi-watch.exp 29 Mar 2005 20:00:17 -0000
*************** proc test_watchpoint_triggering {} {
*** 139,145 ****
gdb_expect {
-re "222\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "watchpoint trigger"
}
-re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
--- 139,145 ----
gdb_expect {
-re "222\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "watchpoint trigger"
}
-re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
*************** proc test_watchpoint_triggering {} {
*** 154,160 ****
gdb_expect {
-re "223\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "wp out of scope"
}
-re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
--- 154,160 ----
gdb_expect {
-re "223\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {
pass "wp out of scope"
}
-re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
Index: gdb/testsuite/gdb.mi/mi2-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-cli.exp,v
retrieving revision 1.2
diff -c -p -b -r1.2 mi2-cli.exp
*** gdb/testsuite/gdb.mi/mi2-cli.exp 15 Aug 2004 10:15:58 -0000 1.2
--- gdb/testsuite/gdb.mi/mi2-cli.exp 29 Mar 2005 20:00:17 -0000
*************** mi_gdb_test "600-break-insert -t basics.
*** 161,171 ****
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
--- 161,171 ----
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",fullname=".*basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=\".*basics.c\",fullname=\".*basics.c\",line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
*************** gdb_expect {
*** 175,185 ****
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! # {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=.*basics.c.,line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
--- 175,185 ----
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! # {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",fullname=".*basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=\".*basics.c\",fullname=\".*basics.c\",line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
Index: gdb/testsuite/gdb.mi/mi2-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-return.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi2-return.exp
*** gdb/testsuite/gdb.mi/mi2-return.exp 15 Aug 2004 10:15:58 -0000 1.3
--- gdb/testsuite/gdb.mi/mi2-return.exp 29 Mar 2005 20:00:17 -0000
*************** proc test_return_simple {} {
*** 53,59 ****
send_gdb "111-exec-return\n"
gdb_expect {
! -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
--- 53,59 ----
send_gdb "111-exec-return\n"
gdb_expect {
! -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
Index: gdb/testsuite/gdb.mi/mi2-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-stack.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi2-stack.exp
*** gdb/testsuite/gdb.mi/mi2-stack.exp 15 Aug 2004 10:15:58 -0000 1.3
--- gdb/testsuite/gdb.mi/mi2-stack.exp 29 Mar 2005 20:00:17 -0000
*************** proc test_stack_frame_listing {} {
*** 57,63 ****
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
! "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
--- 57,63 ----
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
! "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
*************** set line_callee4_return_0 [gdb_get_line_
*** 160,166 ****
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
--- 160,166 ----
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
Index: gdb/testsuite/gdb.mi/mi2-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-stepi.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi2-stepi.exp
*** gdb/testsuite/gdb.mi/mi2-stepi.exp 15 Aug 2004 10:15:58 -0000 1.3
--- gdb/testsuite/gdb.mi/mi2-stepi.exp 29 Mar 2005 20:00:17 -0000
*************** proc test_stepi_nexti {} {
*** 53,59 ****
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
--- 53,59 ----
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "step-instruction at main"
*************** proc test_stepi_nexti {} {
*** 67,73 ****
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
--- 67,73 ----
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
*************** proc test_stepi_nexti {} {
*** 81,87 ****
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
--- 81,87 ----
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello } {
pass "next-instruction at main"
Index: gdb/testsuite/gdb.mi/mi2-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp,v
retrieving revision 1.1
diff -c -p -b -r1.1 mi2-syn-frame.exp
*** gdb/testsuite/gdb.mi/mi2-syn-frame.exp 7 Aug 2003 17:47:42 -0000 1.1
--- gdb/testsuite/gdb.mi/mi2-syn-frame.exp 29 Mar 2005 20:00:17 -0000
*************** gdb_expect {
*** 69,75 ****
}
}
! mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
--- 69,75 ----
}
}
! mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
*************** gdb_expect {
*** 96,102 ****
}
}
! mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
--- 96,102 ----
}
}
! mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
*************** mi_gdb_test "409-stack-list-frames 0 0"
*** 104,110 ****
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
! mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
--- 104,110 ----
mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
! mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
mi_gdb_exit
Index: gdb/testsuite/gdb.mi/mi2-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-until.exp,v
retrieving revision 1.2
diff -c -p -b -r1.2 mi2-until.exp
*** gdb/testsuite/gdb.mi/mi2-until.exp 9 Aug 2004 22:21:54 -0000 1.2
--- gdb/testsuite/gdb.mi/mi2-until.exp 29 Mar 2005 20:00:17 -0000
*************** proc test_until {} {
*** 78,84 ****
send_gdb "111-exec-until\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
--- 78,84 ----
send_gdb "111-exec-until\n"
gdb_expect {
! -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
*************** proc test_until {} {
*** 88,94 ****
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
--- 88,94 ----
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
*************** proc test_until {} {
*** 98,104 ****
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
--- 98,104 ----
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",fullname=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
*************** proc test_until {} {
*** 110,116 ****
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
--- 110,116 ----
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",fullname=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
Index: gdb/testsuite/gdb.mi/mi2-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-display.exp,v
retrieving revision 1.4
diff -c -p -b -r1.4 mi2-var-display.exp
*** gdb/testsuite/gdb.mi/mi2-var-display.exp 17 Aug 2004 09:38:29 -0000 1.4
--- gdb/testsuite/gdb.mi/mi2-var-display.exp 29 Mar 2005 20:00:17 -0000
*************** mi_gdb_test "200-break-insert incr_a" \
*** 592,601 ****
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
--- 592,601 ----
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\".*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\".*var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a - 1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.26
diff -c -p -b -r1.26 mi-support.exp
*** gdb/testsuite/lib/mi-support.exp 25 Mar 2005 20:38:55 -0000 1.26
--- gdb/testsuite/lib/mi-support.exp 29 Mar 2005 20:00:17 -0000
*************** proc mi_runto {func} {
*** 813,819 ****
mi_run_cmd
gdb_expect {
! -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
--- 813,819 ----
mi_run_cmd
gdb_expect {
! -re ".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
*************** proc mi_execute_to_helper { cmd reason f
*** 859,869 ****
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
}
--- 859,869 ----
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\",fullname=\".*$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=\".*\",fullname=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
fail "$test (stopped at wrong place)"
return -1
}
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-03-29 20:43 Dennis Brueni
@ 2005-03-30 4:46 ` Eli Zaretskii
2005-04-01 1:41 ` Bob Rossi
1 sibling, 0 replies; 103+ messages in thread
From: Eli Zaretskii @ 2005-03-30 4:46 UTC (permalink / raw)
To: Dennis Brueni; +Cc: gdb-patches
> Date: Tue, 29 Mar 2005 15:42:37 -0500
> From: "Dennis Brueni" <dbrueni@slickedit.com>
> Cc: "Dennis Brueni" <dbrueni@slickedit.com>
>
> I have fixed the path issues in gdb.texinfo and also added ChangeLog
> entries to the patch set.
Thanks. The gdb.texinfo patch is approved.
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-03-29 20:43 Dennis Brueni
2005-03-30 4:46 ` Eli Zaretskii
@ 2005-04-01 1:41 ` Bob Rossi
1 sibling, 0 replies; 103+ messages in thread
From: Bob Rossi @ 2005-04-01 1:41 UTC (permalink / raw)
To: Dennis Brueni; +Cc: gdb-patches
> > I would look at mi-file.exp. Make sure the regex you use in the
> > testsuite for matching the fullname is fullname=\"/.*/${srcfile}\"
> >
> > I know that I originally committed something different, and it ended up
> > morphing into this, so that it could pass the testsuite in a variety of
> > different environments.
> >
> > Bob Rossi
>
>
> Apologies for the broken lines; I also noticed that, after the fact :(
> Updated patch set follows.
>
> I have fixed the path issues in gdb.texinfo and also added ChangeLog
> entries to the patch set.
>
> For the testsuite regex's, I was just trying to remain consistent
> with the tests for "file=" and not break anything.
> # # NOTE: cagney/2003-02-03: Not yet.
> # mi_gdb_test "-exec-continue" \
> ! # {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \
> # "-interpreter-exec console \"continue to callee4\""
> send_gdb "999-exec-continue\n"
> gdb_expect {
> --- 100,106 ----
>
> # # NOTE: cagney/2003-02-03: Not yet.
> # mi_gdb_test "-exec-continue" \
> ! # {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",fullname=".*basics.c",line="8"\}} \
> # "-interpreter-exec console \"continue to callee4\""
> send_gdb "999-exec-continue\n"
> gdb_expect {
Hi,
Again, for the fullname regex, I would recommend using the same regex
used in mi-file.exp. This would be like fullname="/.*basics.c"
This forces the regex to ensure that the path is absolute, which the
check you have does not.
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* Re: [RFC] fullname attribute for GDB/MI stack frames
@ 2005-03-26 13:43 Eli Zaretskii
2005-03-26 13:50 ` Bob Rossi
0 siblings, 1 reply; 103+ messages in thread
From: Eli Zaretskii @ 2005-03-26 13:43 UTC (permalink / raw)
To: Dennis Brueni; +Cc: bob, gdb-patches, dbrueni@slickedit.com
> Date: Thu, 24 Mar 2005 15:48:45 -0500
> From: "Dennis Brueni" <dbrueni@slickedit.com>
> Cc: <gdb-patches@sources.redhat.com>,
> "Dennis Brueni" <dbrueni@slickedit.com>
>
> *** gdb/doc/gdb.texinfo 10 Mar 2005 13:12:33 -0000 1.233
> --- gdb/doc/gdb.texinfo 24 Mar 2005 18:34:13 -0000
> *************** Setting a watchpoint on a variable in th
> *** 15894,15900 ****
> ^running
> ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
> value=@{old="-268439212",new="55"@},
> ! frame=@{func="main",args=[],file="recursive2.c",line="5"@}
> (@value{GDBP})
> @end smallexample
>
> --- 15894,15900 ----
> ^running
> ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
> value=@{old="-268439212",new="55"@},
> !
> frame=@{func="main",args=[],file="recursive2.c",fullname="/.../recursive
> 2.c",line="5"@}
Your mail software breaks long lines, which will be an annoyance for
whoever tries to apply these patches. Please resend the patches while
taking care that long lines are sent intact, TIA.
> ^done,reason="watchpoint-trigger",
> wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
> frame=@{func="callee4",args=[],
> ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
> (@value{GDBP})
> -exec-continue
> ^running
> ^done,reason="watchpoint-scope",wpnum="5",
> frame=@{func="callee3",args=[@{name="strarg",
> value="0x11940 \"A string argument.\""@}],
> ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
> (@value{GDBP})
> @end smallexample
>
> --- 15912,15927 ----
> ^done,reason="watchpoint-trigger",
> wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
> frame=@{func="callee4",args=[],
> ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
> ! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
> (@value{GDBP})
> -exec-continue
> ^running
> ^done,reason="watchpoint-scope",wpnum="5",
> frame=@{func="callee3",args=[@{name="strarg",
> value="0x11940 \"A string argument.\""@}],
> ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
> ! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
> (@value{GDBP})
> @end smallexample
I think these changes are confusing: the full name for
"../../../devo/gdb/testsuite/gdb.mi/basics.c" cannot possibly be
"/devo/gdb/testsuite/gdb.mi/basics.c" unless "../../.." resolves to
the root directory. While the latter is a possibility, it's a very
rare occasion, so it is better to replace "../../.." with something
like "/foo/bar/", not with "/". The way you did it, a user could
misunderstand what fullname= does: your examples look like it simply
removes "../../.." part.
> (@value{GDBP})
> *stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
> ! args=[],file="try.c",line="5"@}
> (@value{GDBP})
> -data-list-changed-registers
> ^done,changed-registers=["0","1","2","4","5","6","7","8","9",
> --- 16211,16217 ----
>
> (@value{GDBP})
> *stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
> ! args=[],file="try.c",fullname="/.../try.c",line="5"@}
Here, I don't understand the "/.../" part. Did you mean for the 3
dots to stand for the omitted full path from the root? If so, it's
less confusuing to use some invented file names, like /foo/bar/baz or
/dir/subdir/subsubdir.
Other than that, the doco patch is approved. Thanks.
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-03-26 13:43 Eli Zaretskii
@ 2005-03-26 13:50 ` Bob Rossi
0 siblings, 0 replies; 103+ messages in thread
From: Bob Rossi @ 2005-03-26 13:50 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Dennis Brueni, gdb-patches, dbrueni@slickedit.com
On Sat, Mar 26, 2005 at 03:38:55PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 24 Mar 2005 15:48:45 -0500
> > From: "Dennis Brueni" <dbrueni@slickedit.com>
> > Cc: <gdb-patches@sources.redhat.com>,
> > "Dennis Brueni" <dbrueni@slickedit.com>
> >
> > *** gdb/doc/gdb.texinfo 10 Mar 2005 13:12:33 -0000 1.233
> > --- gdb/doc/gdb.texinfo 24 Mar 2005 18:34:13 -0000
> > *************** Setting a watchpoint on a variable in th
> > *** 15894,15900 ****
> > ^running
> > ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
> > value=@{old="-268439212",new="55"@},
> > ! frame=@{func="main",args=[],file="recursive2.c",line="5"@}
> > (@value{GDBP})
> > @end smallexample
> >
> > --- 15894,15900 ----
> > ^running
> > ^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
> > value=@{old="-268439212",new="55"@},
> > !
> > frame=@{func="main",args=[],file="recursive2.c",fullname="/.../recursive
> > 2.c",line="5"@}
>
> Your mail software breaks long lines, which will be an annoyance for
> whoever tries to apply these patches. Please resend the patches while
> taking care that long lines are sent intact, TIA.
>
> > ^done,reason="watchpoint-trigger",
> > wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
> > frame=@{func="callee4",args=[],
> > ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
> > (@value{GDBP})
> > -exec-continue
> > ^running
> > ^done,reason="watchpoint-scope",wpnum="5",
> > frame=@{func="callee3",args=[@{name="strarg",
> > value="0x11940 \"A string argument.\""@}],
> > ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
> > (@value{GDBP})
> > @end smallexample
> >
> > --- 15912,15927 ----
> > ^done,reason="watchpoint-trigger",
> > wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
> > frame=@{func="callee4",args=[],
> > ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
> > ! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
> > (@value{GDBP})
> > -exec-continue
> > ^running
> > ^done,reason="watchpoint-scope",wpnum="5",
> > frame=@{func="callee3",args=[@{name="strarg",
> > value="0x11940 \"A string argument.\""@}],
> > ! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
> > ! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
> > (@value{GDBP})
> > @end smallexample
>
> I think these changes are confusing: the full name for
> "../../../devo/gdb/testsuite/gdb.mi/basics.c" cannot possibly be
> "/devo/gdb/testsuite/gdb.mi/basics.c" unless "../../.." resolves to
> the root directory. While the latter is a possibility, it's a very
> rare occasion, so it is better to replace "../../.." with something
> like "/foo/bar/", not with "/". The way you did it, a user could
> misunderstand what fullname= does: your examples look like it simply
> removes "../../.." part.
>
> > (@value{GDBP})
> > *stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
> > ! args=[],file="try.c",line="5"@}
> > (@value{GDBP})
> > -data-list-changed-registers
> > ^done,changed-registers=["0","1","2","4","5","6","7","8","9",
> > --- 16211,16217 ----
> >
> > (@value{GDBP})
> > *stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
> > ! args=[],file="try.c",fullname="/.../try.c",line="5"@}
>
> Here, I don't understand the "/.../" part. Did you mean for the 3
> dots to stand for the omitted full path from the root? If so, it's
> less confusuing to use some invented file names, like /foo/bar/baz or
> /dir/subdir/subsubdir.
>
> Other than that, the doco patch is approved. Thanks.
I would look at mi-file.exp. Make sure the regex you use in the
testsuite for matching the fullname is fullname=\"/.*/${srcfile}\"
I know that I originally committed something different, and it ended up
morphing into this, so that it could pass the testsuite in a variety of
different environments.
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
* RE: [RFC] fullname attribute for GDB/MI stack frames
@ 2005-03-24 20:49 Dennis Brueni
0 siblings, 0 replies; 103+ messages in thread
From: Dennis Brueni @ 2005-03-24 20:49 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb-patches, Dennis Brueni
> -----Original Message-----
> From: Bob Rossi [mailto:bob@brasko.net]
> Sent: Wednesday, March 23, 2005 5:34 PM
> To: Dennis Brueni
> Cc: gdb-patches@sources.redhat.com
> Subject: Re: [RFC] fullname attribute for GDB/MI stack frames
>
>
> > The following patch fixes the code that reports stack
> frames to append
> > a "fullname" attribute to each stack frame, reporting the absolute
> > path name of the source file. This effects MI output mode only and
> > does not hurt performance.
> >
> > Index: gdb/stack.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/stack.c,v
> >
> > $ diff -c -p -b stack.c-6.3 stack.c
> > *** stack.c-6.3 Wed Mar 23 17:03:57 2005
> > --- stack.c Wed Mar 23 15:40:11 2005
> > *************** print_frame (struct frame_info *fi,
> > *** 666,671 ****
> > --- 666,679 ----
> > ui_out_text (uiout, " at ");
> > annotate_frame_source_file ();
> > ui_out_field_string (uiout, "file", sal.symtab->filename);
> > + if (ui_out_is_mi_like_p(uiout)) {
> > + if (!sal.symtab->fullname) {
> > + source_full_path_of(sal.symtab->filename,
> > &sal.symtab->fullname);
> > + }
> > + if (sal.symtab->fullname) {
> > + ui_out_field_string (uiout, "fullname",
> > sal.symtab->fullname);
> > + }
> > + }
> > annotate_frame_source_file_end ();
> > ui_out_text (uiout, ":");
> > annotate_frame_source_line ();
>
> This is great, I've was eventually going to get to this.
> Although I'm not the maintainer, I have a few comments,
>
> You should probably be using symtab_to_fullname instead of
> source_full_path_of. In fact, maybe source_full_path_of
> should be deprecated. symtab_to_fullname is used in mi/mi-cmd-file.c.
>
> Also, there should be a corresponding testcase, that ensures the new
> field is working properly.
>
> Thanks,
> Bob Rossi
>
Thanks for the excellent suggestions! Attached is a complete
patch for the latest GDB development stream, including testsuite and
docs.
Hint, hint, it would be great to see this in 6.4!
--Dennis Brueni
dennis@slickedit.com
Index: gdb/stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.130
diff -c -p -b -r1.130 stack.c
*** gdb/stack.c 28 Feb 2005 17:00:49 -0000 1.130
--- gdb/stack.c 24 Mar 2005 18:34:08 -0000
*************** print_frame (struct frame_info *fi,
*** 679,684 ****
--- 679,692 ----
ui_out_text (uiout, " at ");
annotate_frame_source_file ();
ui_out_field_string (uiout, "file", sal.symtab->filename);
+ if (ui_out_is_mi_like_p(uiout)) {
+ if (!sal.symtab->fullname) {
+ symtab_to_fullname(sal.symtab);
+ }
+ if (sal.symtab->fullname) {
+ ui_out_field_string (uiout, "fullname",
sal.symtab->fullname);
+ }
+ }
annotate_frame_source_file_end ();
ui_out_text (uiout, ":");
annotate_frame_source_line ();
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.233
diff -c -p -b -r1.233 gdb.texinfo
*** gdb/doc/gdb.texinfo 10 Mar 2005 13:12:33 -0000 1.233
--- gdb/doc/gdb.texinfo 24 Mar 2005 18:34:13 -0000
*************** Setting a watchpoint on a variable in th
*** 15894,15900 ****
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
value=@{old="-268439212",new="55"@},
! frame=@{func="main",args=[],file="recursive2.c",line="5"@}
(@value{GDBP})
@end smallexample
--- 15894,15900 ----
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
value=@{old="-268439212",new="55"@},
!
frame=@{func="main",args=[],file="recursive2.c",fullname="/.../recursive
2.c",line="5"@}
(@value{GDBP})
@end smallexample
*************** for the watchpoint going out of scope.
*** 15912,15925 ****
^done,reason="watchpoint-trigger",
wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
--- 15912,15927 ----
^done,reason="watchpoint-trigger",
wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
*************** enabled="y",addr="",what="C",times="0"@}
*** 15951,15957 ****
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
--- 15953,15960 ----
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
*************** enabled="y",addr="",what="C",times="-5"@
*** 15972,15978 ****
^done,reason="watchpoint-scope",wpnum="2",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
--- 15975,15982 ----
^done,reason="watchpoint-scope",wpnum="2",
frame=@{func="callee3",args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
*************** On a PPC MBX board:
*** 16207,16213 ****
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
! args=[],file="try.c",line="5"@}
(@value{GDBP})
-data-list-changed-registers
^done,changed-registers=["0","1","2","4","5","6","7","8","9",
--- 16211,16217 ----
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
! args=[],file="try.c",fullname="/.../try.c",line="5"@}
(@value{GDBP})
-data-list-changed-registers
^done,changed-registers=["0","1","2","4","5","6","7","8","9",
*************** The corresponding @value{GDBN} correspon
*** 16814,16820 ****
(@value{GDBP})
@@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
! file="hello.c",line="13"@}
(@value{GDBP})
@end smallexample
--- 16818,16824 ----
(@value{GDBP})
@@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
! file="hello.c",fullname="/.../hello.c",line="13"@}
(@value{GDBP})
@end smallexample
*************** Function returning @code{void}.
*** 16846,16852 ****
(@value{GDBP})
@@hello from foo
*stopped,reason="function-finished",frame=@{func="main",args=[],
! file="hello.c",line="7"@}
(@value{GDBP})
@end smallexample
--- 16850,16856 ----
(@value{GDBP})
@@hello from foo
*stopped,reason="function-finished",frame=@{func="main",args=[],
! file="hello.c",fullname="/.../hello.c",line="7"@}
(@value{GDBP})
@end smallexample
*************** value itself.
*** 16860,16866 ****
(@value{GDBP})
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo"
,
args=[@{name="a",value="1"],@{name="b",value="9"@}@},
! file="recursive2.c",line="14"@},
gdb-result-var="$1",return-value="0"
(@value{GDBP})
@end smallexample
--- 16864,16870 ----
(@value{GDBP})
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo"
,
args=[@{name="a",value="1"],@{name="b",value="9"@}@},
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
gdb-result-var="$1",return-value="0"
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 16897,16903 ****
222^done
(@value{GDBP})
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
! frame=@{addr="0x00010140",func="foo",args=[],file="try.c",line="13"@}
(@value{GDBP})
(@value{GDBP})
--- 16901,16907 ----
222^done
(@value{GDBP})
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
!
frame=@{addr="0x00010140",func="foo",args=[],file="try.c",fullname=/.../
try.c",line="13"@}
(@value{GDBP})
(@value{GDBP})
*************** file="../../../devo/gdb/testsuite/gdb.mi
*** 16995,17001 ****
(@value{GDBP})
000*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
(@value{GDBP})
205-break-delete
205^done
--- 16999,17006 ----
(@value{GDBP})
000*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="callee4",args=[],
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
(@value{GDBP})
205-break-delete
205^done
*************** file="../../../devo/gdb/testsuite/gdb.mi
*** 17005,17010 ****
--- 17010,17016 ----
args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
+ fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 17037,17043 ****
^running
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",
! frame=@{func="main",args=[],file="recursive2.c",line="4"@}
(@value{GDBP})
@end smallexample
--- 17043,17049 ----
^running
(@value{GDBP})
*stopped,reason="breakpoint-hit",bkptno="1",
!
frame=@{func="main",args=[],file="recursive2.c",fullname="/.../recursive
2.c",line="4"@}
(@value{GDBP})
@end smallexample
*************** Stepping into a function:
*** 17090,17096 ****
(@value{GDBP})
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=[@{name="a",value="10"@},
! @{name="b",value="0"@}],file="recursive2.c",line="11"@}
(@value{GDBP})
@end smallexample
--- 17096,17102 ----
(@value{GDBP})
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=[@{name="a",value="10"@},
!
@{name="b",value="0"@}],file="recursive2.c",fullname="/.../recursive2.c"
,line="11"@}
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 17133,17146 ****
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{func="foo",args=[],file="try.c",line="10"@}
(@value{GDBP})
-exec-step-instruction
^running
(@value{GDBP})
*stopped,reason="end-stepping-range",
! frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",line="10"@}
(@value{GDBP})
@end smallexample
--- 17139,17152 ----
(@value{GDBP})
*stopped,reason="end-stepping-range",
!
frame=@{func="foo",args=[],file="try.c",fullname="/.../try.c",line="10"@
}
(@value{GDBP})
-exec-step-instruction
^running
(@value{GDBP})
*stopped,reason="end-stepping-range",
!
frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",fullname="/...
/try.c",line="10"@}
(@value{GDBP})
@end smallexample
*************** The corresponding @value{GDBN} command i
*** 17172,17178 ****
(@value{GDBP})
x = 55
*stopped,reason="location-reached",frame=@{func="main",args=[],
! file="recursive2.c",line="6"@}
(@value{GDBP})
@end smallexample
--- 17178,17184 ----
(@value{GDBP})
x = 55
*stopped,reason="location-reached",frame=@{func="main",args=[],
! file="recursive2.c",fullname="/.../recursive2.c",line="6"@}
(@value{GDBP})
@end smallexample
*************** functionality of @samp{-stack-list-argum
*** 17672,17686 ****
^done,
stack=[
frame=@{level="0",addr="0x00010734",func="callee4",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
frame=@{level="1",addr="0x0001076c",func="callee3",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
frame=@{level="2",addr="0x0001078c",func="callee2",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
frame=@{level="3",addr="0x000107b4",func="callee1",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
frame=@{level="4",addr="0x000107e0",func="main",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
(@value{GDBP})
-stack-list-arguments 0
^done,
--- 17678,17697 ----
^done,
stack=[
frame=@{level="0",addr="0x00010734",func="callee4",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
frame=@{level="1",addr="0x0001076c",func="callee3",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
frame=@{level="2",addr="0x0001078c",func="callee2",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
frame=@{level="3",addr="0x000107b4",func="callee1",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
frame=@{level="4",addr="0x000107e0",func="main",
! file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
! fullname="/devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
(@value{GDBP})
-stack-list-arguments 0
^done,
*************** Full stack backtrace:
*** 17762,17790 ****
-stack-list-frames
^done,stack=
[frame=@{level="0",addr="0x0001076c",func="foo",
! file="recursive2.c",line="11"@},
frame=@{level="1",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="2",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="6",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="7",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="8",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="9",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="10",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="11",addr="0x00010738",func="main",
! file="recursive2.c",line="4"@}]
(@value{GDBP})
@end smallexample
--- 17773,17801 ----
-stack-list-frames
^done,stack=
[frame=@{level="0",addr="0x0001076c",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="11"@},
frame=@{level="1",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="2",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="6",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="7",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="8",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="9",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="10",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="11",addr="0x00010738",func="main",
! file="recursive2.c",fullname="/.../recursive2.c",line="4"@}]
(@value{GDBP})
@end smallexample
*************** Show frames between @var{low_frame} and
*** 17795,17805 ****
-stack-list-frames 3 5
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
--- 17806,17816 ----
-stack-list-frames 3 5
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="4",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@},
frame=@{level="5",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
*************** Show a single frame:
*** 17810,17816 ****
-stack-list-frames 3 3
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
--- 17821,17827 ----
-stack-list-frames 3 3
^done,stack=
[frame=@{level="3",addr="0x000107a4",func="foo",
! file="recursive2.c",fullname="/.../recursive2.c",line="14"@}]
(@value{GDBP})
@end smallexample
Index: gdb/testsuite/gdb.mi/mi-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-cli.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi-cli.exp
*** gdb/testsuite/gdb.mi/mi-cli.exp 15 Aug 2004 10:15:58 -0000
1.3
--- gdb/testsuite/gdb.mi/mi-cli.exp 24 Mar 2005 18:34:14 -0000
*************** mi_gdb_test "-interpreter-exec console \
*** 100,106 ****
# # NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-continue" \
! #
{.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c"
,line="8"\}} \
# "-interpreter-exec console \"continue to callee4\""
send_gdb "999-exec-continue\n"
gdb_expect {
--- 100,106 ----
# # NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-continue" \
! #
{.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c"
,fullname=\".*basics.c\",line="8"\}} \
# "-interpreter-exec console \"continue to callee4\""
send_gdb "999-exec-continue\n"
gdb_expect {
*************** mi_gdb_test "600-break-insert -t basics.
*** 161,171 ****
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re
"700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,lin
e=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
--- 161,171 ----
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! #
{.*\*stopped.*,file=".*basics.c",fullname=".*basics.c",line="$line_main_
hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re
"700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,ful
lname=.*basics.c.,line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
*************** gdb_expect {
*** 175,185 ****
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! #
{.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="$lin
e_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re
"800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-r
ange.*,file=.*basics.c.,line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
--- 175,185 ----
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! #
{.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",fullname="
.*basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re
"800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-r
ange.*,file=.*basics.c.,fullname=.*basics.c.,line=.$line_main_return.*$m
i_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
Index: gdb/testsuite/gdb.mi/mi-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-return.exp,v
retrieving revision 1.11
diff -c -p -b -r1.11 mi-return.exp
*** gdb/testsuite/gdb.mi/mi-return.exp 15 Aug 2004 10:15:58 -0000
1.11
--- gdb/testsuite/gdb.mi/mi-return.exp 24 Mar 2005 18:34:14 -0000
*************** proc test_return_simple {} {
*** 53,59 ****
send_gdb "111-exec-return\n"
gdb_expect {
! -re
"111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[
.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_g
db_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
--- 53,59 ----
send_gdb "111-exec-return\n"
gdb_expect {
! -re
"111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[
.*\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee3_
close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
Index: gdb/testsuite/gdb.mi/mi-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stack.exp,v
retrieving revision 1.14
diff -c -p -b -r1.14 mi-stack.exp
*** gdb/testsuite/gdb.mi/mi-stack.exp 15 Aug 2004 10:15:58 -0000
1.14
--- gdb/testsuite/gdb.mi/mi-stack.exp 24 Mar 2005 18:34:14 -0000
*************** proc test_stack_frame_listing {} {
*** 57,63 ****
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
!
"231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\"
,file=\".*basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",a
ddr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",fun
c=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*
\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\"
,.*\}\\\]" \
--- 57,63 ----
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
!
"231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\"
,file=\".*basics.c\",fullname=\".*/basics.c\",line=\"$line_callee4_body\
"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{leve
l=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$
hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"mai
n\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\"
,.*\}\\\]" \
*************** set line_callee4_return_0 [gdb_get_line_
*** 161,167 ****
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",
thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\
],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_promp
t$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
--- 161,167 ----
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",
thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\
],file=\".*basics.c\",fullname=\".*/basics.c\",line=\"$line_callee4_retu
rn_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
Index: gdb/testsuite/gdb.mi/mi-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stepi.exp,v
retrieving revision 1.10
diff -c -p -b -r1.10 mi-stepi.exp
*** gdb/testsuite/gdb.mi/mi-stepi.exp 15 Aug 2004 10:15:58 -0000
1.10
--- gdb/testsuite/gdb.mi/mi-stepi.exp 24 Mar 2005 18:34:14 -0000
*************** proc test_stepi_nexti {} {
*** 53,59 ****
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re
"111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "step-instruction at main"
--- 53,59 ----
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re
"111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r
\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "step-instruction at main"
*************** proc test_stepi_nexti {} {
*** 67,73 ****
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re
"222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "next-instruction at main"
--- 67,73 ----
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re
"222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r
\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "next-instruction at main"
*************** proc test_stepi_nexti {} {
*** 81,87 ****
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re
"333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "next-instruction at main"
--- 81,87 ----
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re
"333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r
\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "next-instruction at main"
Index: gdb/testsuite/gdb.mi/mi-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-syn-frame.exp,v
retrieving revision 1.2
diff -c -p -b -r1.2 mi-syn-frame.exp
*** gdb/testsuite/gdb.mi/mi-syn-frame.exp 24 Feb 2003 20:15:47
-0000 1.2
--- gdb/testsuite/gdb.mi/mi-syn-frame.exp 24 Mar 2005 18:34:14
-0000
*************** gdb_expect {
*** 69,75 ****
}
}
! mi_gdb_test "404-stack-list-frames 0 0"
"404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",fi
le=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
--- 69,75 ----
}
}
! mi_gdb_test "404-stack-list-frames 0 0"
"404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",fi
le=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\
}.*\\\]"
#
*************** mi_gdb_test "406-data-evaluate-expressio
*** 83,89 ****
# We should have both a signal handler and a call dummy frame
# in this next output.
! mi_gdb_test "407-stack-list-frames"
"407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\
",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value
=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=
\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-sy
n-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\
"handler\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\
"2\",addr=\"$hex\",func=\"<signal handler
called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_ver
y_merry_interrupt\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=
\{level=\"$decimal\",addr=\"$hex\",func=\"<function called from
gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".
*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
send_gdb "408-exec-continue\n"
--- 83,89 ----
# We should have both a signal handler and a call dummy frame
# in this next output.
! mi_gdb_test "407-stack-list-frames"
"407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\
",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value
=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.
c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func
=\"subroutine\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",
line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",f
ile=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"
\},frame=\{level=\"2\",addr=\"$hex\",func=\"<signal handler
called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_ver
y_merry_interrupt\",file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.
c\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"
<function called from
gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".
*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\
]"
send_gdb "408-exec-continue\n"
*************** gdb_expect {
*** 96,102 ****
}
}
! mi_gdb_test "409-stack-list-frames 0 0"
"409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",fi
le=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
--- 96,102 ----
}
}
! mi_gdb_test "409-stack-list-frames 0 0"
"409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",fi
le=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\
}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
*************** mi_gdb_test "409-stack-list-frames 0 0"
*** 104,110 ****
mi_gdb_test "410-data-evaluate-expression bar()" "hi in
bar\[\r\n\]+\\&\"The program being debugged was signaled while in a
function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame
where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this
behavior use \\\\\"set unwindonsignal
on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the
function \\(bar\\) will be
abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged
was signaled while in a function called from GDB.\\\\nGDB remains in the
frame where the signal was received.\\\\nTo change this behavior use
\\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression
containing the function \\(bar\\) will be abandoned.\"" "call inferior
function which raises exception"
! mi_gdb_test "411-stack-list-frames"
"411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning
=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\
\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{
level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"
$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called
from
gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn
-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function
at exception"
mi_gdb_exit
--- 104,110 ----
mi_gdb_test "410-data-evaluate-expression bar()" "hi in
bar\[\r\n\]+\\&\"The program being debugged was signaled while in a
function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame
where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this
behavior use \\\\\"set unwindonsignal
on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the
function \\(bar\\) will be
abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged
was signaled while in a function called from GDB.\\\\nGDB remains in the
frame where the signal was received.\\\\nTo change this behavior use
\\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression
containing the function \\(bar\\) will be abandoned.\"" "call inferior
function which raises exception"
! mi_gdb_test "411-stack-list-frames"
"411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning
=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\
\\[\\\],file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$
decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",fil
e=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"},
frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from
gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn
-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]"
"backtrace from inferior function at exception"
mi_gdb_exit
Index: gdb/testsuite/gdb.mi/mi-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v
retrieving revision 1.8
diff -c -p -b -r1.8 mi-until.exp
*** gdb/testsuite/gdb.mi/mi-until.exp 9 Aug 2004 16:32:44 -0000
1.8
--- gdb/testsuite/gdb.mi/mi-until.exp 24 Mar 2005 18:34:14 -0000
*************** proc test_until {} {
*** 78,84 ****
send_gdb "111-exec-until\n"
gdb_expect {
! -re
"111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\
\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
--- 78,84 ----
send_gdb "111-exec-until\n"
gdb_expect {
! -re
"111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\
\\],file=\".*until.c\",fullname=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_p
rompt$" {
pass "until after while loop"
}
timeout {
*************** proc test_until {} {
*** 88,94 ****
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re
"222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\
],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
--- 88,94 ----
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re
"222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\
],file=\".*until.c\",fullname=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_pro
mpt$" {
pass "until line number"
}
timeout {
*************** proc test_until {} {
*** 98,104 ****
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re
"333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\
],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
--- 98,104 ----
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re
"333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\
],file=\".*until.c\",fullname=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_pro
mpt$" {
pass "until line number:file"
}
timeout {
*************** proc test_until {} {
*** 110,116 ****
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re
"444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\
\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
--- 110,116 ----
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re
"444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\
\],file=\".*until.c\",fullname=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_pr
ompt$" {
pass "until after current function"
}
timeout {
Index: gdb/testsuite/gdb.mi/mi-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-display.exp,v
retrieving revision 1.12
diff -c -p -b -r1.12 mi-var-display.exp
*** gdb/testsuite/gdb.mi/mi-var-display.exp 17 Aug 2004 09:38:29
-0000 1.12
--- gdb/testsuite/gdb.mi/mi-var-display.exp 24 Mar 2005 18:34:14
-0000
*************** mi_gdb_test "200-break-insert $line_dct_
*** 48,54 ****
mi_run_cmd
# The running part has been checked already by mi_run_cmd
gdb_expect {
! -re
"\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id
=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\
\],file=\".*var-cmd.c\",line=\"$line_dct_close_brace\"\}\r\n$mi_gdb_prom
pt$" {
pass "run to do_children_tests"
}
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
--- 48,54 ----
mi_run_cmd
# The running part has been checked already by mi_run_cmd
gdb_expect {
! -re
"\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id
=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\
\],file=\".*var-cmd.c\",fullname=\".*var-cmd.c\",line=\"$line_dct_close_
brace\"\}\r\n$mi_gdb_prompt$" {
pass "run to do_children_tests"
}
-re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
*************** mi_gdb_test "200-break-insert do_special
*** 332,338 ****
send_gdb "-exec-continue\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_te
sts\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"$line_dst_a_1\"\}\r\n$mi
_gdb_prompt$" {
pass "continue to do_special_tests"
}
timeout {
--- 332,338 ----
send_gdb "-exec-continue\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_te
sts\",args=\\\[\\\],file=\".*var-cmd.c\",fullname=\".*var-cmd.c\",line=\
"$line_dst_a_1\"\}\r\n$mi_gdb_prompt$" {
pass "continue to do_special_tests"
}
timeout {
*************** mi_gdb_test "200-break-insert incr_a" \
*** 592,601 ****
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args
=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"$line
_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args
=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"([expr
$line_incr_a_b_a - 2]|[expr $line_incr_a_b_a -
1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
--- 592,601 ----
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args
=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\".
*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args
=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\".*
var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a -
1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
Index: gdb/testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.11
diff -c -p -b -r1.11 mi-watch.exp
*** gdb/testsuite/gdb.mi/mi-watch.exp 15 Aug 2004 10:15:58 -0000
1.11
--- gdb/testsuite/gdb.mi/mi-watch.exp 24 Mar 2005 18:34:14 -0000
*************** proc test_watchpoint_triggering {} {
*** 139,145 ****
gdb_expect {
-re "222\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re
"222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\
"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$
hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"$line_ca
llee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "watchpoint trigger"
}
-re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
--- 139,145 ----
gdb_expect {
-re "222\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re
"222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\
"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$
hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",fullname=\".*ba
sics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_prompt$" {
pass "watchpoint trigger"
}
-re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
*************** proc test_watchpoint_triggering {} {
*** 154,160 ****
gdb_expect {
-re "223\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re
"\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-i
d=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file
=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_gdb_prompt$"
{
pass "wp out of scope"
}
-re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
--- 154,160 ----
gdb_expect {
-re "223\\^running\r\n$mi_gdb_prompt" {
gdb_expect {
! -re
"\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-i
d=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file
=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee3_close_brace
\"\}\r\n$mi_gdb_prompt$" {
pass "wp out of scope"
}
-re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
Index: gdb/testsuite/gdb.mi/mi2-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-cli.exp,v
retrieving revision 1.2
diff -c -p -b -r1.2 mi2-cli.exp
*** gdb/testsuite/gdb.mi/mi2-cli.exp 15 Aug 2004 10:15:58 -0000
1.2
--- gdb/testsuite/gdb.mi/mi2-cli.exp 24 Mar 2005 18:34:14 -0000
*************** mi_gdb_test "600-break-insert -t basics.
*** 161,171 ****
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! # {.*\*stopped.*,file=".*basics.c",line="$line_main_hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re
"700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,lin
e=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
--- 161,171 ----
"-break-insert -t basics.c:\$line_main_hello"
# mi_gdb_test "-exec-continue" \
! #
{.*\*stopped.*,file=".*basics.c",fullname=".*basics.c",line="$line_main_
hello"\}} \
# "-exec-continue to line \$line_main_hello"
send_gdb "700-exec-continue\n"
gdb_expect {
! -re
"700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,ful
lname=.*basics.c.,line=.$line_main_hello.*$mi_gdb_prompt$" {
pass "-exec-continue to line \$line_main_hello"
}
timeout {
*************** gdb_expect {
*** 175,185 ****
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! #
{.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="$lin
e_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re
"800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-r
ange.*,file=.*basics.c.,line=.$line_main_return.*$mi_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
--- 175,185 ----
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-exec-next" \
! #
{.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",fullname="
.*basics.c",line="$line_main_return"\}} \
# "-exec-next to line \$line_main_return"
send_gdb "800-exec-next\n"
gdb_expect {
! -re
"800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-r
ange.*,file=.*basics.c.,fullname=.*basics.c.,line=.$line_main_return.*$m
i_gdb_prompt$" {
pass "-exec-next to line \$line_main_return"
}
timeout {
Index: gdb/testsuite/gdb.mi/mi2-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-return.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi2-return.exp
*** gdb/testsuite/gdb.mi/mi2-return.exp 15 Aug 2004 10:15:58 -0000
1.3
--- gdb/testsuite/gdb.mi/mi2-return.exp 24 Mar 2005 18:34:14 -0000
*************** proc test_return_simple {} {
*** 53,59 ****
send_gdb "111-exec-return\n"
gdb_expect {
! -re
"111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[
.*\\\],file=\".*basics.c\",line=\"$line_callee3_close_brace\"\}\r\n$mi_g
db_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
--- 53,59 ----
send_gdb "111-exec-return\n"
gdb_expect {
! -re
"111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[
.*\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee3_
close_brace\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
-re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
timeout { fail "return from callee4 now (timeout)"
}
Index: gdb/testsuite/gdb.mi/mi2-stack.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-stack.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi2-stack.exp
*** gdb/testsuite/gdb.mi/mi2-stack.exp 15 Aug 2004 10:15:58 -0000
1.3
--- gdb/testsuite/gdb.mi/mi2-stack.exp 24 Mar 2005 18:34:14 -0000
*************** proc test_stack_frame_listing {} {
*** 57,63 ****
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
!
"231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\"
,file=\".*basics.c\",line=\"$line_callee4_body\"\},frame=\{level=\"1\",a
ddr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",fun
c=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*
\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\"
,.*\}\\\]" \
--- 57,63 ----
# -stack-list-frames 1 3
mi_gdb_test "231-stack-list-frames" \
!
"231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\"
,file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee4_body\"
\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level
=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$h
ex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main
\",.*\}\\\]" \
"stack frame listing"
mi_gdb_test "232-stack-list-frames 1 1" \
"232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\"
,.*\}\\\]" \
*************** set line_callee4_return_0 [gdb_get_line_
*** 160,166 ****
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",
thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\
],file=\".*basics.c\",line=\"$line_callee4_return_0\"\}\r\n$mi_gdb_promp
t$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
--- 160,166 ----
# step until A, B, C, have some reasonable values.
send_gdb "-exec-next 3\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",
thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\
],file=\".*basics.c\",fullname=\".*basics.c\",line=\"$line_callee4_retur
n_0\"\}\r\n$mi_gdb_prompt$" {
pass "next's in callee4"
}
timeout { fail "next in callee4 (timeout)" }
Index: gdb/testsuite/gdb.mi/mi2-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-stepi.exp,v
retrieving revision 1.3
diff -c -p -b -r1.3 mi2-stepi.exp
*** gdb/testsuite/gdb.mi/mi2-stepi.exp 15 Aug 2004 10:15:58 -0000
1.3
--- gdb/testsuite/gdb.mi/mi2-stepi.exp 24 Mar 2005 18:34:14 -0000
*************** proc test_stepi_nexti {} {
*** 53,59 ****
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re
"111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "step-instruction at main"
--- 53,59 ----
send_gdb "111-exec-step-instruction\n"
gdb_expect {
! -re
"111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r
\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "step-instruction at main"
*************** proc test_stepi_nexti {} {
*** 67,73 ****
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re
"222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "next-instruction at main"
--- 67,73 ----
}
send_gdb "222-exec-next-instruction\n"
gdb_expect {
! -re
"222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r
\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "next-instruction at main"
*************** proc test_stepi_nexti {} {
*** 81,87 ****
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re
"333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "next-instruction at main"
--- 81,87 ----
}
send_gdb "333-exec-next-instruction\n"
gdb_expect {
! -re
"333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[
\\\],file=\".*basics.c\",fullname=\".*basics.c\",line=\"(\[0-9\]+)\"\}\r
\n$mi_gdb_prompt$" {
set line $expect_out(1,string)
if { $line >= $line_main_body && $line <= $line_main_hello }
{
pass "next-instruction at main"
Index: gdb/testsuite/gdb.mi/mi2-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-syn-frame.exp,v
retrieving revision 1.1
diff -c -p -b -r1.1 mi2-syn-frame.exp
*** gdb/testsuite/gdb.mi/mi2-syn-frame.exp 7 Aug 2003 17:47:42
-0000 1.1
--- gdb/testsuite/gdb.mi/mi2-syn-frame.exp 24 Mar 2005 18:34:14
-0000
*************** gdb_expect {
*** 69,75 ****
}
}
! mi_gdb_test "404-stack-list-frames 0 0"
"404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",fi
le=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
--- 69,75 ----
}
}
! mi_gdb_test "404-stack-list-frames 0 0"
"404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",fi
le=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\
}.*\\\]"
#
*************** gdb_expect {
*** 96,102 ****
}
}
! mi_gdb_test "409-stack-list-frames 0 0"
"409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",fi
le=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
--- 96,102 ----
}
}
! mi_gdb_test "409-stack-list-frames 0 0"
"409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",fi
le=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"\
}.*\\\]"
#
# Call bar() by hand, which should get an exception while running.
*************** mi_gdb_test "409-stack-list-frames 0 0"
*** 104,110 ****
mi_gdb_test "410-data-evaluate-expression bar()" "hi in
bar\[\r\n\]+\\&\"The program being debugged was signaled while in a
function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame
where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this
behavior use \\\\\"set unwindonsignal
on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the
function \\(bar\\) will be
abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged
was signaled while in a function called from GDB.\\\\nGDB remains in the
frame where the signal was received.\\\\nTo change this behavior use
\\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression
containing the function \\(bar\\) will be abandoned.\"" "call inferior
function which raises exception"
! mi_gdb_test "411-stack-list-frames"
"411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning
=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\
\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{
level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"
$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called
from
gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn
-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function
at exception"
mi_gdb_exit
--- 104,110 ----
mi_gdb_test "410-data-evaluate-expression bar()" "hi in
bar\[\r\n\]+\\&\"The program being debugged was signaled while in a
function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame
where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this
behavior use \\\\\"set unwindonsignal
on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the
function \\(bar\\) will be
abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged
was signaled while in a function called from GDB.\\\\nGDB remains in the
frame where the signal was received.\\\\nTo change this behavior use
\\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression
containing the function \\(bar\\) will be abandoned.\"" "call inferior
function which raises exception"
! mi_gdb_test "411-stack-list-frames"
"411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning
=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\
\\[\\\],file=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$
decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",fil
e=\".*mi-syn-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"},
frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from
gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn
-frame.c\",fullname=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]"
"backtrace from inferior function at exception"
mi_gdb_exit
Index: gdb/testsuite/gdb.mi/mi2-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-until.exp,v
retrieving revision 1.2
diff -c -p -b -r1.2 mi2-until.exp
*** gdb/testsuite/gdb.mi/mi2-until.exp 9 Aug 2004 22:21:54 -0000
1.2
--- gdb/testsuite/gdb.mi/mi2-until.exp 24 Mar 2005 18:34:14 -0000
*************** proc test_until {} {
*** 78,84 ****
send_gdb "111-exec-until\n"
gdb_expect {
! -re
"111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\
\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
pass "until after while loop"
}
timeout {
--- 78,84 ----
send_gdb "111-exec-until\n"
gdb_expect {
! -re
"111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-ra
nge\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\
\\],file=\".*until.c\",fullname=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_p
rompt$" {
pass "until after while loop"
}
timeout {
*************** proc test_until {} {
*** 88,94 ****
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re
"222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\
],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
pass "until line number"
}
timeout {
--- 88,94 ----
send_gdb "222-exec-until 15\n"
gdb_expect {
! -re
"222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\
],file=\".*until.c\",fullname=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_pro
mpt$" {
pass "until line number"
}
timeout {
*************** proc test_until {} {
*** 98,104 ****
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re
"333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\
],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
pass "until line number:file"
}
timeout {
--- 98,104 ----
send_gdb "333-exec-until until.c:17\n"
gdb_expect {
! -re
"333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\
],file=\".*until.c\",fullname=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_pro
mpt$" {
pass "until line number:file"
}
timeout {
*************** proc test_until {} {
*** 110,116 ****
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re
"444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\
\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
pass "until after current function"
}
timeout {
--- 110,116 ----
send_gdb "444-exec-until until.c:25\n"
gdb_expect {
! -re
"444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reache
d\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\
\],file=\".*until.c\",fullname=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_pr
ompt$" {
pass "until after current function"
}
timeout {
Index: gdb/testsuite/gdb.mi/mi2-var-display.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-var-display.exp,v
retrieving revision 1.4
diff -c -p -b -r1.4 mi2-var-display.exp
*** gdb/testsuite/gdb.mi/mi2-var-display.exp 17 Aug 2004 09:38:29
-0000 1.4
--- gdb/testsuite/gdb.mi/mi2-var-display.exp 24 Mar 2005 18:34:15
-0000
*************** mi_gdb_test "200-break-insert incr_a" \
*** 592,601 ****
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args
=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"$line
_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args
=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"([expr
$line_incr_a_b_a - 2]|[expr $line_incr_a_b_a -
1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
--- 592,601 ----
"break-insert operation"
send_gdb "-exec-continue\n"
gdb_expect {
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args
=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\".
*var-cmd.c\",line=\"$line_incr_a_b_a\"\}\r\n$mi_gdb_prompt$" {
pass "continue to incr_a"
}
! -re
"\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkpt
no=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args
=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",fullname=\".*
var-cmd.c\",line=\"([expr $line_incr_a_b_a - 2]|[expr $line_incr_a_b_a -
1]|$line_incr_a_b_a)\"\}\r\n$mi_gdb_prompt$" {
fail "continue to incr_a (compiler debug info incorrect)"
}
-re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.25
diff -c -p -b -r1.25 mi-support.exp
*** gdb/testsuite/lib/mi-support.exp 14 Mar 2005 15:42:52 -0000
1.25
--- gdb/testsuite/lib/mi-support.exp 24 Mar 2005 18:34:15 -0000
*************** proc mi_runto {func} {
*** 813,819 ****
mi_run_cmd
gdb_expect {
! -re
".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=
\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.
*\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
pass "$test"
return 0
}
--- 813,819 ----
mi_run_cmd
gdb_expect {
! -re
".*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"$bkptno\",thread-id=
\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.
*\}\),file=\".*\",fullname=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$
" {
pass "$test"
return 0
}
*************** proc mi_execute_to_helper { cmd reason f
*** 859,869 ****
global decimal
send_gdb "220-$cmd\n"
gdb_expect {
! -re
".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",t
hread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,fi
le=\".*$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\",t
hread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].
*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
fail "$test (stopped at wrong place)"
return -1
}
--- 859,869 ----
global decimal
send_gdb "220-$cmd\n"
gdb_expect {
! -re
".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",t
hread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,fi
le=\".*$file\",fullname=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_pr
ompt$" {
pass "$test"
return 0
}
! -re
".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",t
hread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].
*\[\\\]\}\],file=\".*\",fullname=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb
_prompt$" {
fail "$test (stopped at wrong place)"
return -1
}
^ permalink raw reply [flat|nested] 103+ messages in thread* [RFC] fullname attribute for GDB/MI stack frames
@ 2005-03-23 22:22 Dennis Brueni
2005-03-23 22:34 ` Bob Rossi
0 siblings, 1 reply; 103+ messages in thread
From: Dennis Brueni @ 2005-03-23 22:22 UTC (permalink / raw)
To: gdb-patches; +Cc: Dennis Brueni
Using the GDB/MI interface, there is no direct way to get the
absolute path name of a source file referenced in a stack frame.
All that is reported is the relative path of the source file.
This makes it tedious to locate the correct source file and
and especially difficult in the case where source files in
different directories share the same file name.
The following patch fixes the code that reports stack frames
to append a "fullname" attribute to each stack frame, reporting
the absolute path name of the source file. This effects MI output
mode only and does not hurt performance.
--Dennis Brueni
dennis@slickedit.com
Index: gdb/stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
$ diff -c -p -b stack.c-6.3 stack.c
*** stack.c-6.3 Wed Mar 23 17:03:57 2005
--- stack.c Wed Mar 23 15:40:11 2005
*************** print_frame (struct frame_info *fi,
*** 666,671 ****
--- 666,679 ----
ui_out_text (uiout, " at ");
annotate_frame_source_file ();
ui_out_field_string (uiout, "file", sal.symtab->filename);
+ if (ui_out_is_mi_like_p(uiout)) {
+ if (!sal.symtab->fullname) {
+ source_full_path_of(sal.symtab->filename,
&sal.symtab->fullname);
+ }
+ if (sal.symtab->fullname) {
+ ui_out_field_string (uiout, "fullname",
sal.symtab->fullname);
+ }
+ }
annotate_frame_source_file_end ();
ui_out_text (uiout, ":");
annotate_frame_source_line ();
------------------------
Dennis Brueni
Software Engineer
SlickEdit Inc.
3000 Aerial Center Pkwy, Suite 120
Morrisville, NC 27560
919.473.0132
Fax: 919.473.0080
http://www.slickedit.com
------------------------
^ permalink raw reply [flat|nested] 103+ messages in thread* Re: [RFC] fullname attribute for GDB/MI stack frames
2005-03-23 22:22 Dennis Brueni
@ 2005-03-23 22:34 ` Bob Rossi
0 siblings, 0 replies; 103+ messages in thread
From: Bob Rossi @ 2005-03-23 22:34 UTC (permalink / raw)
To: Dennis Brueni; +Cc: gdb-patches
> The following patch fixes the code that reports stack frames
> to append a "fullname" attribute to each stack frame, reporting
> the absolute path name of the source file. This effects MI output
> mode only and does not hurt performance.
>
> Index: gdb/stack.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/stack.c,v
>
> $ diff -c -p -b stack.c-6.3 stack.c
> *** stack.c-6.3 Wed Mar 23 17:03:57 2005
> --- stack.c Wed Mar 23 15:40:11 2005
> *************** print_frame (struct frame_info *fi,
> *** 666,671 ****
> --- 666,679 ----
> ui_out_text (uiout, " at ");
> annotate_frame_source_file ();
> ui_out_field_string (uiout, "file", sal.symtab->filename);
> + if (ui_out_is_mi_like_p(uiout)) {
> + if (!sal.symtab->fullname) {
> + source_full_path_of(sal.symtab->filename,
> &sal.symtab->fullname);
> + }
> + if (sal.symtab->fullname) {
> + ui_out_field_string (uiout, "fullname",
> sal.symtab->fullname);
> + }
> + }
> annotate_frame_source_file_end ();
> ui_out_text (uiout, ":");
> annotate_frame_source_line ();
This is great, I've was eventually going to get to this. Although I'm
not the maintainer, I have a few comments,
You should probably be using symtab_to_fullname instead of
source_full_path_of. In fact, maybe source_full_path_of should be
deprecated. symtab_to_fullname is used in mi/mi-cmd-file.c.
Also, there should be a corresponding testcase, that ensures the new
field is working properly.
Thanks,
Bob Rossi
^ permalink raw reply [flat|nested] 103+ messages in thread
end of thread, other threads:[~2005-05-18 3:43 UTC | newest]
Thread overview: 103+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-05 15:15 [RFC] fullname attribute for GDB/MI stack frames Dennis Brueni
2005-05-05 15:25 ` Bob Rossi
2005-05-05 15:28 ` Daniel Jacobowitz
2005-05-05 15:32 ` Bob Rossi
-- strict thread matches above, loose matches on Subject: below --
2005-05-02 14:22 Dennis Brueni
2005-05-02 19:38 ` Eli Zaretskii
2005-04-01 19:13 Dennis Brueni
2005-04-02 9:22 ` Eli Zaretskii
2005-04-30 19:18 ` Daniel Jacobowitz
2005-05-01 2:19 ` Bob Rossi
2005-05-01 18:24 ` Eli Zaretskii
2005-05-01 18:34 ` Bob Rossi
2005-05-01 19:02 ` Daniel Jacobowitz
2005-05-02 0:55 ` Bob Rossi
2005-05-02 0:54 ` Bob Rossi
2005-05-02 0:58 ` Daniel Jacobowitz
2005-05-02 19:30 ` Eli Zaretskii
2005-05-02 19:36 ` Bob Rossi
2005-05-02 19:52 ` Eli Zaretskii
2005-05-02 19:55 ` Daniel Jacobowitz
2005-05-02 20:42 ` Eli Zaretskii
2005-05-02 20:49 ` Daniel Jacobowitz
2005-05-02 21:20 ` Bob Rossi
2005-05-03 3:49 ` Eli Zaretskii
2005-05-03 3:42 ` Eli Zaretskii
2005-05-03 3:46 ` Daniel Jacobowitz
2005-05-03 19:36 ` Eli Zaretskii
2005-05-03 19:49 ` Daniel Jacobowitz
2005-05-03 20:05 ` Bob Rossi
2005-05-03 20:49 ` Eli Zaretskii
2005-05-04 13:34 ` Daniel Jacobowitz
2005-05-04 13:51 ` Bob Rossi
2005-05-04 13:52 ` Daniel Jacobowitz
2005-05-04 17:51 ` Eli Zaretskii
2005-05-04 18:06 ` Bob Rossi
2005-05-04 20:32 ` Eli Zaretskii
2005-05-04 18:05 ` Eli Zaretskii
2005-05-04 18:32 ` Daniel Jacobowitz
2005-05-04 20:53 ` Eli Zaretskii
2005-05-04 21:07 ` Daniel Jacobowitz
2005-05-04 21:42 ` Eli Zaretskii
2005-05-04 22:01 ` Daniel Jacobowitz
2005-05-04 23:42 ` Christopher Faylor
2005-05-05 4:15 ` Eli Zaretskii
2005-05-04 23:40 ` Christopher Faylor
2005-05-05 0:05 ` Bob Rossi
2005-05-05 4:02 ` Eli Zaretskii
2005-05-04 23:37 ` Christopher Faylor
2005-05-05 4:05 ` Eli Zaretskii
2005-05-03 19:57 ` Bob Rossi
2005-05-03 21:15 ` Eli Zaretskii
2005-05-03 21:39 ` Bob Rossi
2005-05-03 22:14 ` Christopher Faylor
2005-05-04 4:08 ` Eli Zaretskii
2005-05-04 13:39 ` Daniel Jacobowitz
2005-05-04 17:49 ` Eli Zaretskii
2005-05-04 4:18 ` Eli Zaretskii
2005-05-03 21:39 ` Christopher Faylor
2005-05-03 22:24 ` Daniel Jacobowitz
2005-05-03 22:27 ` Christopher Faylor
2005-05-04 2:32 ` Bob Rossi
2005-05-04 3:05 ` Christopher Faylor
2005-05-04 17:42 ` Eli Zaretskii
2005-05-04 4:12 ` Eli Zaretskii
2005-05-04 13:00 ` Daniel Jacobowitz
2005-05-04 4:27 ` Eli Zaretskii
2005-05-04 11:48 ` Bob Rossi
2005-05-04 14:55 ` Christopher Faylor
2005-05-04 15:02 ` Bob Rossi
2005-05-04 17:43 ` Eli Zaretskii
2005-05-04 17:58 ` Christopher Faylor
2005-05-04 18:29 ` Eli Zaretskii
2005-05-04 20:39 ` Eli Zaretskii
2005-05-04 23:34 ` Christopher Faylor
2005-05-05 4:08 ` Eli Zaretskii
2005-05-04 13:45 ` Daniel Jacobowitz
2005-05-04 20:20 ` Eli Zaretskii
2005-05-04 20:30 ` Daniel Jacobowitz
2005-05-04 21:24 ` Eli Zaretskii
2005-05-04 14:52 ` Christopher Faylor
2005-05-04 17:48 ` Eli Zaretskii
2005-05-04 18:03 ` Christopher Faylor
2005-05-04 18:26 ` Eli Zaretskii
2005-05-03 22:50 ` Bob Rossi
2005-05-04 4:04 ` Eli Zaretskii
2005-05-05 17:20 ` Bob Rossi
2005-05-05 18:04 ` Eli Zaretskii
2005-05-05 19:18 ` Christopher Faylor
2005-05-05 23:53 ` Bob Rossi
2005-05-05 16:22 ` Bob Rossi
2005-05-05 16:26 ` Daniel Jacobowitz
2005-05-05 16:46 ` Bob Rossi
2005-05-05 17:17 ` Daniel Jacobowitz
2005-05-18 4:44 ` Daniel Jacobowitz
2005-04-01 15:09 Dennis Brueni
2005-03-29 20:43 Dennis Brueni
2005-03-30 4:46 ` Eli Zaretskii
2005-04-01 1:41 ` Bob Rossi
2005-03-26 13:43 Eli Zaretskii
2005-03-26 13:50 ` Bob Rossi
2005-03-24 20:49 Dennis Brueni
2005-03-23 22:22 Dennis Brueni
2005-03-23 22:34 ` Bob Rossi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox