mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Fix windows builds (stacktrace pthread debug)
This commit is contained in:
parent
46251c2068
commit
c92dfed706
2 changed files with 9 additions and 7 deletions
|
|
@ -91,10 +91,9 @@ extern "C" {
|
|||
void
|
||||
PBD::stacktrace (std::ostream& out, int levels, int start)
|
||||
{
|
||||
unsigned int i;
|
||||
void * stack[62]; // does not support more then 62 levels of stacktrace
|
||||
void* stack[62]; // does not support more then 62 levels of stacktrace
|
||||
unsigned short frames;
|
||||
SYMBOL_INFO * symbol;
|
||||
SYMBOL_INFO* symbol;
|
||||
HANDLE process;
|
||||
|
||||
process = GetCurrentProcess();
|
||||
|
|
@ -104,13 +103,13 @@ PBD::stacktrace (std::ostream& out, int levels, int start)
|
|||
|
||||
frames = CaptureStackBackTrace (0, 62, stack, NULL);
|
||||
|
||||
out << "Backtrace frames: " << frames << std::endl;
|
||||
out << "Backtrace frames: " << (int) frames << std::endl;
|
||||
|
||||
symbol = (SYMBOL_INFO*)calloc (sizeof (SYMBOL_INFO) + 256 * sizeof (char), 1);
|
||||
symbol->MaxNameLen = 255;
|
||||
symbol->SizeOfStruct = sizeof (SYMBOL_INFO);
|
||||
|
||||
for (i = start; i < frames && (levels == 0 || i < levels); ++i) {
|
||||
for (int i = start; i < frames && (levels == 0 || i < levels); ++i) {
|
||||
SymFromAddr (process, (DWORD64)(stack[i]), 0, symbol);
|
||||
out << string_compose (" %1: %2 - %3\n", frames - i - 1, symbol->Name, symbol->Address);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue