Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341245 - Importing binary file larger than 1024 bytes works incorrectly
Summary: Importing binary file larger than 1024 bytes works incorrectly
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-memory (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: John Cortell CLA
QA Contact: Ted Williams CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-29 11:12 EDT by John Cortell CLA
Modified: 2011-05-19 20:43 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Cortell CLA 2011-03-29 11:12:01 EDT
To reproduce:
1. launch debug session (dsf, cdi--doesn't matter); stops at main
2. open Memory Browser
3. enter "&main" in the goto field and hit Go
4. enter "&main+1024" in the goto bar and hit New Tab; make note of the value in the first four bytes
5. select first tab then hit export toolbar button. Select "Binary" format, enter 1028 for length, and enter the path of a file. Wait for export operation to complete.
6. hit import toolbar button and enter the file from step 5. Wait for import operation to complete.
7. select tab 2 ("&main+1024") and note that the first four bytes are not what they were before.

The bug is that BigInteger.add() is called with the assumption that its value will be updated. BigInteger, like String, is immutable. A new BigInteger is returned with the incremented value and that is being ignored. This was flagged by FindBugs.
Comment 1 John Cortell CLA 2011-03-29 11:14:44 EDT
Simple one-line fix committed to RAWBinaryImporter. Genie will update bugzilla with commit info shortly.
Comment 2 CDT Genie CLA 2011-03-29 11:23:01 EDT
*** cdt cvs genie on behalf of jcortell ***
Bug 341245 - Importing binary file larger than 1024 bytes works incorrectly

[*] RAWBinaryImporter.java 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryImporter.java?root=Tools_Project&r1=1.8&r2=1.9