Skip to content

Commit

Permalink
Debugger: Add func name and data symbol to disasm.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Jun 7, 2018
1 parent f5c6fe6 commit 15fa8b5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Core/Debugger/WebSocket/DisasmSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,30 @@ void WebSocketDisasmState::WriteDisasmLine(JsonWriter &json, const DisassemblyLi
else
json.writeString("symbol", addressSymbol);

const u32 funcAddress = g_symbolMap->GetFunctionStart(addr);
const std::string funcName = g_symbolMap->GetLabelString(funcAddress);
if (funcName.empty())
json.writeNull("function");
else
json.writeString("function", funcName);

if (l.type == DISTYPE_DATA) {
u32 dataStart = g_symbolMap->GetDataStart(addr);
if (dataStart == -1)
dataStart = addr;
const std::string dataLabel = g_symbolMap->GetLabelString(dataStart);

json.pushDict("dataSymbol");
json.writeUint("start", dataStart);
if (dataLabel.empty())
json.writeNull("label");
else
json.writeString("label", dataLabel);
json.pop();
} else {
json.writeNull("dataSymbol");
}

bool enabled;
// TODO: Account for bp inside macro?
if (CBreakPoints::IsAddressBreakPoint(addr, &enabled)) {
Expand Down

0 comments on commit 15fa8b5

Please sign in to comment.