This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
minimalistic MI catch support
- From: Markus Schiltknecht <markus at bluegap dot ch>
- To: gdb-patches at sourceware dot org
- Date: Sat, 28 Jan 2006 14:04:24 +0100
- Subject: minimalistic MI catch support
Hello gdb hackers,
working on an automated debugging layer on top of gdb I figured the
catchpoint functions in the MI interface is missing. The attached patch
against current CVS at least makes gdb report a catchpoint-break via MI.
This is already sufficient for my application. However, I would
appreciate a complete catchpoint implementation for the MI interface. I
haven't figured out how to implement the '-break-catch' command. If
somebody more knowledgable could do that I'd be thankfull.
Please CC me in responses, as I'm not subscribed.
Regards
Markus
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.220
diff -u -r1.220 breakpoint.c
--- breakpoint.c 16 Jan 2006 12:55:18 -0000 1.220
+++ breakpoint.c 28 Jan 2006 12:52:59 -0000
@@ -2167,17 +2167,41 @@
case bp_catch_fork:
annotate_catchpoint (bs->breakpoint_at->number);
- printf_filtered (_("\nCatchpoint %d (forked process %d), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->forked_inferior_pid);
+ if (ui_out_is_mi_like_p (uiout))
+ {
+ ui_out_text (uiout, "\nBreakpoint ");
+ ui_out_field_string (uiout, "reason", "fork");
+ ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
+ ui_out_field_int (uiout, "forked-process",
+ bs->breakpoint_at->forked_inferior_pid);
+ ui_out_text (uiout, ", ");
+ }
+ else
+ {
+ printf_filtered (_("\nCatchpoint %d (forked process %d), "),
+ bs->breakpoint_at->number,
+ bs->breakpoint_at->forked_inferior_pid);
+ }
return PRINT_SRC_AND_LOC;
break;
case bp_catch_vfork:
annotate_catchpoint (bs->breakpoint_at->number);
- printf_filtered (_("\nCatchpoint %d (vforked process %d), "),
- bs->breakpoint_at->number,
- bs->breakpoint_at->forked_inferior_pid);
+ if (ui_out_is_mi_like_p (uiout))
+ {
+ ui_out_text (uiout, "\nBreakpoint ");
+ ui_out_field_string (uiout, "reason", "vfork");
+ ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
+ ui_out_field_int (uiout, "forked-process",
+ bs->breakpoint_at->forked_inferior_pid);
+ ui_out_text (uiout, ", ");
+ }
+ else
+ {
+ printf_filtered (_("\nCatchpoint %d (vforked process %d), "),
+ bs->breakpoint_at->number,
+ bs->breakpoint_at->forked_inferior_pid);
+ }
return PRINT_SRC_AND_LOC;
break;