aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-02-23 00:25:43 +0000
committerAndrew Cagney <cagney@redhat.com>2000-02-23 00:25:43 +0000
commitfb40c20903110ed8af9701ce7c2635abd3770d52 (patch)
tree9f99a85a7d64fa61cfa9a167e006e2f747716d42 /gdb/breakpoint.c
parente6c6b6fe2d24c8be4909c7e3c0dd1a937819ffe9 (diff)
downloadgdb-fb40c20903110ed8af9701ce7c2635abd3770d52.zip
gdb-fb40c20903110ed8af9701ce7c2635abd3770d52.tar.gz
gdb-fb40c20903110ed8af9701ce7c2635abd3770d52.tar.bz2
Add mi/ and testsuite/gdb.mi/ subdirectories.
Add --enable-gdbmi option to configury. Add mi rules to Makefile.in Add mi conditional output to event-top.c infrun.c main.c top.c. Add -i=mi option.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c7b3ff6..2ad3a78 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1909,6 +1909,8 @@ print_it_typical (bs)
#ifdef UI_OUT
annotate_breakpoint (bs->breakpoint_at->number);
ui_out_text (uiout, "\nBreakpoint ");
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ ui_out_field_string (uiout, "reason", "breakpoint-hit");
ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
ui_out_text (uiout, ", ");
return PRINT_SRC_AND_LOC;
@@ -2052,6 +2054,8 @@ print_it_typical (bs)
{
annotate_watchpoint (bs->breakpoint_at->number);
#ifdef UI_OUT
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ ui_out_field_string (uiout, "reason", "watchpoint-trigger");
mention (bs->breakpoint_at);
ui_out_list_begin (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
@@ -2080,6 +2084,8 @@ print_it_typical (bs)
case bp_read_watchpoint:
#ifdef UI_OUT
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ ui_out_field_string (uiout, "reason", "read-watchpoint-trigger");
mention (bs->breakpoint_at);
ui_out_list_begin (uiout, "value");
ui_out_text (uiout, "\nValue = ");
@@ -2102,6 +2108,8 @@ print_it_typical (bs)
if (bs->old_val != NULL)
{
annotate_watchpoint (bs->breakpoint_at->number);
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
mention (bs->breakpoint_at);
ui_out_list_begin (uiout, "value");
ui_out_text (uiout, "\nOld value = ");
@@ -2114,6 +2122,8 @@ print_it_typical (bs)
else
{
mention (bs->breakpoint_at);
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ ui_out_list_begin (uiout, "value");
ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
ui_out_text (uiout, "\nValue = ");
}
@@ -2148,10 +2158,18 @@ print_it_typical (bs)
here. */
case bp_finish:
+#ifdef UI_OUT
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ ui_out_field_string (uiout, "reason", "function-finished");
+#endif
return PRINT_UNKNOWN;
break;
case bp_until:
+#ifdef UI_OUT
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ ui_out_field_string (uiout, "reason", "location-reached");
+#endif
return PRINT_UNKNOWN;
break;
@@ -2360,6 +2378,8 @@ watchpoint_check (p)
will be deleted already. So we have no choice but print the
information here. */
#ifdef UI_OUT
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ ui_out_field_string (uiout, "reason", "watchpoint-scope");
ui_out_text (uiout, "\nWatchpoint ");
ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
ui_out_text (uiout, " deleted because the program has left the block in\n\
@@ -3446,6 +3466,13 @@ print_one_breakpoint (struct breakpoint *b,
#endif
}
+#ifdef UI_OUT
+ /* Output the count also if it is zero, but only if this is
+ mi. FIXME: Should have a better test for this. */
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (show_breakpoint_hit_counts && b->hit_count == 0)
+ ui_out_field_int (uiout, "times", b->hit_count);
+#endif
if (b->ignore_count)
{
@@ -4446,10 +4473,24 @@ mention (b)
break;
#endif
case bp_breakpoint:
+#ifdef UI_OUT
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ {
+ say_where = 0;
+ break;
+ }
+#endif
printf_filtered ("Breakpoint %d", b->number);
say_where = 1;
break;
case bp_hardware_breakpoint:
+#ifdef UI_OUT
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ {
+ say_where = 0;
+ break;
+ }
+#endif
printf_filtered ("Hardware assisted breakpoint %d", b->number);
say_where = 1;
break;
@@ -4506,6 +4547,10 @@ mention (b)
#ifdef UI_OUT
do_cleanups (old_chain);
#endif
+#ifdef UI_OUT
+ if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ return;
+#endif
printf_filtered ("\n");
}