Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325679 - edc - disassembly - allow all but last instruction to be returned for BufferUnderflowException
Summary: edc - disassembly - allow all but last instruction to be returned for BufferU...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-edc (show other bugs)
Version: 7.0.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ken Ryall CLA
QA Contact: Ken Ryall CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-18 09:07 EDT by Kirk Beitz CLA
Modified: 2011-05-13 10:55 EDT (History)
0 users

See Also:


Attachments
addition of CodeBufferUnderflowException and use in recovering from underflow while parsing buffer of ARM code (6.67 KB, patch)
2010-09-18 09:07 EDT, Kirk Beitz CLA
no flags Details | Diff
updated patch : addition of CodeBufferUnderflowException and use in recovering from underflow while parsing buffer of ARM code (14.95 KB, patch)
2010-09-19 03:27 EDT, Kirk Beitz CLA
cdtdoug: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kirk Beitz CLA 2010-09-18 09:07:50 EDT
Created attachment 179174 [details]
addition of CodeBufferUnderflowException and use in recovering from underflow while parsing buffer of ARM code

at times, buffer underflow when parsing instructions on variable size ISAs can result in a lot of error messages populating the Disassembly view.

the attached patch was formerly part of a much larger patch in Bug 325284, but has been extracted due to that bug relying on Bug 325277.  it represents the simplest patch to HEAD as of 2010.09.17 w.r.t. performing this functionality.

currently, both of the 2 existing EDC disassembler instruction parsers (ARM & x86) translate a BufferUnderflowException into a CoreException, and this is handled in AbstractDisassembler#disassembleInstructions() by throwing a new CoreExcpetion() for callers to deal with.

this causes disassembleInstructions() to discard what may be a large buffer of properly parsed disassembly because the requester could not know a priori exactly how much to ask for.

the attached patch adds new CodeBufferUnderflowException extending CoreException, throws it from the ARM & x86 parsers, and catches/handles the new exception in disassembleInstructions() when not trying to disassemble the PC for stepping purposes and when at least one instruction was properly parsed.

by making CodeBufferUnderflowException an extension of CoreException:
a) any non-ARM & non-x86 @override extensions can still catch it and act the same
b) any non-ARM & non-x86 instruction parsers that still just throw CoreException and be caught in disassembleInstructions() as happens without this patch.

this patch applies cleanly to head as of 2010.09.18, and has been tested with the edc windows debugger; a modified version of the attached patch has been tested together with other disassembly changes, and is planned for later merge together at the same time.
Comment 1 Kirk Beitz CLA 2010-09-19 03:27:44 EDT
Created attachment 179199 [details]
updated patch : addition of CodeBufferUnderflowException and use in recovering from underflow while parsing buffer of ARM code

the updated patch is for a couple of cases of x86 disassembly for which BufferUnderflowException was not being translated.
Comment 2 Kirk Beitz CLA 2010-10-06 22:45:50 EDT
resolved with 2010.oct.04 edc merge commits by ken.ryall@nokia.com