Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* catch throw -how?
@ 2003-01-28 15:35 Markus Werle
  2003-01-28 15:42 ` Daniel Jacobowitz
  2003-01-28 15:47 ` Bennett F. Dill
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Werle @ 2003-01-28 15:35 UTC (permalink / raw)
  To: gdb

Hi!

Using gdb-5.1.1 I wanted to use the "catch" feature for C++ exceptions like this

# gdb ./myprogram
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) catch throw
You can't do that without a process to debug.
(gdb)

1. I do not understand the error message, please explain
2. Is this a bug resolved in gdb-5.3 or am I missing some information?


best regards,


Markus


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: catch throw -how?
  2003-01-28 15:35 catch throw -how? Markus Werle
@ 2003-01-28 15:42 ` Daniel Jacobowitz
  2003-01-28 16:58   ` Markus Werle
  2003-01-28 15:47 ` Bennett F. Dill
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-01-28 15:42 UTC (permalink / raw)
  To: Markus Werle; +Cc: gdb

On Tue, Jan 28, 2003 at 04:35:14PM +0100, Markus Werle wrote:
> Hi!
> 
> Using gdb-5.1.1 I wanted to use the "catch" feature for C++ exceptions like this
> 
> # gdb ./myprogram
> GNU gdb 5.1.1
> Copyright 2002 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu"...
> (gdb) catch throw
> You can't do that without a process to debug.
> (gdb)
> 
> 1. I do not understand the error message, please explain
> 2. Is this a bug resolved in gdb-5.3 or am I missing some information?

I don't think that "catch throw" works on any GNU/Linux target right
now.  I've got it about half re-implemented for GCC 3.x in a scratch
directory right now but I don't know when I'm going to have time to
test it.

You can get just about the same effect in GCC 3.x by putting a
breakpoint on __cxa_throw.  In 2.x I think it was __throw.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: catch throw -how?
  2003-01-28 15:35 catch throw -how? Markus Werle
  2003-01-28 15:42 ` Daniel Jacobowitz
@ 2003-01-28 15:47 ` Bennett F. Dill
  1 sibling, 0 replies; 4+ messages in thread
From: Bennett F. Dill @ 2003-01-28 15:47 UTC (permalink / raw)
  To: Markus Werle; +Cc: gdb

On Tue, Jan 28, 2003 at 04:35:14PM +0100, Markus Werle wrote:
> Hi!
> 
> Using gdb-5.1.1 I wanted to use the "catch" feature for C++ exceptions like this
> 
> # gdb ./myprogram
> GNU gdb 5.1.1
> Copyright 2002 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu"...
> (gdb) catch throw
> You can't do that without a process to debug.
> (gdb)
> 
> 1. I do not understand the error message, please explain
> 2. Is this a bug resolved in gdb-5.3 or am I missing some information?
> 
> 
> best regards,
> 
> 
> Markus
> 
Markus,

I'm not sure, but i think you may need to specify a core file at
startup, or attach to a process that you want to debug...

process id of program to debug = 4128
user@host:~$ gdb
(gdb) attach 4128
Attaching to process 4128
Reading symbols from /usr/lib/libcurses.so.1...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libc.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libdl.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1...  (no debugging symbols found)...done.
Symbols already loaded for /usr/lib/libcurses.so.1
Symbols already loaded for /usr/lib/libc.so.1
Symbols already loaded for /usr/lib/libdl.so.1
Symbols already loaded for /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1
0xff319ad4 in syscall () from /usr/lib/libc.so.1
(gdb)

now try your catch...  I'm not sure if that helps or not, but good luck
:-)

Ben


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: catch throw -how?
  2003-01-28 15:42 ` Daniel Jacobowitz
@ 2003-01-28 16:58   ` Markus Werle
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Werle @ 2003-01-28 16:58 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Daniel Jacobowitz wrote:

> You can get just about the same effect in GCC 3.x by putting a
> breakpoint on __cxa_throw.

Bingo!
Many, many thanks for this hint.


best regards,


Markus


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-28 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-28 15:35 catch throw -how? Markus Werle
2003-01-28 15:42 ` Daniel Jacobowitz
2003-01-28 16:58   ` Markus Werle
2003-01-28 15:47 ` Bennett F. Dill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox