This is the mail archive of the
mailing list for the GCC project.
Re: RFA: Use _Unwind_Ptr (Was: Re: RFC / RFA: dwarf2 unwinding for targets with call-part-clobbered registers)
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: rth at redhat dot com (Richard Henderson)
- Cc: joern dot rennecke at superh dot com (Joern Rennecke), wilson at tuliptree dot org (Jim Wilson), gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Jul 2003 18:53:44 +0100 (BST)
- Subject: Re: RFA: Use _Unwind_Ptr (Was: Re: RFC / RFA: dwarf2 unwinding for targets with call-part-clobbered registers)
> Hum. I'm not thrilled. And I think it may miss out on external
> users of _Unwind_GetGR etc.
I can't find any evidence of relevant external users.
bash-2.05$ find . -type f | xargs grep -c _Unwind_GetGR|grep -v :0
unwind.h has a declaration and an ia64-specific use.
unwind-libunwind.c has a different definition, but no use.
> I like the _Unwind_GetPtr, for sure, for internal use. I think it
> should return void* instead of _Unwind_Ptr; all uses wind up casting
> anyway, and that's a nice cleanup.
> However, can we do something like
> _Unwind_GetGR (struct _Unwind_Context *context, int index)
> int uw_index = DWARF_REG_TO_UNWIND_COLUMN (index);
> int size = dwarf_reg_size_table[index];
> void *ptr = context->reg[uw_index];
> if (size == sizeof(_Unwind_Ptr))
> return * (_Unwind_Ptr *) ptr;
I think you need a cast here to avoid a warning.
> if (size == sizeof(_Unwind_Word))
> return * (_Unwind_Word *) ptr;
> abort ();
> static inline void *
> _Unwind_GetPtr (struct _Unwind_Context *context, int index)
> return (void *)(_Unwind_Ptr) _Unwind_GetGR (context, index);
> Similar changes for _Unwind_SetGR. We'll need to move the initialization
> of dwarf_reg_size_table, and I do recognize that this depends on your other
> patch to __builtin_init_dwarf_reg_size_table.
That would appear to give the right result - and even with more
functionality consistently available.
However, won't that kill unwinding performance?
If there are no performance concerns, I agree that your design is perferable
as the cleaner one.