* breakpoint error messages
@ 2002-08-21 11:26 Grace Sainsbury
2002-08-22 0:59 ` Eli Zaretskii
2002-08-22 14:24 ` Michael Snyder
0 siblings, 2 replies; 8+ messages in thread
From: Grace Sainsbury @ 2002-08-21 11:26 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 878 bytes --]
I changed insert_breakpoints to collect all the warning messages from
failed inserts and print them with an error after trying the whole
queue. This changes the functionality slightly -- the old code stopped
after the first failed insert of a breakpoint. I also changed the
error messages to be more explicit about hardware breakpoints.
ok?
grace
2002-08-21 Grace Sainsbury <graces@redhat.com>
* infrun.c (normal_stop, proceed): Remove call to print_sys_errmsg
when breakpoints fail. Move general breakpoint error messages to
insert_breakpoints.
* breakpoint.c (insert_breakpoints): Change warnings when
breakpoints are nto inserted to specify the type. Remove call to
memory_error when breakpoints can't be inserted. Remove multiple
calls to warning so all messages are sent to the user at once.
(delete_breakpoints): Make insert error messsages more explicit.
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 7007 bytes --]
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.81
diff -u -r1.81 breakpoint.c
--- breakpoint.c 20 Aug 2002 20:03:35 -0000 1.81
+++ breakpoint.c 21 Aug 2002 18:16:45 -0000
@@ -715,10 +715,13 @@
int return_val = 0; /* return success code. */
int val = 0;
int disabled_breaks = 0;
-
+ int hw_breakpoint_error = 0;
+
static char message1[] = "Error inserting catchpoint %d:\n";
static char message[sizeof (message1) + 30];
+ struct ui_file *tmp_error_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_error_stream);
ALL_BREAKPOINTS_SAFE (b, temp)
{
@@ -776,8 +779,9 @@
/* Set a software (trap) breakpoint at the LMA. */
val = target_insert_breakpoint (addr, b->shadow_contents);
if (val != 0)
- warning ("overlay breakpoint %d failed: in ROM?",
- b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Overlay breakpoint %d failed: in ROM?",
+ b->number);
}
}
/* Shall we set a breakpoint at the VMA? */
@@ -810,22 +814,29 @@
b->enable_state = bp_shlib_disabled;
if (!disabled_breaks)
{
- target_terminal_ours_for_output ();
- warning ("Cannot insert breakpoint %d:", b->number);
- warning ("Temporarily disabling shared library breakpoints:");
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert breakpoint %d.\n", b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Temporarily disabling shared library breakpoints:\n");
}
disabled_breaks = 1;
- warning ("breakpoint #%d ", b->number);
+ fprintf_unfiltered (tmp_error_stream, "breakpoint #%d\n", b->number);
}
else
#endif
{
- target_terminal_ours_for_output ();
- warning ("Cannot insert breakpoint %d:", b->number);
-#ifdef ONE_PROCESS_WRITETEXT
- warning ("The same program may be running in another process.");
-#endif
- memory_error (val, b->address); /* which bombs us out */
+ if (b->type == bp_hardware_breakpoint)
+ {
+ hw_breakpoint_error = 1;
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert hardware breakpoint %d.\n",
+ b->number);
+ }
+ else
+ {
+ fprintf_unfiltered (tmp_error_stream, "Cannot insert breakpoint %d.\n", b->number);
+ }
+
}
}
else
@@ -852,9 +863,9 @@
if (val)
{
/* Couldn't set breakpoint for some reason */
- target_terminal_ours_for_output ();
- warning ("Cannot insert catchpoint %d; disabling it.",
- b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert catchpoint %d; disabling it.\n",
+ b->number);
b->enable_state = bp_disabled;
}
else
@@ -876,9 +887,9 @@
if (val == -1)
{
/* something went wrong */
- target_terminal_ours_for_output ();
- warning ("Cannot insert catchpoint %d; disabling it.",
- b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert catchpoint %d; disabling it.\n",
+ b->number);
b->enable_state = bp_disabled;
}
}
@@ -955,7 +966,7 @@
addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
len = TYPE_LENGTH (VALUE_TYPE (v));
- type = hw_write;
+ type = hw_write;
if (b->type == bp_read_watchpoint)
type = hw_read;
else if (b->type == bp_access_watchpoint)
@@ -981,8 +992,9 @@
if (!b->inserted)
{
remove_breakpoint (b, mark_uninserted);
- warning ("Could not insert hardware watchpoint %d.",
- b->number);
+ hw_breakpoint_error = 1;
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert hardware watchpoint %d.\n", b->number);
val = -1;
}
}
@@ -1029,8 +1041,7 @@
}
if (val < 0)
{
- target_terminal_ours_for_output ();
- warning ("Cannot insert catchpoint %d.", b->number);
+ fprintf_unfiltered (tmp_error_stream, "Cannot insert catchpoint %d.", b->number);
}
else
b->inserted = 1;
@@ -1039,11 +1050,25 @@
return_val = val; /* remember failure */
}
}
-
+
+ if (return_val)
+ {
+ /* If a hardware breakpoint or watchpoint was inserted add a
+ message about possibly exhausted resources. */
+ if (hw_breakpoint_error)
+ {
+ fprintf_unfiltered (tmp_error_stream, "Could not insert breakpoints:\n"
+ "You may have requested too many hardware breakpoints/watchpoints.");
+ }
+#ifdef ONE_PROCESS_WRITETEXT
+ fprintf_unfiltered (tmp_error_stream,"The same program may be running in another process.\n");
+#endif
+ target_terminal_ours_for_output ();
+ error_stream (tmp_error_stream);
+ }
return return_val;
}
-
int
remove_breakpoints (void)
{
@@ -6681,11 +6706,24 @@
else
val = target_insert_breakpoint (b->address, b->shadow_contents);
+ /* If there wat an error in the insert, print a pessage then stop execution. */
if (val != 0)
{
+ struct ui_file *tmp_error_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_error_stream);
+
+ if (b->type == bp_hardware_breakpoint)
+ {
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert hardware breakpoint %d:", b->number);
+ }
+ else
+ {
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert breakpoint %d:", b->number);
+ }
target_terminal_ours_for_output ();
- warning ("Cannot insert breakpoint %d:", b->number);
- memory_error (val, b->address); /* which bombs us out */
+ error_stream(tmp_error_stream);
}
else
b->inserted = 1;
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.68
diff -u -r1.68 infrun.c
--- infrun.c 20 Aug 2002 23:01:29 -0000 1.68
+++ infrun.c 21 Aug 2002 18:16:47 -0000
@@ -990,16 +990,9 @@
trap_expected = 1;
else
{
- int temp = insert_breakpoints ();
- if (temp)
- {
- print_sys_errmsg ("insert_breakpoints", temp);
- error ("Cannot insert breakpoints.\n\
-The same program may be running in another process,\n\
-or you may have requested too many hardware\n\
-breakpoints and/or watchpoints.\n");
- }
-
+ insert_breakpoints ();
+ /* If we get here there was no call to error() in
+ insert breakpoints -- so they were inserted. */
breakpoints_inserted = 1;
}
@@ -3378,16 +3371,6 @@
DECR_PC_AFTER_BREAK */
if (target_has_execution && get_current_frame ())
(get_current_frame ())->pc = read_pc ();
-
- if (breakpoints_failed)
- {
- target_terminal_ours_for_output ();
- print_sys_errmsg ("While inserting breakpoints", breakpoints_failed);
- printf_filtered ("Stopped; cannot insert breakpoints.\n\
-The same program may be running in another process,\n\
-or you may have requested too many hardware breakpoints\n\
-and/or watchpoints.\n");
- }
if (target_has_execution && breakpoints_inserted)
{
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: breakpoint error messages
2002-08-21 11:26 breakpoint error messages Grace Sainsbury
@ 2002-08-22 0:59 ` Eli Zaretskii
2002-08-22 14:24 ` Michael Snyder
1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2002-08-22 0:59 UTC (permalink / raw)
To: graces; +Cc: gdb-patches
> Date: Wed, 21 Aug 2002 14:26:27 -0400
> From: Grace Sainsbury <graces@redhat.com>
>
> I changed insert_breakpoints to collect all the warning messages from
> failed inserts and print them with an error after trying the whole
> queue. This changes the functionality slightly -- the old code stopped
> after the first failed insert of a breakpoint. I also changed the
> error messages to be more explicit about hardware breakpoints.
If these changes are approved, please scan gdb.texinfo for the
messages in question and see that the examples in the manual are still
correct.
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: breakpoint error messages
2002-08-21 11:26 breakpoint error messages Grace Sainsbury
2002-08-22 0:59 ` Eli Zaretskii
@ 2002-08-22 14:24 ` Michael Snyder
2002-08-22 14:38 ` Grace Sainsbury
1 sibling, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2002-08-22 14:24 UTC (permalink / raw)
To: Grace Sainsbury; +Cc: gdb-patches
Grace Sainsbury wrote:
>
> I changed insert_breakpoints to collect all the warning messages from
> failed inserts and print them with an error after trying the whole
> queue. This changes the functionality slightly -- the old code stopped
> after the first failed insert of a breakpoint. I also changed the
> error messages to be more explicit about hardware breakpoints.
>
> ok?
Grace, thanks for the contribution. A few implementation details.
First off, you've lost some output.
1) The word "Warning: ", which is generated by the 'warning' function
(which you've replaced by fprintf_unfiltered). One instance would
probably be enough.
2) The output of the 'memory_error' function.
3) The msg "The same program may be running in another process"
4) The output of print_sys_errmsg, formerly called by infrun.
Do you think you could work those back in?
Then, just some textual edits. In one comment you say
"If there wat an error", where you probably meant to say 'was'.
And there's this:
if (hw_breakpoint_error)
fprintf_unfiltered (tmp_error_stream,
"Could not insert breakpoints: ..."
Seems like you might as well say "hardware breakpoints" there.
Regards,
Michael
>
> grace
>
> 2002-08-21 Grace Sainsbury <graces@redhat.com>
>
> * infrun.c (normal_stop, proceed): Remove call to print_sys_errmsg
> when breakpoints fail. Move general breakpoint error messages to
> insert_breakpoints.
> * breakpoint.c (insert_breakpoints): Change warnings when
> breakpoints are nto inserted to specify the type. Remove call to
> memory_error when breakpoints can't be inserted. Remove multiple
> calls to warning so all messages are sent to the user at once.
> (delete_breakpoints): Make insert error messsages more explicit.
>
> ------------------------------------------------------------------------
>
> patchName: patch
> Type: Plain Text (text/plain)
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: breakpoint error messages
2002-08-22 14:24 ` Michael Snyder
@ 2002-08-22 14:38 ` Grace Sainsbury
2002-08-22 15:26 ` Michael Snyder
0 siblings, 1 reply; 8+ messages in thread
From: Grace Sainsbury @ 2002-08-22 14:38 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
On Thu, Aug 22, 2002 at 02:18:58PM -0700, Michael Snyder wrote:
> Grace Sainsbury wrote:
> >
> > I changed insert_breakpoints to collect all the warning messages from
> > failed inserts and print them with an error after trying the whole
> > queue. This changes the functionality slightly -- the old code stopped
> > after the first failed insert of a breakpoint. I also changed the
> > error messages to be more explicit about hardware breakpoints.
> >
> > ok?
>
> Grace, thanks for the contribution. A few implementation details.
> First off, you've lost some output.
> 1) The word "Warning: ", which is generated by the 'warning' function
> (which you've replaced by fprintf_unfiltered). One instance would
> probably be enough.
ok.
> 2) The output of the 'memory_error' function.
The original purpose of the change was to remove that text
'Cannot access memory address XXXXX' doesn't seem to be meaningful in
this context.
> 3) The msg "The same program may be running in another process"
I'll add that back.
> 4) The output of print_sys_errmsg, formerly called by infrun.
This printed 'Unknown error' which seems to be uninformative.
>
> Do you think you could work those back in?
>
> Then, just some textual edits. In one comment you say
> "If there wat an error", where you probably meant to say 'was'.
> And there's this:
> if (hw_breakpoint_error)
> fprintf_unfiltered (tmp_error_stream,
> "Could not insert breakpoints: ..."
>
> Seems like you might as well say "hardware breakpoints" there.
ok.
let me know if you really want the memory_error, print_sys_errmsg text
back.
thanks,
grace
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: breakpoint error messages
2002-08-22 14:38 ` Grace Sainsbury
@ 2002-08-22 15:26 ` Michael Snyder
2002-08-23 9:27 ` Grace Sainsbury
0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2002-08-22 15:26 UTC (permalink / raw)
To: Grace Sainsbury; +Cc: gdb-patches
Grace Sainsbury wrote:
>
> On Thu, Aug 22, 2002 at 02:18:58PM -0700, Michael Snyder wrote:
> > Grace Sainsbury wrote:
> > >
> > > I changed insert_breakpoints to collect all the warning messages from
> > > failed inserts and print them with an error after trying the whole
> > > queue. This changes the functionality slightly -- the old code stopped
> > > after the first failed insert of a breakpoint. I also changed the
> > > error messages to be more explicit about hardware breakpoints.
> > >
> > > ok?
> >
> > Grace, thanks for the contribution. A few implementation details.
> > First off, you've lost some output.
> > 1) The word "Warning: ", which is generated by the 'warning' function
> > (which you've replaced by fprintf_unfiltered). One instance would
> > probably be enough.
>
> ok.
>
> > 2) The output of the 'memory_error' function.
>
> The original purpose of the change was to remove that text
> 'Cannot access memory address XXXXX' doesn't seem to be meaningful in
> this context.
It could be meaningful. It could tell you that the breakpoint
was set at an illegal address, or a non-writable one (eg. in ROM).
You could just mention the fact that the failure was due to a
memory access problem.
> > 3) The msg "The same program may be running in another process"
>
> I'll add that back.
>
> > 4) The output of print_sys_errmsg, formerly called by infrun.
>
> This printed 'Unknown error' which seems to be uninformative.
Hmmm... either that represents bit-rot, or maybe
that's just what it prints in the context in which
you tried it. Maybe it prints something useful in
some other context.
The purpose of print_sys_errmsg is to pretty-print
an 'errno' value -- which normally would be something
more useful than "unknown error". If you look at the
top of insert_breakpoints, the comment explains that
it is supposed to return an 'errno' value.
Tell you what -- all 'errno' values are greater than zero.
If the return value from insert_breakpoints is less than
zero, you can skip calling print_sys_errmsg.
> > Do you think you could work those back in?
> >
> > Then, just some textual edits. In one comment you say
> > "If there wat an error", where you probably meant to say 'was'.
> > And there's this:
> > if (hw_breakpoint_error)
> > fprintf_unfiltered (tmp_error_stream,
> > "Could not insert breakpoints: ..."
> >
> > Seems like you might as well say "hardware breakpoints" there.
>
> ok.
>
> let me know if you really want the memory_error, print_sys_errmsg text
> back.
>
> thanks,
>
> grace
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: breakpoint error messages
2002-08-22 15:26 ` Michael Snyder
@ 2002-08-23 9:27 ` Grace Sainsbury
2002-08-23 11:51 ` Michael Snyder
2002-08-24 2:18 ` Eli Zaretskii
0 siblings, 2 replies; 8+ messages in thread
From: Grace Sainsbury @ 2002-08-23 9:27 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 283 bytes --]
How about this?
The memory_error is only relevant for memory
breakpoints, and only insert_breakpoint returns an errno (the hardware
and catcpoint functions return -1 on error)-- so the call to strerror
prints the error when it is relevant, and so replaces print_sys_errmsg.
grace
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 6217 bytes --]
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.81
diff -u -r1.81 breakpoint.c
--- breakpoint.c 20 Aug 2002 20:03:35 -0000 1.81
+++ breakpoint.c 23 Aug 2002 15:49:45 -0000
@@ -715,10 +715,17 @@
int return_val = 0; /* return success code. */
int val = 0;
int disabled_breaks = 0;
-
+ int hw_breakpoint_error = 0;
+
static char message1[] = "Error inserting catchpoint %d:\n";
static char message[sizeof (message1) + 30];
+ struct ui_file *tmp_error_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_error_stream);
+
+ /* Explicitly mark the warning -- this will only be printed if
+ there was an error. */
+ fprintf_unfiltered (tmp_error_stream, "Warning:\n");
ALL_BREAKPOINTS_SAFE (b, temp)
{
@@ -776,8 +783,9 @@
/* Set a software (trap) breakpoint at the LMA. */
val = target_insert_breakpoint (addr, b->shadow_contents);
if (val != 0)
- warning ("overlay breakpoint %d failed: in ROM?",
- b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Overlay breakpoint %d failed: in ROM?",
+ b->number);
}
}
/* Shall we set a breakpoint at the VMA? */
@@ -810,22 +818,34 @@
b->enable_state = bp_shlib_disabled;
if (!disabled_breaks)
{
- target_terminal_ours_for_output ();
- warning ("Cannot insert breakpoint %d:", b->number);
- warning ("Temporarily disabling shared library breakpoints:");
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert breakpoint %d.\n", b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Temporarily disabling shared library breakpoints:\n");
}
disabled_breaks = 1;
- warning ("breakpoint #%d ", b->number);
+ fprintf_unfiltered (tmp_error_stream, "breakpoint #%d\n", b->number);
}
else
#endif
{
- target_terminal_ours_for_output ();
- warning ("Cannot insert breakpoint %d:", b->number);
-#ifdef ONE_PROCESS_WRITETEXT
- warning ("The same program may be running in another process.");
-#endif
- memory_error (val, b->address); /* which bombs us out */
+ if (b->type == bp_hardware_breakpoint)
+ {
+ hw_breakpoint_error = 1;
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert hardware breakpoint %d.\n",
+ b->number);
+ }
+ else
+ {
+ 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));
+
+ }
+
}
}
else
@@ -852,9 +872,13 @@
if (val)
{
/* Couldn't set breakpoint for some reason */
- target_terminal_ours_for_output ();
- warning ("Cannot insert catchpoint %d; disabling it.",
- b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert catchpoint %d; disabling it.\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));
b->enable_state = bp_disabled;
}
else
@@ -876,9 +900,9 @@
if (val == -1)
{
/* something went wrong */
- target_terminal_ours_for_output ();
- warning ("Cannot insert catchpoint %d; disabling it.",
- b->number);
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert catchpoint %d; disabling it.\n",
+ b->number);
b->enable_state = bp_disabled;
}
}
@@ -955,7 +979,7 @@
addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
len = TYPE_LENGTH (VALUE_TYPE (v));
- type = hw_write;
+ type = hw_write;
if (b->type == bp_read_watchpoint)
type = hw_read;
else if (b->type == bp_access_watchpoint)
@@ -981,8 +1005,9 @@
if (!b->inserted)
{
remove_breakpoint (b, mark_uninserted);
- warning ("Could not insert hardware watchpoint %d.",
- b->number);
+ hw_breakpoint_error = 1;
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert hardware watchpoint %d.\n", b->number);
val = -1;
}
}
@@ -1029,8 +1054,7 @@
}
if (val < 0)
{
- target_terminal_ours_for_output ();
- warning ("Cannot insert catchpoint %d.", b->number);
+ fprintf_unfiltered (tmp_error_stream, "Cannot insert catchpoint %d.", b->number);
}
else
b->inserted = 1;
@@ -1039,11 +1063,23 @@
return_val = val; /* remember failure */
}
}
-
+
+ if (return_val)
+ {
+ /* If a hardware breakpoint or watchpoint was inserted, add a
+ 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,"The same program may be running in another process.");
+ target_terminal_ours_for_output ();
+ error_stream (tmp_error_stream);
+ }
return return_val;
}
-
int
remove_breakpoints (void)
{
@@ -6681,11 +6717,24 @@
else
val = target_insert_breakpoint (b->address, b->shadow_contents);
+ /* If there was an error in the insert, print a message, then stop execution. */
if (val != 0)
{
+ struct ui_file *tmp_error_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_error_stream);
+
+ if (b->type == bp_hardware_breakpoint)
+ {
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert hardware breakpoint %d:", b->number);
+ }
+ else
+ {
+ fprintf_unfiltered (tmp_error_stream,
+ "Cannot insert breakpoint %d:", b->number);
+ }
target_terminal_ours_for_output ();
- warning ("Cannot insert breakpoint %d:", b->number);
- memory_error (val, b->address); /* which bombs us out */
+ error_stream(tmp_error_stream);
}
else
b->inserted = 1;
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: breakpoint error messages
2002-08-23 9:27 ` Grace Sainsbury
@ 2002-08-23 11:51 ` Michael Snyder
2002-08-24 2:18 ` Eli Zaretskii
1 sibling, 0 replies; 8+ messages in thread
From: Michael Snyder @ 2002-08-23 11:51 UTC (permalink / raw)
To: Grace Sainsbury; +Cc: gdb-patches
Grace Sainsbury wrote:
>
> How about this?
>
> The memory_error is only relevant for memory
> breakpoints, and only insert_breakpoint returns an errno (the hardware
> and catcpoint functions return -1 on error)-- so the call to strerror
> prints the error when it is relevant, and so replaces print_sys_errmsg.
>
> grace
Much better, thanks. The only concern I still have is about the msg
"the same program may be running in another process". Your patch will
now print that message much more often than before, both because you
eliminated the #ifdef, and because you're going to print it any time
-any- error or warning occurs.
Even though we all hate ifdefs, I suggest you leave this one in,
since taking it out will result in a behavior change, and I suggest
you use another boolian variable to determine when it should be
printed (set the variable true at the point where the existing code
prints the message).
Given those changes, you can go ahead and check it in without
re-submitting.
Thanks,
Michael
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: breakpoint error messages
2002-08-23 9:27 ` Grace Sainsbury
2002-08-23 11:51 ` Michael Snyder
@ 2002-08-24 2:18 ` Eli Zaretskii
1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2002-08-24 2:18 UTC (permalink / raw)
To: graces; +Cc: msnyder, gdb-patches
> Date: Fri, 23 Aug 2002 11:53:15 -0400
> From: Grace Sainsbury <graces@redhat.com>
>
> The memory_error is only relevant for memory
> breakpoints, and only insert_breakpoint returns an errno (the hardware
> and catcpoint functions return -1 on error)-- so the call to strerror
> prints the error when it is relevant, and so replaces print_sys_errmsg.
Do we really want to carve in stone the current semi-buggy behavior of
-1 being returned in some of these cases? What if hardware
break/watchpoints and catchpoints code is fixed to return a meaningful
errno?
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-08-24 9:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-21 11:26 breakpoint error messages Grace Sainsbury
2002-08-22 0:59 ` Eli Zaretskii
2002-08-22 14:24 ` Michael Snyder
2002-08-22 14:38 ` Grace Sainsbury
2002-08-22 15:26 ` Michael Snyder
2002-08-23 9:27 ` Grace Sainsbury
2002-08-23 11:51 ` Michael Snyder
2002-08-24 2:18 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox