* [RFA/RFC] Report the original location specification for a breakpoint.
@ 2008-04-15 11:52 Vladimir Prus
2008-04-17 9:16 ` Daniel Jacobowitz
0 siblings, 1 reply; 13+ messages in thread
From: Vladimir Prus @ 2008-04-15 11:52 UTC (permalink / raw)
To: gdb-patches
Presently, GDB/MI fails to report the *original* location specified
for a breakpoint. As result, it's not possible to tell a breakpoint
create by:
break foo
from a breakpoint create by
break foo.cpp:10
This is not very nice for frontends, because if users adds a breakpoint
in GDB console, it is desirable to show the breakpoint in the breakpoints
window exactly as user have set it. Furthermore, is the list of breakpoints
is persisted by the frontend, it is crucial to persist it using the original
location. If the program source is modified, the difference betweeen foo and
foo.cpp:10 becomes significant.
This patch adds the necessary MI support for reporting the original location.
It's not ready to be checked in because MI testsuite will likely break all over.
OTOH, I've tested this with KDevelop4, and it works just fine. I'll fix this
before committing.
Is this patch OK?
In fact, I wonder if I can commit patches like this, that touch files
outside of MI code but apparently change behaviour only for MI, without
approval. Any comments?
- Volodya
---
gdb/breakpoint.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6830efe..01e0a9b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3683,6 +3683,10 @@ print_one_breakpoint_location (struct breakpoint *b,
print_command_lines (uiout, l, 4);
do_cleanups (script_chain);
}
+
+ if (!part_of_multiple && b->addr_string)
+ ui_out_field_string (uiout, "original-location", b->addr_string);
+
do_cleanups (bkpt_chain);
do_cleanups (old_chain);
}
--
1.5.3.5
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFA/RFC] Report the original location specification for a breakpoint.
2008-04-15 11:52 [RFA/RFC] Report the original location specification for a breakpoint Vladimir Prus
@ 2008-04-17 9:16 ` Daniel Jacobowitz
2008-04-17 11:52 ` Vladimir Prus
0 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2008-04-17 9:16 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
On Tue, Apr 15, 2008 at 02:34:57PM +0400, Vladimir Prus wrote:
> This patch adds the necessary MI support for reporting the original location.
> It's not ready to be checked in because MI testsuite will likely break all over.
> OTOH, I've tested this with KDevelop4, and it works just fine. I'll fix this
> before committing.
>
> Is this patch OK?
>
> In fact, I wonder if I can commit patches like this, that touch files
> outside of MI code but apparently change behaviour only for MI, without
> approval. Any comments?
Isn't this going to affect more than MI? I thought the text from
ui_out_field_string was displayed for console too, just without the
label.
This definitely needs documentation to go in. I can't say this
enough. Undocumented fields in the MI output might as well not exist.
Beyond those, I don't see a problem with it. Though wouldn't we like
to display this in the CLI sometimes too?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFA/RFC] Report the original location specification for a breakpoint.
2008-04-17 9:16 ` Daniel Jacobowitz
@ 2008-04-17 11:52 ` Vladimir Prus
2008-04-17 12:35 ` Nick Roberts
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Vladimir Prus @ 2008-04-17 11:52 UTC (permalink / raw)
To: gdb-patches
On Thursday 17 April 2008 06:57:49 Daniel Jacobowitz wrote:
> On Tue, Apr 15, 2008 at 02:34:57PM +0400, Vladimir Prus wrote:
> > This patch adds the necessary MI support for reporting the original location.
> > It's not ready to be checked in because MI testsuite will likely break all over.
> > OTOH, I've tested this with KDevelop4, and it works just fine. I'll fix this
> > before committing.
> >
> > Is this patch OK?
> >
> > In fact, I wonder if I can commit patches like this, that touch files
> > outside of MI code but apparently change behaviour only for MI, without
> > approval. Any comments?
>
> Isn't this going to affect more than MI? I thought the text from
> ui_out_field_string was displayed for console too, just without the
> label.
I don't this so, but I'll check. We can always make this field output
just for MI.
> This definitely needs documentation to go in. I can't say this
> enough. Undocumented fields in the MI output might as well not exist.
Yes, of course.
> Beyond those, I don't see a problem with it. Though wouldn't we like
> to display this in the CLI sometimes too?
I have no idea. I'd much rather have somebody else decide what CLI should
contain.
- Volodya
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFA/RFC] Report the original location specification for a breakpoint.
2008-04-17 11:52 ` Vladimir Prus
@ 2008-04-17 12:35 ` Nick Roberts
2008-04-17 15:28 ` Vladimir Prus
2008-04-17 17:51 ` Daniel Jacobowitz
2008-04-24 11:45 ` [RFA/RFC] Report the original location specification for a breakpoint Vladimir Prus
2 siblings, 1 reply; 13+ messages in thread
From: Nick Roberts @ 2008-04-17 12:35 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
> > Isn't this going to affect more than MI? I thought the text from
> > ui_out_field_string was displayed for console too, just without the
> > label.
>
> I don't this so, but I'll check. We can always make this field output
> just for MI.
It's used by "info breakpoints".
> > This definitely needs documentation to go in. I can't say this
> > enough. Undocumented fields in the MI output might as well not exist.
There are already many other fields that aren't documented, e.g.,
pending, what, cond, ignore etc. In fact the MI output of -break-insert
is very variable.
> Yes, of course.
>
> > Beyond those, I don't see a problem with it. Though wouldn't we like
> > to display this in the CLI sometimes too?
>
> I have no idea. I'd much rather have somebody else decide what CLI should
> contain.
>
> - Volodya
>
>
>
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFA/RFC] Report the original location specification for a breakpoint.
2008-04-17 12:35 ` Nick Roberts
@ 2008-04-17 15:28 ` Vladimir Prus
2008-04-17 21:17 ` Nick Roberts
0 siblings, 1 reply; 13+ messages in thread
From: Vladimir Prus @ 2008-04-17 15:28 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb-patches
On Thursday 17 April 2008 14:17:12 Nick Roberts wrote:
> > > Isn't this going to affect more than MI? I thought the text from
> > > ui_out_field_string was displayed for console too, just without the
> > > label.
> >
> > I don't this so, but I'll check. We can always make this field output
> > just for MI.
>
> It's used by "info breakpoints".
What's "it" above?
Anyway, it appears that the field indeed gets output in CLI mode, so I'll
adjust my patch not to do that.
>
> > > This definitely needs documentation to go in. I can't say this
> > > enough. Undocumented fields in the MI output might as well not exist.
>
> There are already many other fields that aren't documented, e.g.,
> pending, what, cond, ignore etc. In fact the MI output of -break-insert
> is very variable.
Are you volunteering to document that?
- Volodya
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFA/RFC] Report the original location specification for a breakpoint.
2008-04-17 11:52 ` Vladimir Prus
2008-04-17 12:35 ` Nick Roberts
@ 2008-04-17 17:51 ` Daniel Jacobowitz
2008-04-17 21:25 ` Joel Brobecker
2008-04-24 11:45 ` [RFA/RFC] Report the original location specification for a breakpoint Vladimir Prus
2 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2008-04-17 17:51 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
On Thu, Apr 17, 2008 at 01:59:08PM +0400, Vladimir Prus wrote:
> > Beyond those, I don't see a problem with it. Though wouldn't we like
> > to display this in the CLI sometimes too?
>
> I have no idea. I'd much rather have somebody else decide what CLI should
> contain.
Well, it would be nice to show if we could fit it, but I don't see
where.
By the way, here's where that duplicate addr= came from in GDB 6.8:
if (header_of_multiple)
ui_out_field_string (uiout, "addr", "<MULTIPLE>");
if (b->loc == NULL || loc->shlib_disabled)
ui_out_field_string (uiout, "addr", "<PENDING>");
else
ui_out_field_core_addr (uiout, "addr", loc->address);
Should that be else if?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFA/RFC] Report the original location specification for a breakpoint.
2008-04-17 15:28 ` Vladimir Prus
@ 2008-04-17 21:17 ` Nick Roberts
0 siblings, 0 replies; 13+ messages in thread
From: Nick Roberts @ 2008-04-17 21:17 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
> > It's used by "info breakpoints".
>
> What's "it" above?
ui_out_field_string always outputs to both MI and CLI, and this part of the
code is traversed by "info breakpoints" (and "-break-list"). By comparison,
it's also traversed by "-break-insert" but _not_ by "break".
> Anyway, it appears that the field indeed gets output in CLI mode, so I'll
> adjust my patch not to do that.
>
> >
> > > > This definitely needs documentation to go in. I can't say this
> > > > enough. Undocumented fields in the MI output might as well not exist.
> >
> > There are already many other fields that aren't documented, e.g.,
> > pending, what, cond, ignore etc. In fact the MI output of -break-insert
> > is very variable.
>
> Are you volunteering to document that?
No, I'm just doing a reality check.
--
Nick http://www.inet.net.nz/~nickrob
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFA/RFC] Report the original location specification for a breakpoint.
2008-04-17 17:51 ` Daniel Jacobowitz
@ 2008-04-17 21:25 ` Joel Brobecker
2008-04-17 21:31 ` Daniel Jacobowitz
0 siblings, 1 reply; 13+ messages in thread
From: Joel Brobecker @ 2008-04-17 21:25 UTC (permalink / raw)
To: Vladimir Prus, gdb-patches
> By the way, here's where that duplicate addr= came from in GDB 6.8:
>
> if (header_of_multiple)
> ui_out_field_string (uiout, "addr", "<MULTIPLE>");
> if (b->loc == NULL || loc->shlib_disabled)
> ui_out_field_string (uiout, "addr", "<PENDING>");
> else
> ui_out_field_core_addr (uiout, "addr", loc->address);
>
> Should that be else if?
ARGH#&! That's my fault. I think so, I think I meant "else if".
I don't see why we couldn't have header_of_multiple and
loc->shlib_disabled set at the same time.
Let me know if you'd like me to fix this.
--
Joel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFA/RFC] Report the original location specification for a breakpoint.
2008-04-17 21:25 ` Joel Brobecker
@ 2008-04-17 21:31 ` Daniel Jacobowitz
2008-04-17 23:08 ` [commit] print breakpoint address only once (branch?) Joel Brobecker
0 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2008-04-17 21:31 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Vladimir Prus, gdb-patches
On Thu, Apr 17, 2008 at 02:15:42PM -0700, Joel Brobecker wrote:
> ARGH#&! That's my fault. I think so, I think I meant "else if".
> I don't see why we couldn't have header_of_multiple and
> loc->shlib_disabled set at the same time.
>
> Let me know if you'd like me to fix this.
Yes please.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 13+ messages in thread
* [commit] print breakpoint address only once (branch?)
2008-04-17 21:31 ` Daniel Jacobowitz
@ 2008-04-17 23:08 ` Joel Brobecker
2008-04-17 23:21 ` Daniel Jacobowitz
0 siblings, 1 reply; 13+ messages in thread
From: Joel Brobecker @ 2008-04-17 23:08 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 364 bytes --]
> > Let me know if you'd like me to fix this.
>
> Yes please.
Ok, fixed thusly:
2008-04-17 Joel Brobecker <brobecker@adacore.com>
* breakpoint.c (print_one_breakpoint_location): Make sure to print
the breakpoint address only once.
Tested on x86-linux, no regression.
I think this should probably go in 6.8 as well. Any objection?
--
Joel
[-- Attachment #2: bp.diff --]
[-- Type: text/plain, Size: 694 bytes --]
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.308
diff -u -p -r1.308 breakpoint.c
--- breakpoint.c 15 Apr 2008 14:32:12 -0000 1.308
+++ breakpoint.c 17 Apr 2008 22:41:53 -0000
@@ -3607,7 +3607,7 @@ print_one_breakpoint_location (struct br
annotate_field (4);
if (header_of_multiple)
ui_out_field_string (uiout, "addr", "<MULTIPLE>");
- if (b->loc == NULL || loc->shlib_disabled)
+ else if (b->loc == NULL || loc->shlib_disabled)
ui_out_field_string (uiout, "addr", "<PENDING>");
else
ui_out_field_core_addr (uiout, "addr", loc->address);
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [commit] print breakpoint address only once (branch?)
2008-04-17 23:08 ` [commit] print breakpoint address only once (branch?) Joel Brobecker
@ 2008-04-17 23:21 ` Daniel Jacobowitz
2008-04-19 2:08 ` Joel Brobecker
0 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2008-04-17 23:21 UTC (permalink / raw)
To: gdb-patches
On Thu, Apr 17, 2008 at 03:44:47PM -0700, Joel Brobecker wrote:
> I think this should probably go in 6.8 as well. Any objection?
Not from me. Thanks.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [commit] print breakpoint address only once (branch?)
2008-04-17 23:21 ` Daniel Jacobowitz
@ 2008-04-19 2:08 ` Joel Brobecker
0 siblings, 0 replies; 13+ messages in thread
From: Joel Brobecker @ 2008-04-19 2:08 UTC (permalink / raw)
To: gdb-patches
> > I think this should probably go in 6.8 as well. Any objection?
>
> Not from me. Thanks.
Cool! Checked in the branch as well.
Thanks,
--
Joel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [RFA/RFC] Report the original location specification for a breakpoint.
2008-04-17 11:52 ` Vladimir Prus
2008-04-17 12:35 ` Nick Roberts
2008-04-17 17:51 ` Daniel Jacobowitz
@ 2008-04-24 11:45 ` Vladimir Prus
2 siblings, 0 replies; 13+ messages in thread
From: Vladimir Prus @ 2008-04-24 11:45 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 925 bytes --]
Vladimir Prus wrote:
> On Thursday 17 April 2008 06:57:49 Daniel Jacobowitz wrote:
>> On Tue, Apr 15, 2008 at 02:34:57PM +0400, Vladimir Prus wrote:
>> > This patch adds the necessary MI support for reporting the original location.
>> > It's not ready to be checked in because MI testsuite will likely break all over.
>> > OTOH, I've tested this with KDevelop4, and it works just fine. I'll fix this
>> > before committing.
>> >
>> > Is this patch OK?
>> >
>> > In fact, I wonder if I can commit patches like this, that touch files
>> > outside of MI code but apparently change behaviour only for MI, without
>> > approval. Any comments?
>>
>> Isn't this going to affect more than MI? I thought the text from
>> ui_out_field_string was displayed for console too, just without the
>> label.
>
> I don't this so, but I'll check. We can always make this field output
> just for MI.
I've checked in the below.
- Volodya
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: commit.diff --]
[-- Type: text/x-diff; name="commit.diff", Size: 29808 bytes --]
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.9307
diff -u -p -r1.9307 ChangeLog
--- gdb/ChangeLog 23 Apr 2008 21:17:04 -0000 1.9307
+++ gdb/ChangeLog 24 Apr 2008 08:45:16 -0000
@@ -1,3 +1,9 @@
+2008-04-24 Vladimir Prus <vladimir@codesourcery.com>
+
+ * breakpoint.c (print_one_breakpoint_location): In MI
+ mode, report the location string the breakpoint was
+ originally created with.
+
2008-04-23 Maxim Grigoriev <maxim2405@gmail.com>
* Makefile.in (xtensa-tdep.o): Update dependencies.
Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.310
diff -u -p -r1.310 breakpoint.c
--- gdb/breakpoint.c 18 Apr 2008 00:41:28 -0000 1.310
+++ gdb/breakpoint.c 24 Apr 2008 08:45:16 -0000
@@ -3696,6 +3696,15 @@ print_one_breakpoint_location (struct br
print_command_lines (uiout, l, 4);
do_cleanups (script_chain);
}
+
+ if (ui_out_is_mi_like_p (uiout) && !part_of_multiple)
+ {
+ if (b->addr_string)
+ ui_out_field_string (uiout, "original-location", b->addr_string);
+ else if (b->exp_string)
+ ui_out_field_string (uiout, "original-location", b->exp_string);
+ }
+
do_cleanups (bkpt_chain);
do_cleanups (old_chain);
}
Index: gdb/testsuite/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v
retrieving revision 1.1615
diff -u -p -r1.1615 ChangeLog
--- gdb/testsuite/ChangeLog 23 Apr 2008 12:21:50 -0000 1.1615
+++ gdb/testsuite/ChangeLog 24 Apr 2008 08:45:17 -0000
@@ -1,5 +1,24 @@
+2008-04-24 Vladimir Prus <vladimir@codesourcery.com>
+
+ * lib/mi-support.exp (mi_runto_helper): Adjust
+ for the original-location field.
+ (mi_create_breakpoint, mi_list_breakpoints): New.
+ * gdb.mi/mi-break.exp: Adjust.
+ * gdb.mi/mi2-break.exp: Adjust.
+ * gdb.mi/mi-pending.exp: Adjust.
+ * gdb.mi/mi-simplerun.exp: Adjust.
+ * gdb.mi/mi2-simplerun.exp: Adjust.
+ * gdb.mi/mi-syn-frame.exp: Adjust.
+ * gdb.mi/mi2-syn-frame.exp: Adjust.
+ * gdb.mi/mi-until.exp: Adjust.
+ * gdb.mi/mi2-until.exp: Adjust.
+ * gdb.mi/mi-var-display.exp: Adjust.
+ * gdb.mi/mi2-var-display.exp: Adjust.
+ * gdb.mi/mi-watch.exp: Adjust.
+ * gdb.mi/mi2-watch.exp: Adjust.
+
2008-04-23 Paolo Bonzini <bonzini@gnu.org>
-
+
* aclocal.m4: Add override.m4.
* configure: Regenerate.
@@ -13,7 +32,7 @@
* gdb.dwarf2/dw2-compressed.S, gdb.dwarf2/dw2-compressed.exp: New
files.
-
+
2008-04-18 Joel Brobecker <brobecker@adacore.com>
* gdb.ada/atomic_enum: New test program.
Index: gdb/testsuite/gdb.mi/mi-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
retrieving revision 1.16
diff -u -p -r1.16 mi-break.exp
--- gdb/testsuite/gdb.mi/mi-break.exp 27 Feb 2008 20:29:31 -0000 1.16
+++ gdb/testsuite/gdb.mi/mi-break.exp 24 Apr 2008 08:45:17 -0000
@@ -78,25 +78,21 @@ proc test_tbreak_creation_and_listing {}
# -break-insert -t srcfile:$line_callee4_head
# -break-list
- mi_gdb_test "222-break-insert -t main" \
- "222\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\"\}" \
+ mi_create_breakpoint "-t main" 1 del main ".*basics.c" $line_main_body $hex \
"break-insert -t operation"
- mi_gdb_test "333-break-insert -t basics.c:callee2" \
- "333\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",times=\"0\"\}" \
+ mi_create_breakpoint "-t basics.c:callee2" 2 del callee2 ".*basics.c" $line_callee2_body $hex \
"insert temp breakpoint at basics.c:callee2"
- mi_gdb_test "444-break-insert -t basics.c:$line_callee3_head" \
- "444\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",${fullname},line=\"$line_callee3_body\",times=\"0\"\}" \
+ mi_create_breakpoint "-t basics.c:$line_callee3_head" 3 del callee3 ".*basics.c" $line_callee3_body $hex \
"insert temp breakpoint at basics.c:\$line_callee3_head"
# Getting the quoting right is tricky. That is "\"<file>\":$line_callee4_head"
- mi_gdb_test "555-break-insert -t \"\\\"${srcfile}\\\":$line_callee4_head\"" \
- "555\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",${fullname},line=\"$line_callee4_body\",times=\"0\"\}" \
+ mi_create_breakpoint "-t \"\\\"${srcfile}\\\":$line_callee4_head\"" 4 del callee4 ".*basics.c" $line_callee4_body $hex \
"insert temp breakpoint at \"<fullfilename>\":\$line_callee4_head"
mi_gdb_test "666-break-list" \
- "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\"\}.*\\\]\}" \
+ "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\",original-location=\".*\"\}.*\\\]\}" \
"list of breakpoints"
mi_gdb_test "777-break-delete" \
Index: gdb/testsuite/gdb.mi/mi-pending.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-pending.exp,v
retrieving revision 1.5
diff -u -p -r1.5 mi-pending.exp
--- gdb/testsuite/gdb.mi/mi-pending.exp 15 Apr 2008 14:33:54 -0000 1.5
+++ gdb/testsuite/gdb.mi/mi-pending.exp 24 Apr 2008 08:45:17 -0000
@@ -64,7 +64,7 @@ if [target_info exists gdb_stub] {
# Set pending breakpoint via MI
mi_gdb_test "-break-insert -f pendfunc1" \
- ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\"\}"\
+ ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"\}"\
"MI pending breakpoint on pendfunc1"
mi_run_cmd
Index: gdb/testsuite/gdb.mi/mi-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
retrieving revision 1.20
diff -u -p -r1.20 mi-simplerun.exp
--- gdb/testsuite/gdb.mi/mi-simplerun.exp 15 Apr 2008 14:33:54 -0000 1.20
+++ gdb/testsuite/gdb.mi/mi-simplerun.exp 24 Apr 2008 08:45:17 -0000
@@ -68,24 +68,20 @@ proc test_breakpoints_creation_and_listi
# -break-disable
# -break-info
- mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\}" \
+ mi_create_breakpoint "main" 1 keep main ".*basics.c" $line_main_body $hex \
"break-insert operation"
- mi_gdb_test "201-break-insert basics.c:callee2" \
- "201\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"$line_callee2_body\",times=\"0\"\}" \
+ mi_create_breakpoint "basics.c:callee2" 2 keep callee2 ".*basics.c" $line_callee2_body $hex \
"insert breakpoint at basics.c:callee2"
- mi_gdb_test "202-break-insert basics.c:$line_callee3_head" \
- "202\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"$line_callee3_body\",times=\"0\"\}" \
+ mi_create_breakpoint "basics.c:$line_callee3_head" 3 keep callee3 ".*basics.c" $line_callee3_body $hex \
"insert breakpoint at basics.c:\$line_callee3_head"
- mi_gdb_test "203-break-insert \"\\\"${srcfile}\\\":$line_callee4_head\"" \
- "203\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\",times=\"0\"\}" \
+ mi_create_breakpoint "\"\\\"${srcfile}\\\":$line_callee4_head\"" 4 keep callee4 ".*basics.c" $line_callee4_body $hex \
"insert breakpoint at \"<fullfilename>\":\$line_callee4_head"
mi_gdb_test "204-break-list" \
- "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+ "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
"list of breakpoints"
mi_gdb_test "205-break-disable 2 3 4" \
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.15
diff -u -p -r1.15 mi-syn-frame.exp
--- gdb/testsuite/gdb.mi/mi-syn-frame.exp 5 Apr 2008 17:12:46 -0000 1.15
+++ gdb/testsuite/gdb.mi/mi-syn-frame.exp 24 Apr 2008 08:45:17 -0000
@@ -39,10 +39,8 @@ mi_gdb_exit
mi_gdb_start
mi_run_to_main
-mi_gdb_test "400-break-insert foo" \
- "400\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}" \
- "insert breakpoint foo"
-
+mi_create_breakpoint "foo" 2 keep foo ".*mi-syn-frame.c" $decimal $hex \
+ "insert breakpoint foo"
#
# Call foo() by hand, where we'll hit a breakpoint.
@@ -73,9 +71,8 @@ mi_gdb_test "404-stack-list-frames 0 0"
# Call have_a_very_merry_interrupt() which will eventually raise a signal
# that's caught by handler() which calls subroutine().
-mi_gdb_test "405-break-insert subroutine" \
- "405\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}" \
- "insert breakpoint subroutine"
+mi_create_breakpoint "subroutine" 3 keep subroutine ".*mi-syn-frame.c" $decimal $hex \
+ "insert breakpoint subroutine"
mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \
"406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" \
Index: gdb/testsuite/gdb.mi/mi-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v
retrieving revision 1.17
diff -u -p -r1.17 mi-until.exp
--- gdb/testsuite/gdb.mi/mi-until.exp 15 Apr 2008 14:33:54 -0000 1.17
+++ gdb/testsuite/gdb.mi/mi-until.exp 24 Apr 2008 08:45:17 -0000
@@ -50,8 +50,7 @@ proc test_running_to_foo {} {
global mi_gdb_prompt
global hex
- mi_gdb_test "200-break-insert 10" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*until.c\",line=\"10\",times=\"0\"\}" \
+ mi_create_breakpoint "10" 1 "keep" foo ".*until.c" 10 ".*" \
"break-insert operation"
mi_run_cmd
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.28
diff -u -p -r1.28 mi-var-display.exp
--- gdb/testsuite/gdb.mi/mi-var-display.exp 15 Apr 2008 14:33:55 -0000 1.28
+++ gdb/testsuite/gdb.mi/mi-var-display.exp 24 Apr 2008 08:45:17 -0000
@@ -42,9 +42,8 @@ mi_gdb_load ${binfile}
set line_dct_end [gdb_get_line_number "{int a = 0;}"]
-mi_gdb_test "200-break-insert $srcfile:$line_dct_end" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"$line_dct_end\",times=\"0\"\}" \
- "break-insert operation"
+mi_create_breakpoint "$srcfile:$line_dct_end" 1 keep do_children_tests ".*var-cmd.c" $line_dct_end $hex \
+ "break-insert operation"
mi_run_cmd
mi_expect_stop "breakpoint-hit" "do_children_tests" "" ".*var-cmd.c" \
@@ -371,9 +370,8 @@ mi_gdb_test "-var-delete weird" \
set line_dst_incr_a_2 [gdb_get_line_number "incr_a(2);"]
-mi_gdb_test "200-break-insert $line_dst_incr_a_2" \
- "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"$line_dst_incr_a_2\",times=\"0\"\}" \
- "break-insert operation"
+mi_create_breakpoint "$line_dst_incr_a_2" 2 keep do_special_tests ".*var-cmd.c" $line_dst_incr_a_2 $hex \
+ "break-insert operation 2"
mi_execute_to "exec-continue" "breakpoint-hit" "do_special_tests" "" \
".*var-cmd.c" $line_dst_incr_a_2 { "" "disp=\"keep\"" } \
Index: gdb/testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.21
diff -u -p -r1.21 mi-watch.exp
--- gdb/testsuite/gdb.mi/mi-watch.exp 5 Apr 2008 17:12:46 -0000 1.21
+++ gdb/testsuite/gdb.mi/mi-watch.exp 24 Apr 2008 08:45:17 -0000
@@ -59,7 +59,7 @@ proc test_watchpoint_creation_and_listin
"break-watch operation"
mi_gdb_test "222-break-list" \
- "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\\\]\}" \
+ "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
"list of watchpoints"
}
Index: gdb/testsuite/gdb.mi/mi2-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-break.exp,v
retrieving revision 1.9
diff -u -p -r1.9 mi2-break.exp
--- gdb/testsuite/gdb.mi/mi2-break.exp 27 Feb 2008 20:29:31 -0000 1.9
+++ gdb/testsuite/gdb.mi/mi2-break.exp 24 Apr 2008 08:45:17 -0000
@@ -79,25 +79,21 @@ proc test_tbreak_creation_and_listing {}
# -break-insert -t srcfile:$line_callee4_head
# -break-list
- mi_gdb_test "222-break-insert -t main" \
- "222\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\"\}" \
+ mi_create_breakpoint "-t main" 1 del main ".*basics.c" $line_main_body $hex \
"break-insert -t operation"
- mi_gdb_test "333-break-insert -t basics.c:callee2" \
- "333\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",times=\"0\"\}" \
+ mi_create_breakpoint "-t basics.c:callee2" 2 del callee2 ".*basics.c" $line_callee2_body $hex \
"insert temp breakpoint at basics.c:callee2"
- mi_gdb_test "444-break-insert -t basics.c:$line_callee3_head" \
- "444\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",${fullname},line=\"$line_callee3_body\",times=\"0\"\}" \
+ mi_create_breakpoint "-t basics.c:$line_callee3_head" 3 del callee3 ".*basics.c" $line_callee3_body $hex \
"insert temp breakpoint at basics.c:\$line_callee3_head"
# Getting the quoting right is tricky. That is "\"<file>\":$line_callee4_head"
- mi_gdb_test "555-break-insert -t \"\\\"${srcfile}\\\":$line_callee4_head\"" \
- "555\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",${fullname},line=\"$line_callee4_body\",times=\"0\"\}" \
+ mi_create_breakpoint "-t \"\\\"${srcfile}\\\":$line_callee4_head\"" 4 del callee4 ".*basics.c" $line_callee4_body $hex \
"insert temp breakpoint at \"<fullfilename>\":\$line_callee4_head"
mi_gdb_test "666-break-list" \
- "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\"\}.*\\\]\}" \
+ "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\",original-location=\".*\"\}.*\\\]\}" \
"list of breakpoints"
mi_gdb_test "777-break-delete" \
Index: gdb/testsuite/gdb.mi/mi2-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-simplerun.exp,v
retrieving revision 1.11
diff -u -p -r1.11 mi2-simplerun.exp
--- gdb/testsuite/gdb.mi/mi2-simplerun.exp 15 Apr 2008 14:33:55 -0000 1.11
+++ gdb/testsuite/gdb.mi/mi2-simplerun.exp 24 Apr 2008 08:45:17 -0000
@@ -68,24 +68,20 @@ proc test_breakpoints_creation_and_listi
# -break-disable
# -break-info
- mi_gdb_test "200-break-insert main" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\}" \
+ mi_create_breakpoint "main" 1 keep main ".*basics.c" $line_main_body $hex \
"break-insert operation"
- mi_gdb_test "201-break-insert basics.c:callee2" \
- "201\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"$line_callee2_body\",times=\"0\"\}" \
+ mi_create_breakpoint "basics.c:callee2" 2 keep callee2 ".*basics.c" $line_callee2_body $hex \
"insert breakpoint at basics.c:callee2"
- mi_gdb_test "202-break-insert basics.c:$line_callee3_head" \
- "202\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"$line_callee3_body\",times=\"0\"\}" \
+ mi_create_breakpoint "basics.c:$line_callee3_head" 3 keep callee3 ".*basics.c" $line_callee3_body $hex \
"insert breakpoint at basics.c:\$line_callee3_head"
- mi_gdb_test "203-break-insert \"\\\"${srcfile}\\\":$line_callee4_head\"" \
- "203\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_callee4_body\",times=\"0\"\}" \
+ mi_create_breakpoint "\"\\\"${srcfile}\\\":$line_callee4_head\"" 4 keep callee4 ".*basics.c" $line_callee4_body $hex \
"insert breakpoint at \"<fullfilename>\":\$line_callee4_head"
mi_gdb_test "204-break-list" \
- "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+ "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
"list of breakpoints"
mi_gdb_test "205-break-disable 2 3 4" \
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.11
diff -u -p -r1.11 mi2-syn-frame.exp
--- gdb/testsuite/gdb.mi/mi2-syn-frame.exp 4 Apr 2008 21:59:25 -0000 1.11
+++ gdb/testsuite/gdb.mi/mi2-syn-frame.exp 24 Apr 2008 08:45:17 -0000
@@ -41,10 +41,8 @@ mi_gdb_exit
mi_gdb_start
mi_run_to_main
-mi_gdb_test "400-break-insert foo" \
- "400\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}" \
- "insert breakpoint foo"
-
+mi_create_breakpoint "foo" 2 keep foo ".*mi-syn-frame.c" $decimal $hex \
+ "insert breakpoint foo"
#
# Call foo() by hand, where we'll hit a breakpoint.
@@ -77,9 +75,8 @@ mi_gdb_test "404-stack-list-frames 0 0"
# Call have_a_very_merry_interrupt() which will eventually raise a signal
# that's caught by handler() which calls subroutine().
-mi_gdb_test "405-break-insert subroutine" \
- "405\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}" \
- "insert breakpoint subroutine"
+mi_create_breakpoint "subroutine" 3 keep subroutine ".*mi-syn-frame.c" $decimal $hex \
+ "insert breakpoint subroutine"
mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \
"406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\"" \
Index: gdb/testsuite/gdb.mi/mi2-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-until.exp,v
retrieving revision 1.11
diff -u -p -r1.11 mi2-until.exp
--- gdb/testsuite/gdb.mi/mi2-until.exp 15 Apr 2008 14:33:55 -0000 1.11
+++ gdb/testsuite/gdb.mi/mi2-until.exp 24 Apr 2008 08:45:17 -0000
@@ -51,8 +51,7 @@ proc test_running_to_foo {} {
global mi_gdb_prompt
global hex
- mi_gdb_test "200-break-insert 10" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*until.c\",line=\"10\",times=\"0\"\}" \
+ mi_create_breakpoint "10" 1 "keep" foo ".*until.c" 10 ".*" \
"break-insert operation"
mi_run_cmd
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.21
diff -u -p -r1.21 mi2-var-display.exp
--- gdb/testsuite/gdb.mi/mi2-var-display.exp 15 Apr 2008 14:33:55 -0000 1.21
+++ gdb/testsuite/gdb.mi/mi2-var-display.exp 24 Apr 2008 08:45:17 -0000
@@ -42,9 +42,8 @@ mi_gdb_load ${binfile}
set line_dct_end [gdb_get_line_number "{int a = 0;}"]
-mi_gdb_test "200-break-insert $srcfile:$line_dct_end" \
- "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"$line_dct_end\",times=\"0\"\}" \
- "break-insert operation"
+mi_create_breakpoint "$srcfile:$line_dct_end" 1 keep do_children_tests ".*var-cmd.c" $line_dct_end $hex \
+ "break-insert operation"
mi_run_cmd
mi_expect_stop "breakpoint-hit" "do_children_tests" "" ".*var-cmd.c" \
@@ -370,9 +369,8 @@ mi_gdb_test "-var-delete weird" \
set line_dst_incr_a_2 [gdb_get_line_number "incr_a(2);"]
-mi_gdb_test "200-break-insert $line_dst_incr_a_2" \
- "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"$line_dst_incr_a_2\",times=\"0\"\}" \
- "break-insert operation"
+mi_create_breakpoint "$line_dst_incr_a_2" 2 keep do_special_tests ".*var-cmd.c" $line_dst_incr_a_2 $hex \
+ "break-insert operation 2"
mi_execute_to "exec-continue" "breakpoint-hit" "do_special_tests" "" \
".*var-cmd.c" $line_dst_incr_a_2 { "" "disp=\"keep\"" } \
Index: gdb/testsuite/gdb.mi/mi2-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-watch.exp,v
retrieving revision 1.12
diff -u -p -r1.12 mi2-watch.exp
--- gdb/testsuite/gdb.mi/mi2-watch.exp 5 Apr 2008 17:12:46 -0000 1.12
+++ gdb/testsuite/gdb.mi/mi2-watch.exp 24 Apr 2008 08:45:17 -0000
@@ -59,7 +59,7 @@ proc test_watchpoint_creation_and_listin
"break-watch operation"
mi_gdb_test "222-break-list" \
- "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\\\]\}" \
+ "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
"list of watchpoints"
}
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.56
diff -u -p -r1.56 mi-support.exp
--- gdb/testsuite/lib/mi-support.exp 15 Apr 2008 14:33:55 -0000 1.56
+++ gdb/testsuite/lib/mi-support.exp 24 Apr 2008 08:45:17 -0000
@@ -875,7 +875,7 @@ proc mi_runto_helper {func run_or_contin
set test "mi runto $func"
mi_gdb_test "200-break-insert -t $func" \
- "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\"\}" \
+ "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\",original-location=\".*\"\}" \
"breakpoint at $func"
if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
@@ -1059,6 +1059,40 @@ proc mi0_continue_to { bkptno func args
"$func" "$args" "$file" "$line" "" "$test"
}
+# Creates a breakpoint and checks the reported fields are as expected
+proc mi_create_breakpoint { location number disp func file line address test } {
+ verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}"
+ mi_gdb_test "222-break-insert $location" \
+ "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}" \
+ $test
+}
+
+proc mi_list_breakpoints { expected test } {
+ set fullname ".*"
+
+ set body ""
+ set first 1
+
+ foreach item $children {
+ if {$first == 0} {
+ set body "$body,"
+ }
+ set number disp func file line address
+ set number [lindex $item 0]
+ set disp [lindex $item 1]
+ set func [lindex $item 2]
+ set line [lindex $item 3]
+ set address [lindex $item 4]
+ set body "$body,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",${fullname},line=\"$line\",times=\"0\",original-location=\".*\"\}"
+ set first 0
+ }
+
+ verbose -log "Expecint: 666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[$body\\\]\}" \
+ mi_gdb_test "666-break-list" \
+ "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[$body\\\]\}" \
+ $test
+}
+
# Creates varobj named NAME for EXPRESSION.
# Name cannot be "-".
proc mi_create_varobj { name expression testname } {
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-04-24 8:48 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-15 11:52 [RFA/RFC] Report the original location specification for a breakpoint Vladimir Prus
2008-04-17 9:16 ` Daniel Jacobowitz
2008-04-17 11:52 ` Vladimir Prus
2008-04-17 12:35 ` Nick Roberts
2008-04-17 15:28 ` Vladimir Prus
2008-04-17 21:17 ` Nick Roberts
2008-04-17 17:51 ` Daniel Jacobowitz
2008-04-17 21:25 ` Joel Brobecker
2008-04-17 21:31 ` Daniel Jacobowitz
2008-04-17 23:08 ` [commit] print breakpoint address only once (branch?) Joel Brobecker
2008-04-17 23:21 ` Daniel Jacobowitz
2008-04-19 2:08 ` Joel Brobecker
2008-04-24 11:45 ` [RFA/RFC] Report the original location specification for a breakpoint Vladimir Prus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox