From 0cac486c62a922b4665f2ecab629e686c3aa69f4 Mon Sep 17 00:00:00 2001 From: Teodor Madan Date: Wed, 21 May 2014 16:46:36 +0300 Subject: [PATCH] Bug 435401 - Mixed-mode disassembly does not display the same source as source editor for the same address change IMixedInstruction.getFileName implementation to return full path if reported by gdb. In the same way as MIFrame Change-Id: I16ee540c02da95bbaa1881a813e8bf9326d1f63d Signed-off-by: Teodor Madan Reviewed-on: https://git.eclipse.org/r/27014 Reviewed-by: Marc Khouzam Tested-by: Hudson CI --- .../command/output/MIMixedInstruction.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIMixedInstruction.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIMixedInstruction.java index 582a84484dd..af0f3faefed 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIMixedInstruction.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIMixedInstruction.java @@ -22,6 +22,7 @@ public class MIMixedInstruction implements IMixedInstruction { // The parsed information private String fileName = ""; //$NON-NLS-1$ + private String fullName = ""; //$NON-NLS-1$ private int lineNumber = 0; private MIInstruction[] assemblyCode; @@ -31,7 +32,8 @@ public class MIMixedInstruction implements IMixedInstruction { @Override public String getFileName() { - return fileName; + String result = getFullName(); + return result.isEmpty() ? fileName : result; } @Override @@ -80,6 +82,11 @@ public class MIMixedInstruction implements IMixedInstruction { fileName = str; continue; } + + if (var.equals("fullname")) { //$NON-NLS-1$ + fullName = str; + continue; + } if (var.equals("line_asm_insn")) { //$NON-NLS-1$ if (value instanceof MIList) { @@ -97,4 +104,11 @@ public class MIMixedInstruction implements IMixedInstruction { } + /** + * Get full source path as reported by gdb-mi "fullname" attribute. + * @since 4.4 + */ + public String getFullName() { + return fullName; + } }