Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 179171 Details for
Bug 325277
[disassembly] add IInstruction#getSize() to fill single-instruction gaps, allow large pseudo-mnemonics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
slightly updated patch for HEAD only: IInstruction#getSize() + use in DisassemblyBackendDsf + implementation in EDCInstruction + deal with side-effect of increased fMeanInstructionSize
ecl.bz.325277.201009180556.patch (text/plain), 6.19 KB, created by
Kirk Beitz
on 2010-09-18 09:06:28 EDT
(
hide
)
Description:
slightly updated patch for HEAD only: IInstruction#getSize() + use in DisassemblyBackendDsf + implementation in EDCInstruction + deal with side-effect of increased fMeanInstructionSize
Filename:
MIME Type:
Creator:
Kirk Beitz
Created:
2010-09-18 09:06:28 EDT
Size:
6.19 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.debug.edc >Index: src/org/eclipse/cdt/debug/edc/disassembler/EDCInstruction.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/edc/org.eclipse.cdt.debug.edc/src/org/eclipse/cdt/debug/edc/disassembler/EDCInstruction.java,v >retrieving revision 1.2 >diff -u -r1.2 EDCInstruction.java >--- src/org/eclipse/cdt/debug/edc/disassembler/EDCInstruction.java 3 Jun 2010 14:31:09 -0000 1.2 >+++ src/org/eclipse/cdt/debug/edc/disassembler/EDCInstruction.java 18 Sep 2010 12:58:52 -0000 >@@ -23,7 +23,7 @@ > public EDCInstruction(IDisassembledInstruction instruction) { > this.instruction = instruction; > } >- >+ > /* > * (non-Javadoc) > * >@@ -96,6 +96,14 @@ > return null; > } > >+ /** >+ * @since 2.0 >+ */ >+ public Integer getSize() { >+ return (Integer)instruction.getSize(); >+ } >+ >+ > @Override > public String toString() { > return instruction.toString(); >#P org.eclipse.cdt.dsf >Index: src/org/eclipse/cdt/dsf/debug/service/IInstruction.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IInstruction.java,v >retrieving revision 1.3 >diff -u -r1.3 IInstruction.java >--- src/org/eclipse/cdt/dsf/debug/service/IInstruction.java 3 Jun 2010 00:11:48 -0000 1.3 >+++ src/org/eclipse/cdt/dsf/debug/service/IInstruction.java 18 Sep 2010 12:58:53 -0000 >@@ -50,4 +50,9 @@ > */ > String getArgs(); > >+ /** >+ * @return size of the instruction >+ * @since 3.0 >+ */ >+ Integer getSize(); > } >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/mi/service/command/output/MIInstruction.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIInstruction.java,v >retrieving revision 1.2 >diff -u -r1.2 MIInstruction.java >--- src/org/eclipse/cdt/dsf/mi/service/command/output/MIInstruction.java 3 Jun 2010 00:09:36 -0000 1.2 >+++ src/org/eclipse/cdt/dsf/mi/service/command/output/MIInstruction.java 18 Sep 2010 12:58:54 -0000 >@@ -53,6 +53,11 @@ > return args; > } > >+ /** @since 4.0*/ >+ public Integer getSize() { >+ return null; >+ } >+ > /** > * Parse the assembly instruction result. Each instruction has the following > * fields: >#P org.eclipse.cdt.dsf.ui >Index: src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java,v >retrieving revision 1.13 >diff -u -r1.13 DisassemblyBackendDsf.java >--- src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java 15 Sep 2010 11:05:51 -0000 1.13 >+++ src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java 18 Sep 2010 12:58:55 -0000 >@@ -613,8 +613,12 @@ > } > // determine instruction byte length > BigInteger instrLength= null; >- if (j < instructions.length - 1) { >- instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); >+ if (instruction.getSize() != null) { >+ instrLength= new BigInteger(instruction.getSize().toString()); >+ } else { >+ if (j < instructions.length - 1) { >+ instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); >+ } > } > if (instrLength == null) { > // cannot determine length of last instruction >@@ -730,20 +734,24 @@ > } > // determine instruction byte length > BigInteger instrLength= null; >- if (j < instructions.length - 1) { >- instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); >- } else if (i < mixedInstructions.length - 1) { >- int nextSrcLineIdx= i+1; >- while (nextSrcLineIdx < mixedInstructions.length) { >- IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions(); >- if (nextInstrs.length > 0) { >- instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs(); >+ if (instruction.getSize() != null) { >+ instrLength= new BigInteger(instruction.getSize().toString()); >+ } else { >+ if (j < instructions.length - 1) { >+ instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); >+ } else if (i < mixedInstructions.length - 1) { >+ int nextSrcLineIdx= i+1; >+ while (nextSrcLineIdx < mixedInstructions.length) { >+ IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions(); >+ if (nextInstrs.length > 0) { >+ instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs(); >+ break; >+ } >+ ++nextSrcLineIdx; >+ } >+ if (nextSrcLineIdx >= mixedInstructions.length) { > break; > } >- ++nextSrcLineIdx; >- } >- if (nextSrcLineIdx >= mixedInstructions.length) { >- break; > } > } > if (instrLength == null) { >Index: src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java,v >retrieving revision 1.9 >diff -u -r1.9 DisassemblyDocument.java >--- src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java 20 Aug 2010 07:57:21 -0000 1.9 >+++ src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java 18 Sep 2010 12:58:55 -0000 >@@ -697,7 +697,7 @@ > if (functionLength > fMaxFunctionLength) { > fMaxFunctionLength = functionLength; > } >- if (fNumberOfInstructions < 100) { >+ if (fNumberOfInstructions < 100 && fMeanSizeOfInstructions < 16.0) { > fMeanSizeOfInstructions = (fMeanSizeOfInstructions * fNumberOfInstructions + pos.fAddressLength.floatValue()) / (++fNumberOfInstructions); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 325277
:
178854
|
178900
|
178985
|
179171
|
179737