forked from qt-creator/qt-creator
GDB: Fix display of disassembly with optimizations
/m flag is deprecated since 7.11. Use /s instead. See https://sourceware.org/gdb/onlinedocs/gdb/Machine-Code.html Change-Id: Ie056bcf598da30976fca1622bc98eeb79a73f8e1 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
522ba30897
commit
edc4ba10d5
@@ -3520,11 +3520,11 @@ void GdbEngine::fetchDisassembler(DisassemblerAgent *agent)
|
|||||||
fetchDisassemblerByCliPointMixed(agent);
|
fetchDisassemblerByCliPointMixed(agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline QString disassemblerCommand(const Location &location, bool mixed)
|
static inline QString disassemblerCommand(const Location &location, bool mixed, QChar mixedFlag)
|
||||||
{
|
{
|
||||||
QString command = "disassemble /r";
|
QString command = "disassemble /r";
|
||||||
if (mixed)
|
if (mixed)
|
||||||
command += 'm';
|
command += mixedFlag;
|
||||||
command += ' ';
|
command += ' ';
|
||||||
if (const quint64 address = location.address()) {
|
if (const quint64 address = location.address()) {
|
||||||
command += "0x";
|
command += "0x";
|
||||||
@@ -3540,7 +3540,8 @@ static inline QString disassemblerCommand(const Location &location, bool mixed)
|
|||||||
void GdbEngine::fetchDisassemblerByCliPointMixed(const DisassemblerAgentCookie &ac)
|
void GdbEngine::fetchDisassemblerByCliPointMixed(const DisassemblerAgentCookie &ac)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(ac.agent, return);
|
QTC_ASSERT(ac.agent, return);
|
||||||
DebuggerCommand cmd(disassemblerCommand(ac.agent->location(), true), Discardable | ConsoleCommand);
|
DebuggerCommand cmd(disassemblerCommand(ac.agent->location(), true, mixedDisasmFlag()),
|
||||||
|
Discardable | ConsoleCommand);
|
||||||
cmd.callback = [this, ac](const DebuggerResponse &response) {
|
cmd.callback = [this, ac](const DebuggerResponse &response) {
|
||||||
if (response.resultClass == ResultDone)
|
if (response.resultClass == ResultDone)
|
||||||
if (handleCliDisassemblerResult(response.consoleStreamOutput, ac.agent))
|
if (handleCliDisassemblerResult(response.consoleStreamOutput, ac.agent))
|
||||||
@@ -3558,7 +3559,8 @@ void GdbEngine::fetchDisassemblerByCliRangeMixed(const DisassemblerAgentCookie &
|
|||||||
const quint64 address = ac.agent->address();
|
const quint64 address = ac.agent->address();
|
||||||
QString start = QString::number(address - 20, 16);
|
QString start = QString::number(address - 20, 16);
|
||||||
QString end = QString::number(address + 100, 16);
|
QString end = QString::number(address + 100, 16);
|
||||||
DebuggerCommand cmd("disassemble /rm 0x" + start + ",0x" + end, Discardable | ConsoleCommand);
|
DebuggerCommand cmd("disassemble /r" + mixedDisasmFlag() + " 0x" + start + ",0x" + end,
|
||||||
|
Discardable | ConsoleCommand);
|
||||||
cmd.callback = [this, ac](const DebuggerResponse &response) {
|
cmd.callback = [this, ac](const DebuggerResponse &response) {
|
||||||
if (response.resultClass == ResultDone)
|
if (response.resultClass == ResultDone)
|
||||||
if (handleCliDisassemblerResult(response.consoleStreamOutput, ac.agent))
|
if (handleCliDisassemblerResult(response.consoleStreamOutput, ac.agent))
|
||||||
@@ -4486,6 +4488,12 @@ void GdbEngine::interruptInferior2()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QChar GdbEngine::mixedDisasmFlag() const
|
||||||
|
{
|
||||||
|
// /m is deprecated since 7.11, and was replaced by /s which works better with optimizations
|
||||||
|
return m_gdbVersion >= 71100 ? 's' : 'm';
|
||||||
|
}
|
||||||
|
|
||||||
void GdbEngine::shutdownEngine()
|
void GdbEngine::shutdownEngine()
|
||||||
{
|
{
|
||||||
if (isPlainEngine()) {
|
if (isPlainEngine()) {
|
||||||
|
@@ -403,6 +403,7 @@ private: ////////// General Interface //////////
|
|||||||
void shutdownEngine() final;
|
void shutdownEngine() final;
|
||||||
|
|
||||||
void interruptInferior2();
|
void interruptInferior2();
|
||||||
|
QChar mixedDisasmFlag() const;
|
||||||
|
|
||||||
// Plain
|
// Plain
|
||||||
void handleExecRun(const DebuggerResponse &response);
|
void handleExecRun(const DebuggerResponse &response);
|
||||||
|
Reference in New Issue
Block a user