MCPcopy Create free account
hub / github.com/beefytech/Beef / GetVariableIndexRegisterAndOffset

Method GetVariableIndexRegisterAndOffset

IDEHelper/DebugTarget.cpp:2215–2237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2213}
2214
2215bool DebugTarget::GetVariableIndexRegisterAndOffset(DbgVariable* dwVariable, int* outRegister, int* outOffset)
2216{
2217 if (dwVariable->mLocationLen == 0)
2218 return false;
2219
2220 auto locData = dwVariable->mLocationData;
2221 uint8 opCode = GET_FROM(locData, uint8);
2222 if (opCode == DW_OP_fbreg)
2223 {
2224 *outRegister = -1;
2225 int64 offset = DecodeSLEB128(locData);
2226 *outOffset = offset;
2227 return true;
2228 }
2229 else if ((opCode >= DW_OP_breg0) && (opCode <= DW_OP_breg8))
2230 {
2231 *outRegister = opCode - DW_OP_breg0;
2232 *outOffset = DecodeSLEB128(locData);
2233 return true;
2234 }
2235
2236 return false;
2237}
2238
2239//int64 BfDebuggerReadMemory(int64 addr);
2240

Callers 1

DisassembleAtMethod · 0.80

Calls 1

DecodeSLEB128Function · 0.85

Tested by

no test coverage detected