Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
// Erstmal die üblichen Verdächtigen inkuden: #include <iostream> // Jetzt die StackWalker-Klasse inkluden ( Hier ne locale Datei ) #include "StackWalker.h" // Damit wir den Stack schön in ner Konsole ausgeben können, // erstellen wir unsere eigene klasse "MyStackWalker", die von // "StackWalker" erbt und überladen die funktion "void OnOutput( LPCSTR p_text )" class MyStackWalker : public StackWalker { public: void OnOutput( LPCSTR p_text ) { std::cout << p_text; StackWalker::OnOutput( p_text ); } }; // in dieser Funktion wird der Stack dann ausgegeben void test() { MyStackWalker sw; sw.ShowCallstack(); } // Hier noch ein paar Funktionen damit der Stack größer wird ;) void test1() { test(); } void test2() { test1(); } void test3() { test2(); } void test4() { test3(); } void test5() { test4(); } // Und noch die main int main() { test5(); // Und damit die Konsole nicht gleich verschwindet: std::cin.get(); return 0; } |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
SymInit: Symbol-SearchPath: '.;E:\C++\Workspace\StackWalkingTest\Debug;E:\C++\Workspace\StackWalkingTest\Debug;C:\WINDOWS;C:\WINDOWS\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'DataByte ;)' OS-Version: 5.1.2600 (Service Pack 2) 0x300-0x1 E:\C++\Workspace\StackWalkingTest\Debug\StackWalkingTest.exe:StackWalkingTest.exe (00400000), size: 151552 (result: 0), SymType: '-unknown-', PDB: 'E:\C++\Workspace\StackWalkingTest\Debug\StackWalkingTest.pdb' C:\WINDOWS\system32\ntdll.dll:ntdll.dll (7C910000), size: 749568 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 5.1.2600.2180 C:\WINDOWS\system32\kernel32.dll:kernel32.dll (7C800000), size: 1073152 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 5.1.2600.2180 C:\WINDOWS\system32\ADVAPI32.dll:ADVAPI32.dll (77DA0000), size: 696320 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 5.1.2600.2180 C:\WINDOWS\system32\RPCRT4.dll:RPCRT4.dll (77E50000), size: 593920 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 5.1.2600.2180 C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456\MSVCP90D.dll:MSVCP90D.dll (10480000), size: 876544 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 9.0.21022.8 C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456\MSVCR90D.dll:MSVCR90D.dll (10200000), size: 1191936 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 9.0.21022.8 C:\WINDOWS\system32\VERSION.dll:VERSION.dll (77BD0000), size: 32768 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 5.1.2600.2180 C:\WINDOWS\system32\dbghelp.dll:dbghelp.dll (59DD0000), size: 659456 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 5.1.2600.2180 C:\WINDOWS\system32\msvcrt.dll:msvcrt.dll (77BE0000), size: 360448 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 7.0.2600.2180 C:\WINDOWS\system32\Secur32.dll:Secur32.dll (77FC0000), size: 69632 (result: 0), SymType: '-exported-', PDB: '', fileVersion: 5.1.2600.2180 e:\c++\workspace\stackwalkingtest\stackwalkingtest\stackwalker.cpp (921): StackWalker::ShowCallstack e:\c++\workspace\stackwalkingtest\stackwalkingtest\main.cpp (25): test e:\c++\workspace\stackwalkingtest\stackwalkingtest\main.cpp (28): test1 e:\c++\workspace\stackwalkingtest\stackwalkingtest\main.cpp (29): test2 e:\c++\workspace\stackwalkingtest\stackwalkingtest\main.cpp (30): test3 e:\c++\workspace\stackwalkingtest\stackwalkingtest\main.cpp (31): test4 e:\c++\workspace\stackwalkingtest\stackwalkingtest\main.cpp (32): test5 e:\c++\workspace\stackwalkingtest\stackwalkingtest\main.cpp (41): main f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (582): __tmainCRTStartup f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (399): mainCRTStartup ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 7C816D4F) 7C816D4F (kernel32): (filename not available): RegisterWaitForInputIdle |
Werbeanzeige