* catchpoints
@ 2002-07-18 13:00 Paul Dubuc
2002-07-18 13:05 ` catchpoints Daniel Jacobowitz
0 siblings, 1 reply; 9+ messages in thread
From: Paul Dubuc @ 2002-07-18 13:00 UTC (permalink / raw)
To: gdb
I'm using gdb 5.2 on Solaris 8 to debug code compiled with g++ 2.95.3.
When I try to enter 'catch throw' or 'catch catch' commands I get a
message that says
no runtime support for this
Does this mean I need to rebuild gdb to support these commands or is it
just that they aren't supported for this OS or compiler?
I can't find any info in the manual about this.
--
Paul M. Dubuc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: catchpoints
2002-07-18 13:00 catchpoints Paul Dubuc
@ 2002-07-18 13:05 ` Daniel Jacobowitz
2002-07-18 13:09 ` catchpoints Daniel Berlin
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2002-07-18 13:05 UTC (permalink / raw)
To: Paul Dubuc; +Cc: gdb
On Thu, Jul 18, 2002 at 04:00:43PM -0400, Paul Dubuc wrote:
> I'm using gdb 5.2 on Solaris 8 to debug code compiled with g++ 2.95.3.
> When I try to enter 'catch throw' or 'catch catch' commands I get a
> message that says
>
> no runtime support for this
>
> Does this mean I need to rebuild gdb to support these commands or is it
> just that they aren't supported for this OS or compiler?
>
> I can't find any info in the manual about this.
I believe they're only supported on HP/UX (and none of the HP/UX
support works quite right any more...). I don't think anyone has tried
to implement them on GCC code yet.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: catchpoints
2002-07-18 13:05 ` catchpoints Daniel Jacobowitz
@ 2002-07-18 13:09 ` Daniel Berlin
2002-07-18 13:13 ` catchpoints Daniel Jacobowitz
2002-07-18 13:17 ` catchpoints Paul Dubuc
0 siblings, 2 replies; 9+ messages in thread
From: Daniel Berlin @ 2002-07-18 13:09 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Paul Dubuc, gdb
On Thu, 18 Jul 2002, Daniel Jacobowitz wrote:
> On Thu, Jul 18, 2002 at 04:00:43PM -0400, Paul Dubuc wrote:
> > I'm using gdb 5.2 on Solaris 8 to debug code compiled with g++ 2.95.3.
> > When I try to enter 'catch throw' or 'catch catch' commands I get a
> > message that says
> >
> > no runtime support for this
> >
> > Does this mean I need to rebuild gdb to support these commands or is it
> > just that they aren't supported for this OS or compiler?
> >
> > I can't find any info in the manual about this.
>
> I believe they're only supported on HP/UX (and none of the HP/UX
> support works quite right any more...). I don't think anyone has tried
> to implement them on GCC code yet.
Actually, I did, and had it working just fine.
It's actually not that difficult, but it is ABI specific.
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: catchpoints
2002-07-18 13:09 ` catchpoints Daniel Berlin
@ 2002-07-18 13:13 ` Daniel Jacobowitz
2002-07-18 14:02 ` catchpoints Daniel Berlin
2002-07-18 13:17 ` catchpoints Paul Dubuc
1 sibling, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2002-07-18 13:13 UTC (permalink / raw)
To: Daniel Berlin; +Cc: Paul Dubuc, gdb
On Thu, Jul 18, 2002 at 04:09:01PM -0400, Daniel Berlin wrote:
> On Thu, 18 Jul 2002, Daniel Jacobowitz wrote:
>
> > On Thu, Jul 18, 2002 at 04:00:43PM -0400, Paul Dubuc wrote:
> > > I'm using gdb 5.2 on Solaris 8 to debug code compiled with g++ 2.95.3.
> > > When I try to enter 'catch throw' or 'catch catch' commands I get a
> > > message that says
> > >
> > > no runtime support for this
> > >
> > > Does this mean I need to rebuild gdb to support these commands or is it
> > > just that they aren't supported for this OS or compiler?
> > >
> > > I can't find any info in the manual about this.
> >
> > I believe they're only supported on HP/UX (and none of the HP/UX
> > support works quite right any more...). I don't think anyone has tried
> > to implement them on GCC code yet.
>
> Actually, I did, and had it working just fine.
> It's actually not that difficult, but it is ABI specific.
Have you still got the code to do this? I'd like to see it. Although
I've got a pretty good idea how it's done now that I look over the
code.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: catchpoints
2002-07-18 13:09 ` catchpoints Daniel Berlin
2002-07-18 13:13 ` catchpoints Daniel Jacobowitz
@ 2002-07-18 13:17 ` Paul Dubuc
2002-07-18 13:21 ` catchpoints Daniel Jacobowitz
1 sibling, 1 reply; 9+ messages in thread
From: Paul Dubuc @ 2002-07-18 13:17 UTC (permalink / raw)
To: Daniel Berlin; +Cc: Daniel Jacobowitz, gdb
Daniel Berlin wrote:
>
> On Thu, 18 Jul 2002, Daniel Jacobowitz wrote:
>
> > On Thu, Jul 18, 2002 at 04:00:43PM -0400, Paul Dubuc wrote:
> > > I'm using gdb 5.2 on Solaris 8 to debug code compiled with g++ 2.95.3.
> > > When I try to enter 'catch throw' or 'catch catch' commands I get a
> > > message that says
> > >
> > > no runtime support for this
> > >
> > > Does this mean I need to rebuild gdb to support these commands or is it
> > > just that they aren't supported for this OS or compiler?
> > >
> > > I can't find any info in the manual about this.
> >
> > I believe they're only supported on HP/UX (and none of the HP/UX
> > support works quite right any more...). I don't think anyone has tried
> > to implement them on GCC code yet.
>
> Actually, I did, and had it working just fine.
> It's actually not that difficult, but it is ABI specific.
Which version of GCC does it work for? If it doesn't work for 2.95.3,
does it work for 3.1?
--
Paul M. Dubuc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: catchpoints
2002-07-18 13:17 ` catchpoints Paul Dubuc
@ 2002-07-18 13:21 ` Daniel Jacobowitz
2002-07-18 13:40 ` catchpoints Paul Dubuc
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2002-07-18 13:21 UTC (permalink / raw)
To: Paul Dubuc; +Cc: Daniel Berlin, gdb
On Thu, Jul 18, 2002 at 04:17:27PM -0400, Paul Dubuc wrote:
> Daniel Berlin wrote:
> >
> > On Thu, 18 Jul 2002, Daniel Jacobowitz wrote:
> >
> > > On Thu, Jul 18, 2002 at 04:00:43PM -0400, Paul Dubuc wrote:
> > > > I'm using gdb 5.2 on Solaris 8 to debug code compiled with g++ 2.95.3.
> > > > When I try to enter 'catch throw' or 'catch catch' commands I get a
> > > > message that says
> > > >
> > > > no runtime support for this
> > > >
> > > > Does this mean I need to rebuild gdb to support these commands or is it
> > > > just that they aren't supported for this OS or compiler?
> > > >
> > > > I can't find any info in the manual about this.
> > >
> > > I believe they're only supported on HP/UX (and none of the HP/UX
> > > support works quite right any more...). I don't think anyone has tried
> > > to implement them on GCC code yet.
> >
> > Actually, I did, and had it working just fine.
> > It's actually not that difficult, but it is ABI specific.
>
> Which version of GCC does it work for? If it doesn't work for 2.95.3,
> does it work for 3.1?
I'm pretty sure that the code Daniel B. is talking about is not in the
current GDB tree. Perhaps next release...
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: catchpoints
2002-07-18 13:21 ` catchpoints Daniel Jacobowitz
@ 2002-07-18 13:40 ` Paul Dubuc
2002-07-18 13:43 ` catchpoints Daniel Jacobowitz
0 siblings, 1 reply; 9+ messages in thread
From: Paul Dubuc @ 2002-07-18 13:40 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Daniel Berlin, gdb
Daniel Jacobowitz wrote:
>
> On Thu, Jul 18, 2002 at 04:17:27PM -0400, Paul Dubuc wrote:
> > Daniel Berlin wrote:
> > >
> > > On Thu, 18 Jul 2002, Daniel Jacobowitz wrote:
> > >
> > > > On Thu, Jul 18, 2002 at 04:00:43PM -0400, Paul Dubuc wrote:
> > > > > I'm using gdb 5.2 on Solaris 8 to debug code compiled with g++ 2.95.3.
> > > > > When I try to enter 'catch throw' or 'catch catch' commands I get a
> > > > > message that says
> > > > >
> > > > > no runtime support for this
> > > > >
> > > > > Does this mean I need to rebuild gdb to support these commands or is it
> > > > > just that they aren't supported for this OS or compiler?
> > > > >
> > > > > I can't find any info in the manual about this.
> > > >
> > > > I believe they're only supported on HP/UX (and none of the HP/UX
> > > > support works quite right any more...). I don't think anyone has tried
> > > > to implement them on GCC code yet.
> > >
> > > Actually, I did, and had it working just fine.
> > > It's actually not that difficult, but it is ABI specific.
> >
> > Which version of GCC does it work for? If it doesn't work for 2.95.3,
> > does it work for 3.1?
>
> I'm pretty sure that the code Daniel B. is talking about is not in the
> current GDB tree. Perhaps next release...
If it's ABI specific then it's not going to work for both these versions
of GCC unless it was implemented for both. Right?
--
Paul M. Dubuc
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: catchpoints
2002-07-18 13:40 ` catchpoints Paul Dubuc
@ 2002-07-18 13:43 ` Daniel Jacobowitz
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Jacobowitz @ 2002-07-18 13:43 UTC (permalink / raw)
To: Paul Dubuc; +Cc: Daniel Berlin, gdb
On Thu, Jul 18, 2002 at 04:40:45PM -0400, Paul Dubuc wrote:
> Daniel Jacobowitz wrote:
> >
> > On Thu, Jul 18, 2002 at 04:17:27PM -0400, Paul Dubuc wrote:
> > > Daniel Berlin wrote:
> > > >
> > > > On Thu, 18 Jul 2002, Daniel Jacobowitz wrote:
> > > >
> > > > > On Thu, Jul 18, 2002 at 04:00:43PM -0400, Paul Dubuc wrote:
> > > > > > I'm using gdb 5.2 on Solaris 8 to debug code compiled with g++ 2.95.3.
> > > > > > When I try to enter 'catch throw' or 'catch catch' commands I get a
> > > > > > message that says
> > > > > >
> > > > > > no runtime support for this
> > > > > >
> > > > > > Does this mean I need to rebuild gdb to support these commands or is it
> > > > > > just that they aren't supported for this OS or compiler?
> > > > > >
> > > > > > I can't find any info in the manual about this.
> > > > >
> > > > > I believe they're only supported on HP/UX (and none of the HP/UX
> > > > > support works quite right any more...). I don't think anyone has tried
> > > > > to implement them on GCC code yet.
> > > >
> > > > Actually, I did, and had it working just fine.
> > > > It's actually not that difficult, but it is ABI specific.
> > >
> > > Which version of GCC does it work for? If it doesn't work for 2.95.3,
> > > does it work for 3.1?
> >
> > I'm pretty sure that the code Daniel B. is talking about is not in the
> > current GDB tree. Perhaps next release...
>
> If it's ABI specific then it's not going to work for both these versions
> of GCC unless it was implemented for both. Right?
Sure, but implementing it for the other is most likely very simple. It
looks that way at least.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: catchpoints
2002-07-18 13:13 ` catchpoints Daniel Jacobowitz
@ 2002-07-18 14:02 ` Daniel Berlin
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Berlin @ 2002-07-18 14:02 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Paul Dubuc, gdb
On Thu, 18 Jul 2002, Daniel Jacobowitz wrote:
> On Thu, Jul 18, 2002 at 04:09:01PM -0400, Daniel Berlin wrote:
> > On Thu, 18 Jul 2002, Daniel Jacobowitz wrote:
> >
> > > On Thu, Jul 18, 2002 at 04:00:43PM -0400, Paul Dubuc wrote:
> > > > I'm using gdb 5.2 on Solaris 8 to debug code compiled with g++ 2.95.3.
> > > > When I try to enter 'catch throw' or 'catch catch' commands I get a
> > > > message that says
> > > >
> > > > no runtime support for this
> > > >
> > > > Does this mean I need to rebuild gdb to support these commands or is it
> > > > just that they aren't supported for this OS or compiler?
> > > >
> > > > I can't find any info in the manual about this.
> > >
> > > I believe they're only supported on HP/UX (and none of the HP/UX
> > > support works quite right any more...). I don't think anyone has tried
> > > to implement them on GCC code yet.
> >
> > Actually, I did, and had it working just fine.
> > It's actually not that difficult, but it is ABI specific.
>
> Have you still got the code to do this?
I don't think so, it was done when i was working on GDB for BeOS, which
was over a year and a half ago.
> I'd like to see it. Although
> I've got a pretty good idea how it's done now that I look over the
> code.
For general catch/throw, for gcc 3.1, you breakpoint _cxa_begin_catch,
with the bp_catch_catch type, and _cxa_throw, with the bp_catch_throw
type.
You need to modify catch_exception_command_1 to breakpoint these.
You also need a generic get_current_exception_event that fills in the
record by looking at the location one or two levels up the stack frame,
which will be the throw or catch location.
At least, it used to be.
I'm sure the throw will still be like that, the catch location might be a
bit
different to handle.
We can also catch specific exceptions only (which would require extending
the syntax of catch a bit) by looking at the exceptionType field of the
exceptionObject local variable in cxa_begin_catch, which will be a
std::type_info structure, where we can get the mangled name from.
Same with throw, except the type_info is passed in to the throw routine as
an argument, so you don't have to wait for a local variable to be set up
(or cast the argument to _Unwind_Exception * yerself, which is what that
local variable is init'd to anyway).
THe other option to get the type is to call __cxa_current_exception_type,
which will do this all for you and hand you the type_info. While I think
is also part of the ABI, i only see __cxa_begin_catch/throw/end_catch in
Intel's exception library, so it might not be.
All of these routine names are specified as part of the C++ ABI, so they
would be the same in any other compiler using the C++ ABI.
Lastly, throw the generic exception routine in whatever targets you like,
and it'll all just work.
It didn't takek more than about 2 hours to do when i originally did it.
Just look at libstdc++-v3/libsupc++/eh_* if you need more information on
how the routines work/the arguments/etc
--Dan
> >
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2002-07-18 21:02 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-18 13:00 catchpoints Paul Dubuc
2002-07-18 13:05 ` catchpoints Daniel Jacobowitz
2002-07-18 13:09 ` catchpoints Daniel Berlin
2002-07-18 13:13 ` catchpoints Daniel Jacobowitz
2002-07-18 14:02 ` catchpoints Daniel Berlin
2002-07-18 13:17 ` catchpoints Paul Dubuc
2002-07-18 13:21 ` catchpoints Daniel Jacobowitz
2002-07-18 13:40 ` catchpoints Paul Dubuc
2002-07-18 13:43 ` catchpoints Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox