[Mono-list] JIT patch for stabs debugging

Paolo Molaro lupus@ximian.com
Tue, 12 Mar 2002 12:39:21 +0100


On 03/11/02 Martin Baulig wrote:
> The feature which is missing in gdb 5.0 is DW_FORM_strp:
> 
> In dwarf2, there are two ways to specify a string (for instance, a file
> or method name) attribute:
> 
> a) you use DW_FORM_string and the zero-terminated string as attribute
>    value.
> 
>    The generated assembler code looks like this:
> 
>    .string "Test.il"
> 
> b) you use DW_FORM_strp and an offset into the string table.
> 
>    The generated code looks like this:
> 
>    .long .L_DSTR_3
> 
>    and somewhere in the file, you have
> 
> ====
> 	.section	.debug_str
> .L_DSTR_3:
> 	.string		"Test__Main_0x8114bb8"
> .L_DSTR_1:
> 	.string		"Test.il"
> .L_DSTR_2:
> 	.string		"Mono JIT compiler version 0.9"
> 	.previous
> ====
> 
> The second method (which can reduce the size of the generated symbol
> file a lot since each string is only stored once) is not supported by
> gdb 5.0.
> 
> It won't be a problem to decide at runtime which one to use.

I'd say that the debug object size is not a problem, so I wouldn't
introduce a switch for this reason alone.

> > Also, don't delete the support for stabs, since it's possible it could
> > be the only debugging format of some platforms.
> 
> Sure. I rewrote debug.c to make it much more modular so that we can
> even support other debugging formats in future.

Excellent.

> It also solves the relocation problem - mono_debug_make_symbols () can
> now safely be called multiple times and it always writes a complete
> symbol file (with dwarf, you cannot simply append to a file like it's
> done in the stabs code).

I guess the same technique could be used with stabs, but if we have
dwarf support, it's fine with me: when someone needs better stabs
support he can simply step up to the plate and enhance them;-)

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better