improve windows backtrace_to_string

I want to know the symbol address we actually capture, since
we seem to getting duplicates in the output of SymFromAddr, I
want to know if the fault is in SymFromAddr, or the backtrace
capture call.

Change-Id: Iece9c204abb780ae6b67a11e6ba77db816351e8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151254
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2023-05-02 10:37:53 +02:00
committed by Noel Grandin
parent 7e74f2260b
commit bcd233e45f
+3 -2
View File
@@ -74,10 +74,11 @@ OUString sal::backtrace_to_string(BacktraceState* backtraceState)
OUStringBuffer aBuf;
for( int i = 0; i < nFrames; i++ )
{
SymFromAddr( hProcess, reinterpret_cast<DWORD64>(backtraceState->buffer[ i ]), nullptr, pSymbol );
auto pSymAddr = reinterpret_cast<DWORD64>(backtraceState->buffer[ i ]);
SymFromAddr( hProcess, pSymAddr, nullptr, pSymbol );
aBuf.append( OUString::number(nFrames - i - 1) + ": " );
aBuf.appendAscii( pSymbol->Name );
aBuf.append( " - 0x" + OUString::number(pSymbol->Address, 16) + "\n" );
aBuf.append( " - 0x" + OUString::number(pSymAddr, 16) + "\n" );
}
free( pSymbol );