Lines Matching defs:pLnState

2308  * @param   pLnState            The line number program state.
2312 static int rtDwarfLine_DefineFileName(PRTDWARFLINESTATE pLnState, const char *pszFilename, uint64_t idxInc)
2317 uint32_t iFileName = pLnState->cFileNames;
2320 void *pv = RTMemRealloc(pLnState->papszFileNames, sizeof(pLnState->papszFileNames[0]) * (iFileName + 2));
2323 pLnState->papszFileNames = (char **)pv;
2332 pLnState->papszFileNames[iFileName] = RTStrDup(pszFilename);
2333 else if (idxInc < pLnState->cIncPaths)
2334 pLnState->papszFileNames[iFileName] = RTPathJoinA(pLnState->papszIncPaths[idxInc], pszFilename);
2337 if (!pLnState->papszFileNames[iFileName])
2339 pLnState->cFileNames = iFileName + 1;
2344 int rc = rtDbgModDwarfStringToUtf8(pLnState->pDwarfMod, &pLnState->papszFileNames[iFileName]);
2345 Log((" File #%02u = '%s'\n", iFileName, pLnState->papszFileNames[iFileName]));
2354 * @param pLnState The line number program state.
2358 static int rtDwarfLine_AddLine(PRTDWARFLINESTATE pLnState, uint32_t offOpCode)
2360 PRTDBGMODDWARF pThis = pLnState->pDwarfMod;
2363 rc = rtDbgModDwarfRecordSegOffset(pThis, pLnState->Regs.uSegment, pLnState->Regs.uAddress + 1);
2366 const char *pszFile = pLnState->Regs.iFile < pLnState->cFileNames
2367 ? pLnState->papszFileNames[pLnState->Regs.iFile]
2373 rc = rtDbgModDwarfLinkAddressToSegOffset(pLnState->pDwarfMod, pLnState->Regs.uSegment, pLnState->Regs.uAddress,
2377 Log2(("rtDwarfLine_AddLine: %x:%08llx (%#llx) %s(%d) [offOpCode=%08x]\n", iSeg, offSeg, pLnState->Regs.uAddress, pszFile, pLnState->Regs.uLine, offOpCode));
2378 rc = RTDbgModLineAdd(pLnState->pDwarfMod->hCnt, pszFile, pLnState->Regs.uLine, iSeg, offSeg, NULL);
2388 pLnState->Regs.fBasicBlock = false;
2389 pLnState->Regs.fPrologueEnd = false;
2390 pLnState->Regs.fEpilogueBegin = false;
2391 pLnState->Regs.uDiscriminator = 0;
2399 * @param pLnState The line number program state.
2401 static void rtDwarfLine_ResetState(PRTDWARFLINESTATE pLnState)
2403 pLnState->Regs.uAddress = 0;
2404 pLnState->Regs.idxOp = 0;
2405 pLnState->Regs.iFile = 1;
2406 pLnState->Regs.uLine = 1;
2407 pLnState->Regs.uColumn = 0;
2408 pLnState->Regs.fIsStatement = RT_BOOL(pLnState->Hdr.u8DefIsStmt);
2409 pLnState->Regs.fBasicBlock = false;
2410 pLnState->Regs.fEndSequence = false;
2411 pLnState->Regs.fPrologueEnd = false;
2412 pLnState->Regs.fEpilogueBegin = false;
2413 pLnState->Regs.uIsa = 0;
2414 pLnState->Regs.uDiscriminator = 0;
2415 pLnState->Regs.uSegment = 0;
2423 * @param pLnState The line number program state.
2426 static int rtDwarfLine_RunProgram(PRTDWARFLINESTATE pLnState, PRTDWARFCURSOR pCursor)
2431 rtDwarfLine_ResetState(pLnState);
2441 if (bOpCode >= pLnState->Hdr.u8OpcodeBase)
2447 bOpCode -= pLnState->Hdr.u8OpcodeBase;
2449 int32_t const cLineDelta = bOpCode % pLnState->Hdr.u8LineRange + (int32_t)pLnState->Hdr.s8LineBase;
2450 bOpCode /= pLnState->Hdr.u8LineRange;
2452 uint64_t uTmp = bOpCode + pLnState->Regs.idxOp;
2453 uint64_t const cAddressDelta = uTmp / pLnState->Hdr.cMaxOpsPerInstr * pLnState->Hdr.cbMinInstr;
2454 uint64_t const cOpIndexDelta = uTmp % pLnState->Hdr.cMaxOpsPerInstr;
2456 pLnState->Regs.uLine += cLineDelta;
2457 pLnState->Regs.uAddress += cAddressDelta;
2458 pLnState->Regs.idxOp += cOpIndexDelta;
2460 offOpCode, bLogOpCode, cLineDelta, pLnState->Regs.uLine, cAddressDelta, pLnState->Regs.uAddress,
2461 cOpIndexDelta, pLnState->Regs.idxOp));
2463 rc = rtDwarfLine_AddLine(pLnState, offOpCode);
2474 rc = rtDwarfLine_AddLine(pLnState, offOpCode);
2480 pLnState->Regs.uAddress += (pLnState->Regs.idxOp + u64Adv) / pLnState->Hdr.cMaxOpsPerInstr
2481 * pLnState->Hdr.cbMinInstr;
2482 pLnState->Regs.idxOp += (pLnState->Regs.idxOp + u64Adv) % pLnState->Hdr.cMaxOpsPerInstr;
2490 pLnState->Regs.uLine += cLineDelta;
2491 Log2(("%08x: DW_LNS_advance_line: uLine + %d => %u\n", offOpCode, cLineDelta, pLnState->Regs.uLine));
2496 pLnState->Regs.iFile = rtDwarfCursor_GetULeb128AsU32(pCursor, 0);
2497 Log2(("%08x: DW_LNS_set_file: iFile=%u\n", offOpCode, pLnState->Regs.iFile));
2501 pLnState->Regs.uColumn = rtDwarfCursor_GetULeb128AsU32(pCursor, 0);
2506 pLnState->Regs.fIsStatement = !pLnState->Regs.fIsStatement;
2511 pLnState->Regs.fBasicBlock = true;
2516 pLnState->Regs.uAddress += (pLnState->Regs.idxOp + 255) / pLnState->Hdr.cMaxOpsPerInstr
2517 * pLnState->Hdr.cbMinInstr;
2518 pLnState->Regs.idxOp += (pLnState->Regs.idxOp + 255) % pLnState->Hdr.cMaxOpsPerInstr;
2523 pLnState->Regs.uAddress += rtDwarfCursor_GetUHalf(pCursor, 0);
2524 pLnState->Regs.idxOp = 0;
2529 pLnState->Regs.fPrologueEnd = true;
2534 pLnState->Regs.fEpilogueBegin = true;
2539 pLnState->Regs.uIsa = rtDwarfCursor_GetULeb128AsU32(pCursor, 0);
2540 Log2(("%08x: DW_LNS_set_isa %#x\n", offOpCode, pLnState->Regs.uIsa));
2545 unsigned cOpsToSkip = pLnState->Hdr.pacStdOperands[bOpCode - 1];
2571 pLnState->Regs.fEndSequence = true;
2572 rc = rtDwarfLine_AddLine(pLnState, offOpCode);
2574 rtDwarfLine_ResetState(pLnState);
2579 pLnState->Regs.uAddress = rtDwarfCursor_GetVarSizedU(pCursor, cbInstr - 1, UINT64_MAX);
2580 pLnState->Regs.idxOp = 0;
2581 Log2(("%08x: DW_LNE_set_address: %#llx\n", offOpCode, pLnState->Regs.uAddress));
2594 rc = rtDwarfLine_DefineFileName(pLnState, pszFilename, idxInc);
2604 if (pLnState->Hdr.uVer != 2)
2606 Assert(pLnState->Hdr.uVer >= 4);
2607 pLnState->Regs.uDiscriminator = rtDwarfCursor_GetULeb128AsU32(pCursor, UINT32_MAX);
2608 Log2(("%08x: DW_LNE_set_descriminator: %u\n", offOpCode, pLnState->Regs.uDiscriminator));
2614 pLnState->Regs.uSegment = (RTSEL)uSeg;
2615 AssertStmt(pLnState->Regs.uSegment == uSeg, rc = VERR_DWARF_BAD_INFO);
2647 * @param pLnState The line number program state.
2650 static int rtDwarfLine_ReadFileNames(PRTDWARFLINESTATE pLnState, PRTDWARFCURSOR pCursor)
2652 int rc = rtDwarfLine_DefineFileName(pLnState, "/<bad-zero-file-name-entry>", 0);
2666 rc = rtDwarfLine_DefineFileName(pLnState, psz, idxInc);
2678 * @param pLnState The line number program state.
2681 static int rtDwarfLine_ReadIncludePaths(PRTDWARFLINESTATE pLnState, PRTDWARFCURSOR pCursor)
2686 if ((pLnState->cIncPaths % 2) == 0)
2688 void *pv = RTMemRealloc(pLnState->papszIncPaths, sizeof(pLnState->papszIncPaths[0]) * (pLnState->cIncPaths + 2));
2691 pLnState->papszIncPaths = (const char **)pv;
2693 Log((" Path #%02u = '%s'\n", pLnState->cIncPaths, psz));
2694 pLnState->papszIncPaths[pLnState->cIncPaths] = psz;
2695 pLnState->cIncPaths++;