Changeset 68983 in vbox for trunk/src/VBox/Runtime/r3/win/init-win.cpp
- Timestamp:
- Oct 4, 2017 2:24:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/init-win.cpp
r68980 r68983 518 518 if (RT_VALID_PTR(pLdrData)) 519 519 { 520 LIST_ENTRY *pList = &pLdrData->InMemoryOrderModuleList; 521 LIST_ENTRY *pListEntry = pList->Flink; 522 uint32_t cLoops = 0; 520 PLDR_DATA_TABLE_ENTRY pFound = NULL; 521 LIST_ENTRY * const pList = &pLdrData->InMemoryOrderModuleList; 522 LIST_ENTRY *pListEntry = pList->Flink; 523 uint32_t cLoops = 0; 523 524 RTLogLogger(pLogger, NULL, 524 525 "\nLoaded Modules:\n" … … 529 530 PLDR_DATA_TABLE_ENTRY pLdrEntry = RT_FROM_MEMBER(pListEntry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); 530 531 uint32_t const cbLength = (uint32_t)(uintptr_t)pLdrEntry->Reserved3[1]; 531 char const chInd = uXcptPC - (uintptr_t)pLdrEntry->DllBase < cbLength ? '*' : ' '; 532 char chInd = ' '; 533 if (uXcptPC - (uintptr_t)pLdrEntry->DllBase < cbLength) 534 { 535 chInd = '*'; 536 pFound = pLdrEntry; 537 } 532 538 533 539 if ( RT_VALID_PTR(pLdrEntry->FullDllName.Buffer) … … 550 556 cLoops++; 551 557 } 558 559 /* 560 * Use the above to pick out code addresses on the stack. 561 */ 562 if ( cLoops < 1024 563 && uXcptSP - uStack < cbToDump) 564 { 565 RTLogLogger(pLogger, NULL, "\nPotential code addresses on the stack:\n"); 566 if (pFound) 567 { 568 if ( RT_VALID_PTR(pFound->FullDllName.Buffer) 569 && pFound->FullDllName.Length > 0 570 && pFound->FullDllName.Length < _8K 571 && (pFound->FullDllName.Length & 1) == 0 572 && pFound->FullDllName.Length <= pFound->FullDllName.MaximumLength) 573 RTLogLogger(pLogger, NULL, "%-*s: %p - %#010RX32 bytes into %.*ls\n", 574 sizeof(void *) * 2, "PC", uXcptPC, (uint32_t)(uXcptPC - (uintptr_t)pFound->DllBase), 575 pFound->FullDllName.Length / sizeof(RTUTF16), pFound->FullDllName.Buffer); 576 else 577 RTLogLogger(pLogger, NULL, "%-*s: %p - %08RX32 into module at %p\n", 578 sizeof(void *) * 2, "PC", uXcptPC, (uint32_t)(uXcptPC - (uintptr_t)pFound->DllBase), 579 pFound->DllBase); 580 } 581 582 uintptr_t const *puStack = (uintptr_t const *)uXcptSP; 583 uintptr_t cLeft = (cbToDump - (uXcptSP - uStack)) / sizeof(uintptr_t); 584 while (cLeft-- > 0) 585 { 586 uintptr_t uPtr = *puStack; 587 if (RT_VALID_PTR(uPtr)) 588 { 589 /* Search the module table. */ 590 pFound = NULL; 591 cLoops = 0; 592 pListEntry = pList->Flink; 593 while (pListEntry != pList && RT_VALID_PTR(pListEntry) && cLoops < 1024) 594 { 595 PLDR_DATA_TABLE_ENTRY pLdrEntry = RT_FROM_MEMBER(pListEntry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); 596 uint32_t const cbLength = (uint32_t)(uintptr_t)pLdrEntry->Reserved3[1]; 597 if (uPtr - (uintptr_t)pLdrEntry->DllBase < cbLength) 598 { 599 pFound = pLdrEntry; 600 break; 601 } 602 603 /* advance */ 604 pListEntry = pListEntry->Flink; 605 cLoops++; 606 } 607 608 if (pFound) 609 { 610 if ( RT_VALID_PTR(pFound->FullDllName.Buffer) 611 && pFound->FullDllName.Length > 0 612 && pFound->FullDllName.Length < _8K 613 && (pFound->FullDllName.Length & 1) == 0 614 && pFound->FullDllName.Length <= pFound->FullDllName.MaximumLength) 615 RTLogLogger(pLogger, NULL, "%p: %p - %#010RX32 bytes into %.*ls\n", 616 puStack, uPtr, (uint32_t)(uPtr - (uintptr_t)pFound->DllBase), 617 pFound->FullDllName.Length / sizeof(RTUTF16), pFound->FullDllName.Buffer); 618 else 619 RTLogLogger(pLogger, NULL, "%p: %p - %08RX32 into module at %p\n", 620 puStack, uPtr, (uint32_t)(uPtr - (uintptr_t)pFound->DllBase), pFound->DllBase); 621 } 622 } 623 624 puStack++; 625 } 626 } 552 627 } 553 628 }
Note:
See TracChangeset
for help on using the changeset viewer.