This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: breakpoint error messages


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]