Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341245

Summary: Importing binary file larger than 1024 bytes works incorrectly
Product: [Tools] CDT Reporter: John Cortell <john.cortell>
Component: cdt-memoryAssignee: John Cortell <john.cortell>
Status: RESOLVED FIXED QA Contact: Ted Williams <ted>
Severity: normal    
Priority: P3 CC: cdtdoug, marc.khouzam
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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