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 178854 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]
add IInstruction#getSize()
ecl.bz.IInstruction.getSize.patch (text/plain), 5.58 KB, created by
Kirk Beitz
on 2010-09-14 13:35:02 EDT
(
hide
)
Description:
add IInstruction#getSize()
Filename:
MIME Type:
Creator:
Kirk Beitz
Created:
2010-09-14 13:35:02 EDT
Size:
5.58 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 14 Sep 2010 17:06:52 -0000 >@@ -96,6 +96,11 @@ > 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 14 Sep 2010 17:07:04 -0000 >@@ -50,4 +50,9 @@ > */ > String getArgs(); > >+ /** >+ * @return size of the instruction >+ * @since 2.2 >+ */ >+ 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 14 Sep 2010 17:07:10 -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.12 >diff -u -r1.12 DisassemblyBackendDsf.java >--- src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java 8 Sep 2010 06:29:15 -0000 1.12 >+++ src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java 14 Sep 2010 17:07:18 -0000 >@@ -610,12 +610,16 @@ > } > // determine instruction byte length > BigInteger instrLength= null; >- if (j < instructions.length - 1) { >- instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); >- } >- if (instrLength == null) { >- // cannot determine length of last instruction >- break; >+ if (instructions[j].getSize() != null) { >+ instrLength= new BigInteger(instructions[j].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 >+ break; >+ } > } > final String opCode; > // insert function name+offset instead of opcode bytes >@@ -727,26 +731,30 @@ > } > // 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 (instructions[j].getSize() != null) { >+ instrLength= new BigInteger(instructions[j].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) { >+ if (instrLength == null) { >+ // cannot determine length of last instruction > break; > } > } >- if (instrLength == null) { >- // cannot determine length of last instruction >- break; >- } > final String opCode; > // insert function name+offset instead of opcode bytes > if (functionName != null && functionName.length() > 0) {
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