[RFA] Runtime Dwarf2 CFI engine cleanup

Michal Ludvig mludvig@suse.cz
Mon Feb 10 12:30:00 GMT 2003


Elena Zannoni wrote:
> Michal Ludvig writes:
>  > Hi all,
>  > the attached is a fix for the problem described here:
>  > http://sources.redhat.com/ml/gdb/2002-12/msg00246.html
>  > 
>  > I've created a new function cleanup_cfi() in dwarf2cfi.c that deletes 
>  > all CIEs and FDEs of objfiles removed later by objfile_purge_solibs().
>  > So far it works fine but I don't know how should I correctly call it.
> 
> 
> I have tried your function, and it does fixes some weird errors which occur
> on rerun. 
> 
> I just tried by using the hack of defining GDB_TARGET_IS_X86_64, which
> is definitely a bad thing.
> 
> I think that the best way is to define a gdbarch method, just like it
> was done for gdbarch_dwarf2_build_frame_info.

How about adding dwarf2cfi.o to all targets? When there is for example 
mipsread.o compiled into gdb on x86-64 (why? because there is no option 
to say what features a given target needs.) than dwarf2cfi.o could go 
there as well...
I hope more and more targets will use it in the near future.

The attached is a version that adds dwarf2cfi.o for all targets. If it's 
unacceptable this way I'll provide gdbarch-ed version instead. But I 
think that gdbarch_*() functions are good for the case when on different 
targets a different functions are called to do a given task (eg. read 
register). But in this case you must call cleanup_cfi() in all targets 
that use CFI. No option. Calling it shouldn't depend on setting gdbarch 
value. Instead it should depend on linking dwarf2cfi.o into the gdb.

> In the patch below, you cannot use printf's. Use printf_filtered. But
> maybe, better yet, using a warning here would be more appropriate.

It isn't a warning, just an informational message. Now it's printed only 
when info_verbose is set.

> Watch out for the non-GNU indentation and spacing.

Reindented.

OK to commit?

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* (+420) 296.545.373 * http://www.suse.cz
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rerun-cfi4all-2.diff
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20030210/595b3189/attachment.ksh>


More information about the Gdb-patches mailing list