List Info

Thread: catch catch before program starts




catch catch before program starts
country flaguser name
Canada
2008-04-28 15:51:17
Hello,

When we first load symbols, we can not set "catch
catch" or "catch throw". The error message
will say "Function __cxa_... not defined".

However, we can set a breakpoint in .plt section. The
attached patch illustrates this (it is not finished as there
will be some error messages even though the catch will be
set).

The idea is to try __cxa_begin_catch and then, failing that,
to try with __cxa_begin_catchplt. 

Now:
(gdb) catch catch
Function "__cxa_begin_catch" not defined.
(gdb)


After patch:
(gdb) file /tmp/sig/main
Reading symbols from /tmp/sig/main...done.
(gdb) catch catch
Oops...Function "__cxa_begin_catch" not defined.
Catchpoint 1 (catch)
(gdb) catch throw
Oops...Function "__cxa_throw" not defined.
Catchpoint 2 (throw)

(Ignore the "Oops" part).


Comments?

Aleksandar Ristovski
QNX Software Systems

  
Re: catch catch before program starts
country flaguser name
United States
2008-04-28 16:07:34
On Mon, Apr 28, 2008 at 04:51:17PM -0400, Aleksandar
Ristovski wrote:
> Hello,
>
> When we first load symbols, we can not set "catch
catch" or "catch throw". The error message
will say "Function __cxa_... not defined".
>
> However, we can set a breakpoint in .plt section. The
attached patch illustrates this (it is not finished as there
will be some error messages even though the catch will be
set).

I suggest this be handled in the generic breakpoint-setting
code, not
specific to "catch".  It's not a complete
solution, by the way: it
will only help if the main executable uses catch / throw. 
If only
shared libraries do, then there won't be a PLT entry in the
executable.  So maybe we should allow these breakpoints to
be created
"pending"?

-- 
Daniel Jacobowitz
CodeSourcery

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )