Commit 8521f54f authored by hjk's avatar hjk

Debugger: Rework GDB disassembly display

- Use exclusively CLI to retrieve information. MI output misses parts.
- Remove MI output handling
- Re-order lines in ascending address order in mixed output.
  GDB orders by source line, but that's confusing when stepping
- Introduce a new 'hunk' field for source lines to give a hint
  which part of a split source line we are looking at.

Change-Id: I61a547503e9a18f95e99b897e26dbb207cabb8cf
Reviewed-by: default avatarDavid Schulz <>
parent 0d19eb8d
......@@ -227,6 +227,8 @@ QString DisassemblerLine::toString() const
str += _(" ");
str += data;
} else if (isCode()) {
if (hunk)
str += _("[%1]").arg(hunk);
str += someSpace;
str += data;
} else {
......@@ -44,9 +44,8 @@ namespace Internal {
class DisassemblerLine
//DisassemblerLine(const QString &unparsed);
DisassemblerLine() : address(0), offset(0), lineNumber(0) {}
DisassemblerLine() : address(0), offset(0), lineNumber(0), hunk(0) {}
bool isAssembler() const { return address != 0; }
bool isCode() const { return lineNumber != 0; }
bool isComment() const { return lineNumber == 0 && address == 0; }
......@@ -61,6 +60,7 @@ public:
QString function; // (ass) Function to which current instruction belongs.
uint offset; // (ass) Offset of instruction in relation to current function.
uint lineNumber; // (src) Line number in source.
uint hunk; // (src) Number of hunk if source line was split
QByteArray rawData; // (ass) Raw bytes of the instruction
QString data; // (ass) Instruction text, (src) source text, (cmt) arbitrary.
......@@ -80,6 +80,7 @@ public:
int size() const { return m_data.size(); }
const DisassemblerLine &at(int i) const { return; }
int lineForAddress(quint64 address) const;
QVector<DisassemblerLine> data() const { return m_data; }
quint64 startAddress() const;
quint64 endAddress() const;
This diff is collapsed.
......@@ -354,30 +354,18 @@ private: ////////// View & Data Stuff //////////
// Disassembler specific stuff
// Chain of fallbacks: PointMixed -> PointPlain -> RangeMixed -> RangePlain.
// The Mi versions are not used right now.
void fetchDisassembler(DisassemblerAgent *agent);
void fetchDisassemblerByCliPointMixed(const DisassemblerAgentCookie &ac);
void fetchDisassemblerByCliPointPlain(const DisassemblerAgentCookie &ac);
void fetchDisassemblerByCliRangeMixed(const DisassemblerAgentCookie &ac);
void fetchDisassemblerByCliRangePlain(const DisassemblerAgentCookie &ac);
//void fetchDisassemblerByMiPointMixed(const DisassemblerAgentCookie &ac);
//void fetchDisassemblerByMiPointPlain(const DisassemblerAgentCookie &ac);
//void fetchDisassemblerByMiRangeMixed(const DisassemblerAgentCookie &ac);
//void fetchDisassemblerByMiRangePlain(const DisassemblerAgentCookie &ac);
void handleFetchDisassemblerByCliPointMixed(const GdbResponse &response);
void handleFetchDisassemblerByCliPointPlain(const GdbResponse &response);
void handleFetchDisassemblerByCliRangeMixed(const GdbResponse &response);
void handleFetchDisassemblerByCliRangePlain(const GdbResponse &response);
//void handleFetchDisassemblerByMiPointMixed(const GdbResponse &response);
//void handleFetchDisassemblerByMiPointPlain(const GdbResponse &response);
//void handleFetchDisassemblerByMiRangeMixed(const GdbResponse &response);
//void handleFetchDisassemblerByMiRangePlain(const GdbResponse &response);
void handleBreakOnQFatal(const GdbResponse &response);
DisassemblerLines parseDisassembler(const GdbResponse &response);
DisassemblerLines parseCliDisassembler(const QByteArray &response);
DisassemblerLines parseMiDisassembler(const GdbMi &response);
bool handleCliDisassemblerResult(const QByteArray &response, DisassemblerAgent *agent);
Q_SLOT void reloadDisassembly();
void handleBreakOnQFatal(const GdbResponse &response);
// Source file specific stuff
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment