Changeset 101193 in vbox
- Timestamp:
- Sep 20, 2023 12:53:00 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r101181 r101193 66 66 #else 67 67 # include <iprt/formats/dwarf.h> 68 extern "C" void __register_frame_info(void *begin, void *ob); /* found no header for these two */ 68 # if defined(RT_OS_DARWIN) 69 # define IEMNATIVE_USE_LIBUNWIND 70 extern "C" void __register_frame(const void *pvFde); 71 extern "C" void __deregister_frame(const void *pvFde); 72 # else 73 extern "C" void __register_frame_info(void *pvBegin, void *pvObj); /* found no header for these two */ 74 extern "C" void *__deregister_frame_info(void *pvBegin); /* (returns pvObj from __register_frame_info call) */ 75 # endif 69 76 #endif 70 77 … … 160 167 typedef struct IEMEXECMEMCHUNKEHFRAME 161 168 { 169 # ifdef IEMNATIVE_USE_LIBUNWIND 170 /** The offset of the FDA into abEhFrame. */ 171 uintptr_t offFda; 172 # else 162 173 /** struct object storage area. */ 163 174 uint8_t abObject[1024]; 175 # endif 164 176 /** The dwarf ehframe data for the chunk. */ 165 177 uint8_t abEhFrame[512]; … … 435 447 * Generate the CIE first. 436 448 */ 449 #ifdef IEMNATIVE_USE_LIBUNWIND /* libunwind (llvm, darwin) only supports v1 and v3. */ 450 uint8_t const iDwarfVer = 3; 451 #else 452 uint8_t const iDwarfVer = 4; 453 #endif 437 454 RTPTRUNION const PtrCie = Ptr; 438 455 *Ptr.pu32++ = 123; /* The CIE length will be determined later. */ 439 456 *Ptr.pu32++ = 0 /*UINT32_MAX*/; /* I'm a CIE in .eh_frame speak. */ 440 *Ptr.pb++ = 4; /* DwARF v4.*/457 *Ptr.pb++ = iDwarfVer; /* DwARF version */ 441 458 *Ptr.pb++ = 0; /* Augmentation. */ 442 *Ptr.pb++ = sizeof(uintptr_t); /* Address size. */ 443 *Ptr.pb++ = 0; /* Segment selector size. */ 459 if (iDwarfVer >= 4) 460 { 461 *Ptr.pb++ = sizeof(uintptr_t); /* Address size. */ 462 *Ptr.pb++ = 0; /* Segment selector size. */ 463 } 444 464 Ptr = iemDwarfPutLeb128(Ptr, 1); /* Code alignment factor (LEB128 = 1). */ 445 465 Ptr = iemDwarfPutLeb128(Ptr, -8); /* Data alignment factor (LEB128 = -8). */ … … 462 482 * Generate an FDE for the whole chunk area. 463 483 */ 484 #ifdef IEMNATIVE_USE_LIBUNWIND 485 pEhFrame->offFda = Ptr.u - (uintptr_t)&pEhFrame->abEhFrame[0]; 486 #endif 464 487 RTPTRUNION const PtrFde = Ptr; 465 488 *Ptr.pu32++ = 123; /* The CIE length will be determined later. */ … … 573 596 { 574 597 iemExecMemAllocatorInitEhFrameForChunk(pExecMemAllocator, pEhFrame, pvChunk); 598 # ifdef IEMNATIVE_USE_LIBUNWIND 599 __register_frame(&pEhFrame->abEhFrame[pEhFrame->offFda]); 600 # else 575 601 memset(pEhFrame->abObject, 0xf6, sizeof(pEhFrame->abObject)); /* color the memory to better spot usage */ 576 602 __register_frame_info(pEhFrame->abEhFrame, pEhFrame->abObject); 603 # endif 577 604 } 578 605 else
Note:
See TracChangeset
for help on using the changeset viewer.