Waldek Hebisch wrote:
It seems that machopic_output_function_base_name tries to use
DECL_ASSEMBLER_NAME (current_function_decl)
however, at this time we are outside any function, so current_function_decl is NULL, and we get null pointer exception. Looking at output_addr_const I see that it uses assemble_name function which (via assemble_name_raw) uses ASM_OUTPUT_LABELREF. This macro calls machopic_output_function_base_name if the name is "<pic base>".
ATM I have no idea how this name could appear in expression outside a function, but clearly the details are Darwin specific.
Unfortunately, upon trying out dwarf-2 with the new compiler on OS X, Gale Paper noticed that it didn't work at all. Some time ago, it did work and better than with stabs http://www.gnu-pascal.de/crystal/gpc/en/mail13505.html. I found the reason to be Apple removed support for __DWARFA segments in GDB, implementing a new scheme http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01092.html. The patches needed can not be easily back-ported to gcc-4.1.2, because assembler handling of sections has been reworked from gcc-4.1 to gcc-4.2 http://gcc.gnu.org/ml/gcc-patches/2005-11/msg01848.html.
So, although I am very grateful for the gcc-4.1 integration, I am looking forward for gcc-4.2 support.
Regards,
Adriaan van Os