Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the options handled? #48

Open
rootlessNL opened this issue Mar 31, 2021 · 1 comment
Open

Are the options handled? #48

rootlessNL opened this issue Mar 31, 2021 · 1 comment

Comments

@rootlessNL
Copy link

I might be mistaken but I thought the options were to set the output options. However if I set RetrieveNone in the constructor it still outputs everything. i.e.:

 class MyStackWalker : public StackWalker
{
public:
    MyStackWalker() : StackWalker(StackWalker::RetrieveNone, 
                                    NULL, GetCurrentProcessId(),
                                    GetCurrentProcess()) {}
protected:
    virtual void OnOutput(LPCSTR szText) {
        printf(szText); StackWalker::OnOutput(szText);
    }
};

use it as:

MyStackWalker sw; 
sw.ShowCallstack();

Output:

SymInit: Symbol-SearchPath: '.', symOptions: 530, UserName: 'ECT'
OS-Version: 6.2.9200 () 0x100-0x1
C:\src\gazebosc\build\bin\Debug\gazebosc.exe:gazebosc.exe (00007FF7011A0000), size: 5738496 (result: 0), SymType: 'PDB', PDB: '.\gazebosc.pdb'
C:\Windows\SYSTEM32\ntdll.dll:ntdll.dll (00007FFA8C8D0000), size: 2052096 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\ntdll.dll'
C:\Windows\System32\KERNEL32.DLL:KERNEL32.DLL (00007FFA8BB00000), size: 774144 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\KERNEL32.DLL'
C:\Windows\System32\KERNELBASE.dll:KERNELBASE.dll (00007FFA8A220000), size: 2920448 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\KERNELBASE.dll'
C:\Windows\System32\USER32.dll:USER32.dll (00007FFA8C0E0000), size: 1703936 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\USER32.dll'
C:\Windows\System32\win32u.dll:win32u.dll (00007FFA8A4F0000), size: 139264 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\win32u.dll'
C:\Windows\System32\GDI32.dll:GDI32.dll (00007FFA8BBD0000), size: 172032 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\GDI32.dll'
C:\Windows\System32\gdi32full.dll:gdi32full.dll (00007FFA8A5D0000), size: 1093632 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\gdi32full.dll'
C:\Windows\System32\msvcp_win.dll:msvcp_win.dll (00007FFA8A790000), size: 643072 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\msvcp_win.dll'
C:\Windows\System32\ucrtbase.dll:ucrtbase.dll (00007FFA8A830000), size: 1048576 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\ucrtbase.dll'
C:\Windows\System32\IMM32.dll:IMM32.dll (00007FFA8ABA0000), size: 196608 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\IMM32.dll'
C:\Windows\System32\ole32.dll:ole32.dll (00007FFA8B970000), size: 1220608 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\ole32.dll'
C:\Windows\System32\RPCRT4.dll:RPCRT4.dll (00007FFA8A930000), size: 1224704 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\RPCRT4.dll'
C:\Windows\System32\combase.dll:combase.dll (00007FFA8ABD0000), size: 3493888 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\combase.dll'
C:\Windows\System32\OLEAUT32.dll:OLEAUT32.dll (00007FFA8BFB0000), size: 839680 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\OLEAUT32.dll'
C:\Windows\System32\ADVAPI32.dll:ADVAPI32.dll (00007FFA8AAF0000), size: 704512 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\ADVAPI32.dll'
C:\Windows\System32\msvcrt.dll:msvcrt.dll (00007FFA8B8D0000), size: 647168 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\msvcrt.dll'
C:\Windows\System32\sechost.dll:sechost.dll (00007FFA8B6F0000), size: 638976 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\sechost.dll'
C:\Windows\System32\SETUPAPI.dll:SETUPAPI.dll (00007FFA8C280000), size: 4624384 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\SETUPAPI.dll'
C:\Windows\System32\cfgmgr32.dll:cfgmgr32.dll (00007FFA8A740000), size: 319488 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\cfgmgr32.dll'
C:\Windows\System32\bcrypt.dll:bcrypt.dll (00007FFA8A520000), size: 159744 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\bcrypt.dll'
C:\Windows\System32\SHELL32.dll:SHELL32.dll (00007FFA8AF30000), size: 7610368 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\SHELL32.dll'
C:\Windows\System32\WS2_32.dll:WS2_32.dll (00007FFA8C6F0000), size: 438272 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\WS2_32.dll'
C:\src\gazebosc\build\bin\Debug\libzmq-v142-mt-gd-4_3_5.dll:libzmq-v142-mt-gd-4_3_5.dll (00007FFA3D740000), size: 1843200 (result: 0), SymType: 'PDB', PDB: 'C:\src\libzmq\build\bin\Debug\libzmq-v142-mt-gd-4_3_5.pdb'
C:\src\gazebosc\build\bin\Debug\python38_d.dll:python38_d.dll (00007FFA3C050000), size: 8368128 (result: 0), SymType: 'PDB', PDB: 'C:\src\cpython\PCbuild\amd64\python38_d.pdb'
C:\Windows\System32\SHLWAPI.dll:SHLWAPI.dll (00007FFA8C080000), size: 348160 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\SHLWAPI.dll'
C:\Windows\SYSTEM32\OPENGL32.dll:OPENGL32.dll (00007FFA486B0000), size: 1204224 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\OPENGL32.dll'
C:\Windows\SYSTEM32\WINMM.dll:WINMM.dll (00007FFA839D0000), size: 159744 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\WINMM.dll'
C:\Windows\SYSTEM32\VERSION.dll:VERSION.dll (00007FFA840A0000), size: 40960 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\VERSION.dll'
C:\Windows\SYSTEM32\IPHLPAPI.DLL:IPHLPAPI.DLL (00007FFA89420000), size: 241664 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\IPHLPAPI.DLL'
C:\Windows\SYSTEM32\MSVCP140D.dll:MSVCP140D.dll (00007FFA3D650000), size: 925696 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\MSVCP140D.dll'
C:\Windows\SYSTEM32\VCRUNTIME140D.dll:VCRUNTIME140D.dll (00007FFA7DB40000), size: 176128 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\VCRUNTIME140D.dll'
C:\Windows\SYSTEM32\VCRUNTIME140_1D.dll:VCRUNTIME140_1D.dll (00007FFA78B60000), size: 61440 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\VCRUNTIME140_1D.dll'
C:\Windows\SYSTEM32\ucrtbased.dll:ucrtbased.dll (00007FFA3D480000), size: 1863680 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\ucrtbased.dll'
C:\Windows\SYSTEM32\GLU32.dll:GLU32.dll (00007FFA55910000), size: 180224 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\GLU32.dll'
C:\Windows\SYSTEM32\CRYPTSP.dll:CRYPTSP.dll (00007FFA89970000), size: 98304 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\CRYPTSP.dll'
C:\Windows\system32\rsaenh.dll:rsaenh.dll (00007FFA890D0000), size: 212992 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\rsaenh.dll'
C:\Windows\SYSTEM32\CRYPTBASE.dll:CRYPTBASE.dll (00007FFA89960000), size: 49152 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\CRYPTBASE.dll'
C:\Windows\System32\bcryptPrimitives.dll:bcryptPrimitives.dll (00007FFA8A550000), size: 524288 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\bcryptPrimitives.dll'
C:\Windows\SYSTEM32\dbghelp.dll:dbghelp.dll (00007FFA7AC50000), size: 1982464 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\dbghelp.dll'
C:\Windows\SYSTEM32\SspiCli.dll:SspiCli.dll (00007FFA89ED0000), size: 245760 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\SspiCli.dll'
C:\src\gazebosc\ext\StackWalker\Main\StackWalker\StackWalker.cpp (1071): StackWalker::ShowCallstack
C:\src\gazebosc\main.cpp (171): print_backtrace
C:\src\gazebosc\main.cpp (225): main
d:\A01\_work\12\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (79): invoke_main
d:\A01\_work\12\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (288): __scrt_common_main_seh
d:\A01\_work\12\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl (331): __scrt_common_main
d:\A01\_work\12\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp (17): mainCRTStartup
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA8BB17034)
00007FFA8BB17034 (KERNEL32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00007FFA8C922651)
00007FFA8C922651 (ntdll): (filename not available): RtlUserThreadStart

Doesn't matter what options I set

@thomasa88
Copy link

I can confirm this behavior. StackWalker.cpp only looks for RetrieveFileVersion, as far as I can tell.

I'm a bit unsure of where exactly the code should check each option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants