[RFA] gcj PR debug/40990
Dodji Seketeli
dodji@redhat.com
Mon Aug 10 17:05:00 GMT 2009
Le 10/08/2009 19:10, Dave Korn a écrit :
> Dodji Seketeli wrote:
>> Le 10/08/2009 18:03, Andrew Haley a écrit :
>>> Andrew Haley wrote:
>>>> Dodji Seketeli wrote:
>>>>> I noticed that gcj was emitting some "unnamed" methods for the class
>>>>> java.lang.String. I am not sure what those methods are. Maybe the
>>>>> contructors ? I am talking about the methods represented the DIE 0x88, for
>>>>> instance. In any case, before this patch, gcj was emitting the string "()"
>>>>> as method name, in the .debug_pubnames section. Now with the patch, it just
>>>>> emits an empty string. This is weird, but I think the patch doesn't make
>>>>> the situation worse.
>>>> I don't know. I'll have a look.
>>> It's quite explicit:
>>>
>>> if (! DECL_CONSTRUCTOR_P (node))
>>> put_decl_node (DECL_NAME (node));
>>>
>>> So, constructors don't have names. What does C++ do for constructors?
>> In c++, for a class named "s", the name of the constructor in the dwarf
>> output would be the string "s".
>
> Are you sure? It looks to me like it uses the fully-qualified name "s::s"
>
> $ cat s.cxx
>
> #include <stdlib.h>
> #include <string.h>
>
> class s
> {
> int foo;
> char *bar;
> s(const char *);
> };
>
> s::s(const char *x)
> {
> foo = strlen (x);
> bar = (char *) malloc (foo);
> strcpy (bar, x);
> }
>
> $ g++-4 -S s.cxx -g -O0 -o s.s
>
> $ grep -A20 debug_pubname s.s
> .section .debug_pubnames,"dr"
> .long 0x20
> .word 0x2
> .secrel32 Ldebug_info0
> .long 0x1c1
> .long 0x178
> .ascii "s::s\0"
> .long 0x19e
> .ascii "s::s\0"
> .long 0x0
> .section .debug_pubtypes,"dr"
>
Ah, for the pubname section, you are correct yes. I was talking about the
DW_AT_name attribute of the constructor DIE in the .debug_info section. Not
about constructor name in the .debug_pubnames section.
--
Dodji Seketeli
Red Hat
More information about the Gcc-patches
mailing list