| 2213 | } |
| 2214 | |
| 2215 | bool 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 |
no test coverage detected