From 93876009e51b93ea15e3810feb1171286c660557 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 1 Feb 2010 13:59:30 +0100 Subject: [PATCH] debugger: fallback for assembler listing in the presence of bad debug info --- src/plugins/debugger/gdb/gdbengine.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 57bbef92b7d..355ff71b887 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3513,8 +3513,19 @@ void GdbEngine::handleFetchDisassemblerByLine(const GdbResponse &response) else if (lines.children().size() == 1 && lines.childAt(0).findChild("line").data() == "0") fetchDisassemblerByAddress(ac.agent, true); - else - ac.agent->setContents(parseDisassembler(lines)); + else { + QString contents = parseDisassembler(lines); + if (ac.agent->contentsCoversAddress(contents)) { + // All is well. + ac.agent->setContents(contents); + } else { + // Can happen e.g. for initializer list on symbian/rvct where + // we get a file name and line number but where the 'fully + // disassembled function' does not cover the code in the + // initializer list. Fall back needed: + fetchDisassemblerByAddress(ac.agent, true); + } + } } else { // 536^error,msg="mi_cmd_disassemble: Invalid line number" QByteArray msg = response.data.findChild("msg").data();