[Issue 20460] Stack traces on OSX show wrong file / line

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 10 10:45:17 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20460

--- Comment #2 from Mathias LANG <pro.mathias.lang at gmail.com> ---
Found a way to reproduce:

--- a.d
module a;

import b;
import c;

void main ()
{
    auto o1 = new Foo();
    o1.bar(5);
}
--- b.d
module b;

extern(C++) void func() {}
--- c.d
module c;

extern(C++) class Foo
{
    void bar(int rec)
    {
        assert(0);
    }
}

Compile and run:
$ dmd -g b.d c.d -run a.d
core.exception.AssertError at c.d(9): Assertion failure
----------------
??:? _d_assertp [0x10916d89d]
b.d:3 _ZN3Foo3barEi [0x1091608d7]
a.d:9 _Dmain [0x109160881]


The file/line points to `b.d:3` (the first function in that file) while it
should be `c.d:7`. Note that even if `bar` calls other functions, all their
file/line will point to the same entry.

--


More information about the Digitalmars-d-bugs mailing list