This is the mail archive of the gdb-patches@sourceware.org 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: [patch/MI] Implementation for break-catch command


On Monday 02 June 2008 20:06:07 you wrote:
> Vladimir Prus wrote:
> > On Thursday 29 May 2008 18:48:36 Aleksandar Ristovski wrote:
> >> Index: gdb/breakpoint.c
> > 
> > First of all, I would like a some testcases to be added with this patch.
> > 
> > I have some questions about behaviour, too:
> > 
> > 1. -break-catch throw
> >    ^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",
> >                addr="0xb7ef6e05",what="exception throw",times="0",
> >                original-location="__cxa_throw"}
> >    (gdb)
> > 
> > The way this breakpoint is printed seems not sufficiently precise. Suppose
> > such a breakpoint was added via CLI. GUI would like to detect this, and
> > add a breakpoint to the breakpoint list as "catch" breakpoint. How can we
> > detect it is a catch breakpoint? The "what" field appears to be of a fairly
> > ad-hoc use in MI. 
> 
> A few questions:
> 
> This is the output from -break-list:
> 
> ^done,BreakpointTable={nr_rows="3",nr_cols="6",hdr=[
> {width="7",alignment="-1",col_name="number",colhdr="Num"},
> {width="14",alignment="-1",col_name="type",colhdr="Type"},
> {width="4",alignment="-1",col_name="disp",colhdr="Disp"},
> {width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
> {width="10",alignment="-1",col_name="addr",colhdr="Address"},
> {width="40",alignment="2",col_name="what",colhdr="What"}],
> body=[bkpt=
> {number="1",type="breakpoint",disp="keep",enabled="y",addr="0x080488c4",func="main",file="/tmp/catch.cc",fullname="/tmp/catch.cc",line="9",times="0",original-location="main"},
> ...
> 
> The fields listed in the header do not match the body.

Well :-)
 
> Should they? 

Not really. Given that no frontend now is broken due to the fact that they don't match,
not need to fix anything.

> What is the point of the header if rows can have just any field?  

It's historical baggage. This 'table' thing, to the best of my knowledge, is used only for
breakpoints, and makes no sense -- clearly, no frontend is going to dynamically adjust
the columns of its breakpoint table according to gdb responses :-)

> > Should the type of breakpoint be actually 'exception-throw'?
> > 
> 
> I agree, 'breakpoint' is not precise. I think the type should be "catch " + event name, e.g. "catch catch", "catch throw" "catch signal" to keep terminology consistent (there are "catch load" "catch unload"...). 

I agree.

> 
> Reason field (for stopped message) - I would suggest simply specifying the type 
> again instead of introducing a new string, e.g. '*stopped,reason="catch catch"'. 

Seems OK to me.

- Volodya


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