Changeset 89927 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Jun 28, 2021 10:24:55 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/dbg/dbgmodghidra.cpp
r89895 r89927 270 270 271 271 /** 272 * Adds the symbols from the given \"functions\" table. 273 * 274 * @returns IPRT status code. 275 * @param hCnt Debug module container handle. 276 * @param elmTbl Reference to the XML node containing the symbols. 277 */ 278 static int rtDbgModGhidraXmlParseFunctions(RTDBGMOD hCnt, const xml::ElementNode &elmTbl) 279 { 280 xml::NodesLoop nlFun(elmTbl, "function"); 281 const xml::ElementNode *pelmFun; 282 while ((pelmFun = nlFun.forAllNodes())) 283 { 284 xml::NodesLoop nlLn(*pelmFun, "line_number"); 285 const xml::ElementNode *pelmLn; 286 while ((pelmLn = nlLn.forAllNodes())) 287 { 288 const char *pszFile = NULL; 289 uint32_t uLineNo = 0; 290 uint64_t off = 0; 291 if ( pelmLn->getAttributeValue("source_file", &pszFile) 292 && pelmLn->getAttributeValue("start", &uLineNo) 293 && pelmLn->getAttributeValue("addr", &off)) 294 { 295 int rc = RTDbgModLineAdd(hCnt, pszFile, uLineNo, RTDBGSEGIDX_RVA, off, NULL /*piOrdinal*/); 296 if ( RT_FAILURE(rc) 297 && rc != VERR_DBG_DUPLICATE_SYMBOL 298 && rc != VERR_DBG_ADDRESS_CONFLICT 299 && rc != VERR_DBG_INVALID_RVA) /* (don't be too strict) */ 300 return rc; 301 } 302 } 303 } 304 305 return VINF_SUCCESS; 306 } 307 308 309 /** 272 310 * @copydoc FNRTSORTCMP 273 311 */ … … 366 404 pelmTbl = rtDbgModGhidraGetTableByName(pelmTables, "Symbols"); 367 405 if (pelmTbl) 368 return rtDbgModGhidraXmlParseSymbols(hCnt, *pelmTbl); 406 { 407 rc = rtDbgModGhidraXmlParseSymbols(hCnt, *pelmTbl); 408 if (RT_SUCCESS(rc)) 409 { 410 pelmTbl = pelmRoot->findChildElement("functions"); /* Might not be there. */ 411 if (pelmTbl) 412 rc = rtDbgModGhidraXmlParseFunctions(hCnt, *pelmTbl); 413 return rc; 414 } 415 } 369 416 } 370 417 }
Note:
See TracChangeset
for help on using the changeset viewer.