Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
December 30, 2013 Accessing vtable, initialiser, etc symbols from debug (gdb) | ||||
---|---|---|---|---|
| ||||
Hi. I've fixed up the D demangler in gdb with one or two hicks left to address. As the below auto-complete feature presents, the full function signatures are now shown. (gdb) break 'gdbstress.testsig( gdbstress.testsig(double) gdbstress.testsig(float) gdbstress.testsig(real) Currently, I have been dwelling on the best way to express the following symbols: __ctorMFZ __dtorMFZ __postblitMFZ __initZ __ClassZ __vtblZ __InterfaceZ __ModuleInfoZ This is the current mapping I've got in my local branch: __ctor -> this __dtor -> ~this __postblit -> this(this) __init -> init __Class -> classinfo __vtbl -> vtable __interface -> interfaceinfo __ModuleInfo -> moduleinfo However I'm not sure if the names are sufficient, and whether or not they should really be prefixed with a double underscore to ensure that they don't conflict with user-declared members (especially the compiler-generated symbols). What do you think? (gdb) print 'gdbstress.testmembers. gdbstress.testmembers.this(this, int) gdbstress.testmembers.~this() gdbstress.testmembers.this(this) gdbstress.testmembers.init Regards Iain. |
December 30, 2013 Re: Accessing vtable, initialiser, etc symbols from debug (gdb) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | On 2013-12-30 13:24, Iain Buclaw wrote: > However I'm not sure if the names are sufficient, and whether or not > they should really be prefixed with a double underscore to ensure that > they don't conflict with user-declared members (especially the > compiler-generated symbols). I think they should have some kind of prefix to avoid conflict with user declared symbols and somehow indicate they're special symbols. -- /Jacob Carlborg |
December 31, 2013 Re: Accessing vtable, initialiser, etc symbols from debug (gdb) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Monday, 30 December 2013 at 12:57:57 UTC, Jacob Carlborg wrote:
> On 2013-12-30 13:24, Iain Buclaw wrote:
>
>> However I'm not sure if the names are sufficient, and whether or not
>> they should really be prefixed with a double underscore to ensure that
>> they don't conflict with user-declared members (especially the
>> compiler-generated symbols).
>
> I think they should have some kind of prefix to avoid conflict with user declared symbols and somehow indicate they're special symbols.
I had already gathered that much when I spoke to David on IRC. I was looking for some more concrete suggestions really.
Also Brad, I haven't received any ML messages since 29th? :-)
Regards,
Iain.
|
December 31, 2013 Re: Accessing vtable, initialiser, etc symbols from debug (gdb) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | On Tuesday, 31 December 2013 at 12:22:54 UTC, Iain Buclaw wrote:
>
> Also Brad, I haven't received any ML messages since 29th? :-)
>
Oh never mind,, I think I know the problem. :(
|
January 02, 2014 Re: Accessing vtable, initialiser, etc symbols from debug (gdb) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On 30 December 2013 12:57, Jacob Carlborg <doob@me.com> wrote:
> On 2013-12-30 13:24, Iain Buclaw wrote:
>
>> However I'm not sure if the names are sufficient, and whether or not they should really be prefixed with a double underscore to ensure that they don't conflict with user-declared members (especially the compiler-generated symbols).
>
>
> I think they should have some kind of prefix to avoid conflict with user declared symbols and somehow indicate they're special symbols.
>
Special symbols can be suffixed with a $ perhaps. I can't think of any other symbol that would work.
__init -> init$
__Class -> classinfo$
__vtbl -> vtable$
__interface -> interfaceinfo$
__ModuleInfo -> moduleinfo$
The alternative is to just go for prefixing with double underscore, given that the names are OK?
__init -> __init
__Class -> __classinfo
__vtbl -> __vtable
__interface -> __interfaceinfo
__ModuleInfo -> __moduleinfo
Regards
Iain
|
January 02, 2014 Re: Accessing vtable, initialiser, etc symbols from debug (gdb) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | Iain Buclaw <ibuclaw@gdcproject.org> writes:
> On 30 December 2013 12:57, Jacob Carlborg <doob@me.com> wrote:
>> On 2013-12-30 13:24, Iain Buclaw wrote:
>>
>>> However I'm not sure if the names are sufficient, and whether or not they should really be prefixed with a double underscore to ensure that they don't conflict with user-declared members (especially the compiler-generated symbols).
>>
>>
> Special symbols can be suffixed with a $ perhaps. I can't think of any other symbol that would work.
>
> __init -> init$
> __Class -> classinfo$
> __vtbl -> vtable$
> __interface -> interfaceinfo$
> __ModuleInfo -> moduleinfo$
I like this approach. Do we need the "info" in classinfo$, interfaceinfo$, and moduleinfo$?
Jerry
|
January 03, 2014 Re: Accessing vtable, initialiser, etc symbols from debug (gdb) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw |
On 02.01.2014 12:35, Iain Buclaw wrote:
>
> Special symbols can be suffixed with a $ perhaps. I can't think of
> any other symbol that would work.
>
> __init -> init$
> __Class -> classinfo$
> __vtbl -> vtable$
> __interface -> interfaceinfo$
> __ModuleInfo -> moduleinfo$
>
>
> The alternative is to just go for prefixing with double underscore,
> given that the names are OK?
>
> __init -> __init
> __Class -> __classinfo
> __vtbl -> __vtable
> __interface -> __interfaceinfo
> __ModuleInfo -> __moduleinfo
>
I think double underscores should be hint enough to suggest "compiler generated stuff". Prepending $ might confuse expression evaluators (e.g. mago).
I always wondered why these symbols don't follow the standard mangling to start with...
|
Copyright © 1999-2021 by the D Language Foundation