summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2002-09-05 01:28:14 +0000
committerMichael Snyder <msnyder@specifix.com>2002-09-05 01:28:14 +0000
commita1ee71e98b58ff62667b08f63e902710ead56941 (patch)
treec7a64d9c2018a21cf066e7e5327177a8df35ae81
parent1569885e96a338957a782dac55eb1ed227a3fe74 (diff)
downloadgdb-a1ee71e98b58ff62667b08f63e902710ead56941.tar.gz
2002-08-26 Michael Snyder <msnyder@redhat.com>
* breakpoint.c (insert_breakpoints): Protect all references to 'process_warning'. Shorten long lines.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/breakpoint.c43
2 files changed, 31 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7107f2cabbe..debccb059e2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -187,6 +187,11 @@
* breakpoint.c: Include cli/cli-script.h.
* Makefile.in (breakpoint.o): Update dependencies.
+2002-08-26 Michael Snyder <msnyder@redhat.com>
+
+ * breakpoint.c (insert_breakpoints): Protect all references
+ to 'process_warning'. Shorten long lines.
+
2002-08-26 Joel Brobecker <brobecker@gnat.com>
* cli/cli-script.c (copy_command_lines): New function.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b88f6749aec..2998671bbf1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -717,15 +717,13 @@ insert_breakpoints (void)
int val = 0;
int disabled_breaks = 0;
int hw_breakpoint_error = 0;
+#ifdef ONE_PROCESS_WRITETEXT
int process_warning = 0;
+#endif
static char message1[] = "Error inserting catchpoint %d:\n";
static char message[sizeof (message1) + 30];
-#ifdef ONE_PROCESS_WRITETEXT
- process_warning = 1;
-#endif
-
struct ui_file *tmp_error_stream = mem_fileopen ();
make_cleanup_ui_file_delete (tmp_error_stream);
@@ -837,17 +835,21 @@ insert_breakpoints (void)
if (!disabled_breaks)
{
fprintf_unfiltered (tmp_error_stream,
- "Cannot insert breakpoint %d.\n", b->number);
+ "Cannot insert breakpoint %d.\n",
+ b->number);
fprintf_unfiltered (tmp_error_stream,
"Temporarily disabling shared library breakpoints:\n");
}
disabled_breaks = 1;
- fprintf_unfiltered (tmp_error_stream, "breakpoint #%d\n", b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "breakpoint #%d\n", b->number);
}
else
#endif
{
+#ifdef ONE_PROCESS_WRITETEXT
process_warning = 1;
+#endif
if (b->type == bp_hardware_breakpoint)
{
hw_breakpoint_error = 1;
@@ -857,8 +859,11 @@ insert_breakpoints (void)
}
else
{
- fprintf_unfiltered (tmp_error_stream, "Cannot insert breakpoint %d.\n", b->number);
- fprintf_filtered (tmp_error_stream, "Error accessing memory address ");
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert breakpoint %d.\n",
+ b->number);
+ fprintf_filtered (tmp_error_stream,
+ "Error accessing memory address ");
print_address_numeric (b->address, 1, tmp_error_stream);
fprintf_filtered (tmp_error_stream, ": %s.\n",
safe_strerror (val));
@@ -893,7 +898,8 @@ insert_breakpoints (void)
fprintf_unfiltered (tmp_error_stream,
"Cannot insert catchpoint %d; disabling it.\n",
b->number);
- fprintf_filtered (tmp_error_stream, "Error accessing memory address ");
+ fprintf_filtered (tmp_error_stream,
+ "Error accessing memory address ");
print_address_numeric (b->address, 1, tmp_error_stream);
fprintf_filtered (tmp_error_stream, ": %s.\n",
safe_strerror (val));
@@ -1022,11 +1028,11 @@ insert_breakpoints (void)
value chain brings us here. */
if (!b->inserted)
{
- process_warning = 1;
remove_breakpoint (b, mark_uninserted);
hw_breakpoint_error = 1;
fprintf_unfiltered (tmp_error_stream,
- "Cannot insert hardware watchpoint %d.\n", b->number);
+ "Could not insert hardware watchpoint %d.\n",
+ b->number);
val = -1;
}
}
@@ -1073,7 +1079,8 @@ insert_breakpoints (void)
}
if (val < 0)
{
- fprintf_unfiltered (tmp_error_stream, "Cannot insert catchpoint %d.", b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert catchpoint %d.", b->number);
}
else
b->inserted = 1;
@@ -1089,13 +1096,15 @@ insert_breakpoints (void)
message about possibly exhausted resources. */
if (hw_breakpoint_error)
{
- fprintf_unfiltered (tmp_error_stream, "Could not insert hardware breakpoints:\n"
- "You may have requested too many hardware breakpoints/watchpoints.\n");
+ fprintf_unfiltered (tmp_error_stream,
+ "Could not insert hardware breakpoints:\n\
+You may have requested too many hardware breakpoints/watchpoints.\n");
}
-
+#ifdef ONE_PROCESS_WRITETEXT
if (process_warning)
- fprintf_unfiltered (tmp_error_stream,"The same program may be running in another process.");
-
+ fprintf_unfiltered (tmp_error_stream,
+ "The same program may be running in another process.");
+#endif
target_terminal_ours_for_output ();
error_stream (tmp_error_stream);
}