Thread overview
How to get stack trace on Windows?
Jul 22, 2011
Nick Sabalausky
Jul 22, 2011
Dmitry Olshansky
Jul 22, 2011
Nick Sabalausky
Jul 22, 2011
Dmitry Olshansky
Jul 24, 2011
Nick Sabalausky
Jul 24, 2011
Andrej Mitrovic
Jul 24, 2011
Nick Sabalausky
Jul 25, 2011
Dmitry Olshansky
July 22, 2011
I'm not getting any of the function names on the stack traces.

I tried everything I found in here: http://www.digitalmars.com/d/archives/digitalmars/D/Windows_Stack_Traces_Function_Names_136887.html

- I installed the "Debugging Tools for Windows" to update my dbghelp.dll

- I'm already compiling/linking in one step, and using -g (also tried -gc)

- I tried running the executable through cv2pdb.

None of it's working.


July 22, 2011
On 22.07.2011 6:54, Nick Sabalausky wrote:
> I'm not getting any of the function names on the stack traces.
>
> I tried everything I found in here:
> http://www.digitalmars.com/d/archives/digitalmars/D/Windows_Stack_Traces_Function_Names_136887.html
>
> - I installed the "Debugging Tools for Windows" to update my dbghelp.dll
>
> - I'm already compiling/linking in one step, and using -g (also tried -gc)
>
> - I tried running the executable through cv2pdb.
>
> None of it's working.
>
>

Last time I've seen stack trace it was due to this command:

dmd -debug -g ...

-- 
Dmitry Olshansky

July 22, 2011
"Dmitry Olshansky" <dmitry.olsh@gmail.com> wrote in message news:j0bgt7$176q$1@digitalmars.com...
> On 22.07.2011 6:54, Nick Sabalausky wrote:
>> I'm not getting any of the function names on the stack traces.
>>
>> I tried everything I found in here: http://www.digitalmars.com/d/archives/digitalmars/D/Windows_Stack_Traces_Function_Names_136887.html
>>
>> - I installed the "Debugging Tools for Windows" to update my dbghelp.dll
>>
>> - I'm already compiling/linking in one step, and using -g (also tried -gc)
>>
>> - I tried running the executable through cv2pdb.
>>
>> None of it's working.
>>
>>
>
> Last time I've seen stack trace it was due to this command:
>
> dmd -debug -g ...
>

I was already using -debug and -g. No function names.



July 22, 2011
On 22.07.2011 15:02, Nick Sabalausky wrote:
> "Dmitry Olshansky"<dmitry.olsh@gmail.com>  wrote in message
> news:j0bgt7$176q$1@digitalmars.com...
>> On 22.07.2011 6:54, Nick Sabalausky wrote:
>>> I'm not getting any of the function names on the stack traces.
>>>
>>> I tried everything I found in here:
>>> http://www.digitalmars.com/d/archives/digitalmars/D/Windows_Stack_Traces_Function_Names_136887.html
>>>
>>> - I installed the "Debugging Tools for Windows" to update my dbghelp.dll
>>>
>>> - I'm already compiling/linking in one step, and using -g (also
>>> tried -gc)
>>>
>>> - I tried running the executable through cv2pdb.
>>>
>>> None of it's working.
>>>
>>>
>> Last time I've seen stack trace it was due to this command:
>>
>> dmd -debug -g ...
>>
> I was already using -debug and -g. No function names.
>
Now that's wierd, since I definitely see them. Another thing to try is rebuild dmd/druntime/phobos from latest git, at least it's a setup I have right now it works (though I'm on Win7 x64).

BTW I haven't touched dbghelp in anyway(at least any that I know of) but I have something like 6 versions of them on harddrive, most "public" ones:
834Kb in C:\Windows\SysWOW64  ( this one should load for 32bit apps I think)
1.03Mb in C:\Windows\System32  (64bit obviously)

for others, I'll list only sizes:
747Kb
0.99Mb
1.27Mb
1.30Mb

-- 
Dmitry Olshansky

July 24, 2011
"Dmitry Olshansky" <dmitry.olsh@gmail.com> wrote in message news:j0boln$1l4i$1@digitalmars.com...
> On 22.07.2011 15:02, Nick Sabalausky wrote:
>> "Dmitry Olshansky"<dmitry.olsh@gmail.com>  wrote in message news:j0bgt7$176q$1@digitalmars.com...
>>> Last time I've seen stack trace it was due to this command:
>>>
>>> dmd -debug -g ...
>>>
>> I was already using -debug and -g. No function names.
>>
> Now that's wierd, since I definitely see them. Another thing to try is rebuild dmd/druntime/phobos from latest git, at least it's a setup I have right now it works (though I'm on Win7 x64).
>

Just tried that. Still no names :( Just the addresses as before.


July 24, 2011
This is what works for me:

module test;

import std.stdio;

void main()
{
	foo();
}

void foo()
{
    bar();
}

void bar()
{
    assert(0);
}

D:\dev\code\d_code\dtrace>dmd -g test.d

D:\dev\code\d_code\dtrace>cv2pdb test.exe

D:\dev\code\d_code\dtrace>test
core.exception.AssertError@test(17): Assertion failure
----------------
D:\dev\code\d_code\dtrace\test.d(18): testbar
D:\dev\code\d_code\dtrace\test.d(13): testfoo
D:\dev\code\d_code\dtrace\test.d(7): D main
----------------

> D:\dev\code\d_code\dtrace>cv2pdb
Convert DMD CodeView debug information to PDB files, Version 0.19

So it's v0.19, if that matters.

Otherwise without cv2pdb I get only addresses.

I got the latest dbghelp.dll from here: http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx
July 24, 2011
"Andrej Mitrovic" <andrej.mitrovich@gmail.com> wrote in message news:mailman.1893.1311501384.14074.digitalmars-d-learn@puremagic.com...
> This is what works for me:
>
> module test;
>
> import std.stdio;
>
> void main()
> {
> foo();
> }
>
> void foo()
> {
>    bar();
> }
>
> void bar()
> {
>    assert(0);
> }
>
> D:\dev\code\d_code\dtrace>dmd -g test.d
>
> D:\dev\code\d_code\dtrace>cv2pdb test.exe
>
> D:\dev\code\d_code\dtrace>test
> core.exception.AssertError@test(17): Assertion failure
> ----------------
> D:\dev\code\d_code\dtrace\test.d(18): testbar
> D:\dev\code\d_code\dtrace\test.d(13): testfoo
> D:\dev\code\d_code\dtrace\test.d(7): D main
> ----------------
>
>> D:\dev\code\d_code\dtrace>cv2pdb
> Convert DMD CodeView debug information to PDB files, Version 0.19
>
> So it's v0.19, if that matters.
>
> Otherwise without cv2pdb I get only addresses.
>
> I got the latest dbghelp.dll from here: http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx

Hmm I guess I must have forgotten to re-try the cv2pdb trick after I updated dbghelp.dll. That works now. Thanks.



July 25, 2011
On 25.07.2011 1:04, Nick Sabalausky wrote:
> "Andrej Mitrovic"<andrej.mitrovich@gmail.com>  wrote in message
> news:mailman.1893.1311501384.14074.digitalmars-d-learn@puremagic.com...
>> This is what works for me:
>>
>> module test;
>>
>> import std.stdio;
>>
>> void main()
>> {
>> foo();
>> }
>>
>> void foo()
>> {
>>     bar();
>> }
>>
>> void bar()
>> {
>>     assert(0);
>> }
>>
>> D:\dev\code\d_code\dtrace>dmd -g test.d
>>
>> D:\dev\code\d_code\dtrace>cv2pdb test.exe
>>
>> D:\dev\code\d_code\dtrace>test
>> core.exception.AssertError@test(17): Assertion failure
>> ----------------
>> D:\dev\code\d_code\dtrace\test.d(18): testbar
>> D:\dev\code\d_code\dtrace\test.d(13): testfoo
>> D:\dev\code\d_code\dtrace\test.d(7): D main
>> ----------------
>>
>>> D:\dev\code\d_code\dtrace>cv2pdb
>> Convert DMD CodeView debug information to PDB files, Version 0.19
>>
>> So it's v0.19, if that matters.
>>
>> Otherwise without cv2pdb I get only addresses.
>>
>> I got the latest dbghelp.dll from here:
>> http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx
> Hmm I guess I must have forgotten to re-try the cv2pdb trick after I updated
> dbghelp.dll. That works now. Thanks.
>

Any idea why this trick is needed? For me it works as is, just wondering...

-- 
Dmitry Olshansky