@@ -1165,6 +1165,7 @@ BOOL CSymEngine::InitStackTrace(LPSTACKFRAME64 pStackFrame)
1165
1165
if (! GetThreadContext(hThread, &m_StartExceptionContext))
1166
1166
return FALSE;
1167
1167
*/
1168
+ #ifdef _M_IX86
1168
1169
__asm
1169
1170
{
1170
1171
push eax
@@ -1222,6 +1223,11 @@ BOOL CSymEngine::InitStackTrace(LPSTACKFRAME64 pStackFrame)
1222
1223
pop edi
1223
1224
pop eax
1224
1225
}
1226
+ #elif defined(_M_IX64)
1227
+ RtlCaptureContext (&m_StartExceptionContext);
1228
+ #else
1229
+ # error "Unsupported architecture"
1230
+ #endif
1225
1231
}
1226
1232
1227
1233
ZeroMemory (pStackFrame, sizeof (*pStackFrame));
@@ -2715,10 +2721,16 @@ BOOL CSymEngine::GetNextStackTraceEntry(CStackTraceEntry& rEntry)
2715
2721
if (hModule != NULL )
2716
2722
GetModuleFileName (hModule, rEntry.m_szModule , countof (rEntry.m_szModule ));
2717
2723
DWORD64 dwExceptionAddress = m_swContext.m_stFrame .AddrPC .Offset ;
2718
- WORD wExceptionSegment; // wExceptionSegment = m_swContext.m_stFrame.AddrPC.Segment;
2719
- __asm { mov word ptr [wExceptionSegment], cs }
2724
+ WORD wExceptionSegment = m_swContext.m_stFrame .AddrPC .Segment ;
2725
+ # ifdef _M_IX86
2720
2726
_stprintf_s (rEntry.m_szAddress , countof (rEntry.m_szAddress ),
2721
- _T (" %04lX:%08llu" ), wExceptionSegment, dwExceptionAddress);
2727
+ _T (" %04lX:%08I64X" ), wExceptionSegment, dwExceptionAddress);
2728
+ #elif defined(_M_IX64)
2729
+ _stprintf_s (rEntry.m_szAddress , countof (rEntry.m_szAddress ),
2730
+ _T (" %04lX:%016lX" ), wExceptionSegment, dwExceptionAddress);
2731
+ #else
2732
+ # error "Unsupported architecture"
2733
+ #endif
2722
2734
2723
2735
BYTE arrSymBuffer[512 ];
2724
2736
ZeroMemory (arrSymBuffer, sizeof (arrSymBuffer));
0 commit comments