www.digitalmars.com         C & C++   DMDScript  

D.gnu - Does gdb support D enums?

reply drug <drug2004 bk.ru> writes:
Using gdb `print` instead of enum value I see `incomplete type`. Did I 
miss something? (I use gdb 7.10 from ttp://ftp.gnu.org/gnu/gdb/)

Thanks
Oct 21 2015
next sibling parent reply Johannes Pfau <nospam example.com> writes:
Am Wed, 21 Oct 2015 11:45:58 +0300
schrieb drug <drug2004 bk.ru>:

 Using gdb `print` instead of enum value I see `incomplete type`. Did
 I miss something? (I use gdb 7.10 from ttp://ftp.gnu.org/gnu/gdb/)
 
 Thanks
Which gdc branch/version? And please provide a testcase as I can't reproduce this bug with a simple example: Breakpoint 1, D main () at test.d:11 11 TestEnum e; (gdb) print e $1 = a
Oct 21 2015
parent drug <drug2004 bk.ru> writes:
21.10.2015 18:22, Johannes Pfau пишет:
 Am Wed, 21 Oct 2015 11:45:58 +0300
 schrieb drug <drug2004 bk.ru>:

 Using gdb `print` instead of enum value I see `incomplete type`. Did
 I miss something? (I use gdb 7.10 from ttp://ftp.gnu.org/gnu/gdb/)

 Thanks
Which gdc branch/version? And please provide a testcase as I can't
Oh, sorry, I use dmd-built binaries, so this is the reason, I guess? Does gdb work as expected only with gdc-built binaries?
 reproduce this bug with a simple example:

 Breakpoint 1, D main () at test.d:11
 11	    TestEnum e;
 (gdb) print e
 $1 = a
Oct 21 2015
prev sibling parent reply "Iain Buclaw via D.gnu" <d.gnu puremagic.com> writes:
On 21 October 2015 at 10:45, drug via D.gnu <d.gnu puremagic.com> wrote:

 Using gdb `print` instead of enum value I see `incomplete type`. Did I
 miss something? (I use gdb 7.10 from ttp://ftp.gnu.org/gnu/gdb/)

 Thanks
Depends what you mean by 'enum'. Only integral types are treated as enum in the C sense. All other value types (bool, float) are treated as constant literals that you can only access through it's qualified name. Don't expect aggregate types (struct, array, associative array) to show properly either.
Oct 21 2015
parent reply drug <drug2004 bk.ru> writes:
21.10.2015 19:31, Iain Buclaw via D.gnu пишет:
 On 21 October 2015 at 10:45, drug via D.gnu <d.gnu puremagic.com
 <mailto:d.gnu puremagic.com>> wrote:

     Using gdb `print` instead of enum value I see `incomplete type`. Did
     I miss something? (I use gdb 7.10 from ttp://ftp.gnu.org/gnu/gdb/
     <http://ftp.gnu.org/gnu/gdb/>)

     Thanks



 Depends what you mean by 'enum'.  Only integral types are treated as
 enum in the C sense.  All other value types (bool, float) are treated as
 constant literals that you can only access through it's qualified name.
 Don't expect aggregate types (struct, array, associative array) to show
 properly either.
As I said above, I use dmd-build binaries and I should say that gdb works very well with structs for me. The only exception so far is enum.
Oct 21 2015
parent reply "Iain Buclaw via D.gnu" <d.gnu puremagic.com> writes:
On 21 October 2015 at 19:52, drug via D.gnu <d.gnu puremagic.com> wrote:

 21.10.2015 19:31, Iain Buclaw via D.gnu =D0=BF=D0=B8=D1=88=D0=B5=D1=82:

 On 21 October 2015 at 10:45, drug via D.gnu <d.gnu puremagic.com
 <mailto:d.gnu puremagic.com>> wrote:

     Using gdb `print` instead of enum value I see `incomplete type`. Did
     I miss something? (I use gdb 7.10 from ttp://ftp.gnu.org/gnu/gdb/
     <http://ftp.gnu.org/gnu/gdb/>)

     Thanks



 Depends what you mean by 'enum'.  Only integral types are treated as
 enum in the C sense.  All other value types (bool, float) are treated as
 constant literals that you can only access through it's qualified name.
 Don't expect aggregate types (struct, array, associative array) to show
 properly either.
As I said above, I use dmd-build binaries and I should say that gdb works very well with structs for me. The only exception so far is enum.
I meant enum : MyStruct { ... } I guess DMD does not support emitting enums to debug then.
Oct 21 2015
parent drug <drug2004 bk.ru> writes:
21.10.2015 21:04, Iain Buclaw via D.gnu пишет:
 I meant enum : MyStruct { ... }

 I guess DMD does not support emitting enums to debug then.
I see. Thanks!
Oct 21 2015