C program:

```C
int notice_me_global = -1;

void main()
{
    notice_me_global = -5;
}
```

``cl app_c.c /DEBUG /Zi /EHsc /std:c11 /link /DEBUG /out:app_c.exe``

``llvm-pdbutil.exe dump --globals app_c.pdb > dump_c``

```
  688476 | S_GDATA32 [size = 32] `notice_me_global`
           type = 0x0074 (int), addr = 0003:0040
```






D program:

```D
__gshared int notice_me_global = -1;

extern(C) void main()
{
    notice_me_global = 5;
    int* a;
    *a = 1;
}
```

``dmd -betterC -m64 -g -debug app_d.d``

``llvm-pdbutil.exe dump --globals app_d.pdb > dump_d``

```
       0 | S_GDATA32 [size = 40] `app_d.notice_me_global`
           type = 0x0074 (int), addr = 0003:3504
```



Open question:


Why is it:

For D: ``0 |``
For C: ``688476 |``


Potential issue:

Debugger doesn't understand: the ``.`` in the name ``app_d.notice_me_global``, mangled name also doesn't work

That's the info i provided in the microsoft tracker, maybe some people here can notice something else that's wrong


dump_c: https://gist.github.com/ryuukk/40c6d7d1cd3d6a010242d505380fe233 dump_d: https://gist.github.com/ryuukk/38f43383025907a8f44049503887206c
  • Re: How to debug... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
    • Re: How to ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: How... ryuukk_ via Digitalmars-d-learn
        • Re:... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
    • Re: How to ... ryuukk_ via Digitalmars-d-learn
      • Re: How... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
        • Re:... WebFreak001 via Digitalmars-d-learn
        • Re:... ryuukk_ via Digitalmars-d-learn
          • ... ryuukk_ via Digitalmars-d-learn
            • ... ryuukk_ via Digitalmars-d-learn
              • ... ryuukk_ via Digitalmars-d-learn
              • ... ryuukk_ via Digitalmars-d-learn
              • ... ryuukk_ via Digitalmars-d-learn
              • ... ryuukk_ via Digitalmars-d-learn
              • ... Steven Schveighoffer via Digitalmars-d-learn
              • ... ryuukk_ via Digitalmars-d-learn
              • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
              • ... Salih Dincer via Digitalmars-d-learn

Reply via email to