Re: [patch/MI] Implementation for break-catch command

Aleksandar Ristovski
2008-06-02T16:06:47Z

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. Should they? What is the point of the header if rows can have just any field?

> 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"...).

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"'.

Thanks,

Aleksandar