--- a/omr/ddr/lib/ddr-scanner/dwarf/DwarfScanner.cpp +++ b/omr/ddr/lib/ddr-scanner/dwarf/DwarfScanner.cpp @@ -1495,7 +1495,12 @@ DwarfScanner::traverse_cu_in_debug_section(Symbol_IR *ir) Dwarf_Half versionStamp = 0; Dwarf_Unsigned abbrevOffset = 0; Dwarf_Half addressSize = 0; + Dwarf_Half lengthSize = 0; + Dwarf_Half extensionSize = 0; + Dwarf_Sig8 typeSignature; + Dwarf_Unsigned typeOffset = 0; Dwarf_Unsigned nextCUheader = 0; + Dwarf_Half nextCUheaderType = 0; Dwarf_Error error = NULL; /* Go over each cu header. */ @@ -1504,7 +1509,7 @@ DwarfScanner::traverse_cu_in_debug_section(Symbol_IR *ir) _typeOffsetMap.clear(); _ir = &newIR; - int ret = dwarf_next_cu_header(_debug, &cuHeaderLength, &versionStamp, &abbrevOffset, &addressSize, &nextCUheader, &error); + int ret = dwarf_next_cu_header_d(_debug, true, &cuHeaderLength, &versionStamp, &abbrevOffset, &addressSize, &lengthSize, &extensionSize, &typeSignature, &typeOffset, &nextCUheader, &nextCUheaderType, &error); if (DW_DLV_ERROR == ret) { ERRMSG("Failed to get next dwarf CU header."); rc = DDR_RC_ERROR; @@ -1518,7 +1523,7 @@ DwarfScanner::traverse_cu_in_debug_section(Symbol_IR *ir) Dwarf_Die childDie = NULL; /* Expect the CU to have a single sibling - a DIE */ - if (DW_DLV_ERROR == dwarf_siblingof(_debug, NULL, &cuDie, &error)) { + if (DW_DLV_ERROR == dwarf_siblingof_b(_debug, NULL, true, &cuDie, &error)) { ERRMSG("Getting sibling of CU: %s\n", dwarf_errmsg(error)); rc = DDR_RC_ERROR; break; @@ -1617,12 +1622,12 @@ DwarfScanner::scanFile(OMRPortLibrary *portLibrary, Symbol_IR *ir, const char *f } if (DDR_RC_OK == rc) { - Dwarf_Unsigned access = DW_DLC_READ; + unsigned int groupNumber = DW_GROUPNUMBER_ANY; Dwarf_Handler errhand = 0; Dwarf_Ptr errarg = NULL; intptr_t native_fd = omrfile_convert_omrfile_fd_to_native_fd(fd); DwarfScanner::scanFileName = filepath; - res = dwarf_init((int)native_fd, access, errhand, errarg, &_debug, &error); + res = dwarf_init_b((int)native_fd, groupNumber, errhand, errarg, &_debug, &error); if (DW_DLV_OK != res) { ERRMSG("Failed to initialize libDwarf scanning %s: %s\nExiting...\n", filepath, dwarf_errmsg(error)); if (NULL != error) { @@ -1640,7 +1645,7 @@ DwarfScanner::scanFile(OMRPortLibrary *portLibrary, Symbol_IR *ir, const char *f DEBUGPRINTF("Unloading libDwarf"); - res = dwarf_finish(_debug, &error); + res = dwarf_finish(_debug); if (DW_DLV_OK != res) { ERRMSG("Failed to Unload libDwarf: %s\nExiting...\n", dwarf_errmsg(error)); if (NULL != error) { @@ -1681,7 +1686,7 @@ DwarfScanner::getNextSibling(Dwarf_Die *die) Dwarf_Error err = NULL; /* Get the next sibling and free the previous one if successful. */ - int ret = dwarf_siblingof(_debug, *die, &nextSibling, &err); + int ret = dwarf_siblingof_b(_debug, *die, true, &nextSibling, &err); if (DW_DLV_ERROR == ret) { ERRMSG("Getting sibling of die:%s\n", dwarf_errmsg(err)); } else if (DW_DLV_OK == ret) {