June 24, 2018
https://bugzilla.gdcproject.org/show_bug.cgi?id=294

            Bug ID: 294
           Summary: Debug names of extern(C++) symbols doesn't match C++
           Product: GDC
           Version: development
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw@gdcproject.org
          Reporter: ibuclaw@gdcproject.org

Debug names of extern(C++) - and probably extern(C) also - symbols include module names that they are declared in, which doesn't match up to the names generated by g++, so the debugger is not able to match up the type when debugging from the C++ side.

---
(gdb) p base
$1 = (AggregateDeclaration *) 0x7ffff5a4cc00

(gdb) p *base
$2 = <incomplete type>
---

Current workaround is to explicitly cast to the gdc generated type name.

---
(gdb) p ('dmd.aggregate.AggregateDeclaration'*)base
$3 = (dmd.aggregate.AggregateDeclaration *) 0x7ffff5a4cc00

(gdb) p *('dmd.aggregate.AggregateDeclaration'*)base
warning: can't find linker symbol for virtual table for
`dmd.aggregate.AggregateDeclaration' value
warning:   found `initializer for dmd.dstruct.UnionDeclaration' instead
$4 = warning: can't find linker symbol for virtual table for
`dmd.aggregate.AggregateDeclaration' value
warning:   found `initializer for dmd.dstruct.UnionDeclaration' instead
{<dmd.dsymbol.ScopeDsymbol> = {<dmd.dsymbol.Dsymbol> =
{<dmd.root.rootobject.RootObject> = {__vptr = 0x2103b38 <vtable for
dmd.dstruct.StructDeclaration>}, ident = 0x7ffff7ea3a00, parent =
0x7ffff5a4c800, csym =
 0x0, isym = 0x0, comment = 0x0, loc = {filename = 0x23aa8a0
"std/algorithm/setops.d", linnum = 27, charnum = 13}, _scope = 0x0,
prettystring = 0x23a4420
"setops.BinaryHeap!(compFront).BinaryHeap.RefCounted.Impl
", errors = false, semanticRun = dmd.dsymbol.PASS.semantic3done, depdecl = 0x0,
userAttribDecl = 0x0, ddocUnittest = 0x0}, members = 0x7ffff5a49240, symtab =
0x7ffff7ea4700, endlinnum = 0, importedScopes = 0x0,
prots = 0x0, accessiblePackages = {len = 0, ptr = 0x0},
privateAccessiblePackages = {len = 0, ptr = 0x0}}, type = 0x7ffff5a4ab00,
storage_class = 0, protection = {kind = dmd.dsymbol.Prot.Kind.public_, pkg =
0x0}
, structsize = 1, alignsize = 1, fields = {dim = 1, data = 0x7ffff5a4ccf8,
allocdim = 1, smallarray = {0x7ffff5a4b600}}, sizeok =
dmd.aggregate.Sizeok.done, deferred = 0x0, isdeprecated = false, classKind =
dmd.
aggregate.ClassKind.d, enclosing = 0x0, vthis = 0x0, invs = {dim = 0, data =
0x0, allocdim = 0, smallarray = {0x0}}, inv = 0x0, aggNew = 0x0, aggDelete =
0x0, ctor = 0x0, defaultCtor = 0x0, aliasthis = 0x0, noDe
faultCtor = false, dtors = {dim = 0, data = 0x0, allocdim = 0, smallarray =
{0x0}}, dtor = 0x0, primaryDtor = 0x0, tidtor = 0x0, getRTInfo = 0x249fa90,
stag = 0x0, sinit = 0x7ffff5725750}
---

-- 
You are receiving this mail because:
You are watching all bug changes.