Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356301 - ElfExecutableSymbolicsReader#getSegmentForExecutablesection has an incorrect comparison
Summary: ElfExecutableSymbolicsReader#getSegmentForExecutablesection has an incorrect ...
Status: RESOLVED WONTFIX
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-edc (show other bugs)
Version: 8.0   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: 2011-08-31 06:34 EDT by Daniel Thomas CLA
Modified: 2019-12-30 18:39 EST (History)
2 users (show)

See Also:


Attachments
Patch to change to using >= rather than > (1.35 KB, patch)
2011-08-31 06:35 EDT, Daniel Thomas CLA
no flags Details | Diff
alternate patch to test for low.equals(high) (1.13 KB, patch)
2011-09-01 20:28 EDT, Kirk Beitz CLA
no flags Details | Diff
Patch to test this behavoiur (7.66 KB, patch)
2011-09-07 06:57 EDT, Daniel Thomas CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Thomas CLA 2011-08-31 06:34:52 EDT
Build Identifier: 

This method (which I wrote) checks that the low address is <= but that the high address is > rather than >= so in the case where the segment contains only one section (and hence they have equal start and end addresses) then no segment is returned.

Reproducible: Always
Comment 1 Daniel Thomas CLA 2011-08-31 06:35:24 EDT
Created attachment 202497 [details]
Patch to change to using >= rather than >
Comment 2 Kirk Beitz CLA 2011-09-01 20:28:42 EDT
Created attachment 202645 [details]
alternate patch to test for low.equals(high)

(In reply to comment #0)
> Build Identifier: 
> 
> This method (which I wrote) checks that the low address is <= but that the high
> address is > rather than >= so in the case where the segment contains only one
> section (and hence they have equal start and end addresses) then no segment is
> returned.
> 
> Reproducible: Always

would the "alternate patch to test for low.equals(high)" more accurately fix the situation you are talking about without capturing those cases where you are interested in the section?
Comment 3 Kirk Beitz CLA 2011-09-06 17:23:27 EDT
i've nominally tested the alternate patch with our JUnit suite and committed it to our local repository pending final review and eclipse edc git merge by committer ken ryall.
Comment 4 Daniel Thomas CLA 2011-09-07 04:23:08 EDT
Sorry I didn't see your alternative patch get added.
I am fairly sure the logic in it is wrong as it will return as being the segment containing the section any zero length segment with a low address less than or equal to the low address of the section while still not returning a containing segment which covers exactly the same region as the section which was the point of the patch.

Sorry I should have made this clearer and written a test case to check this. I will try and do that now.
Comment 5 Daniel Thomas CLA 2011-09-07 06:57:56 EDT
Created attachment 202885 [details]
Patch to test this behavoiur

I thought it would be rather tedious to right a test for the one character fix - and it was but hopefully it will also provide some testing on more general functionality and provide a base for better testing of ElfExecutableSymbolicsReader.
Comment 6 Jonah Graham CLA 2019-12-30 18:39:43 EST
(this is part of a batch change)

The Eclipse CDT EDC (https://wiki.eclipse.org/CDT/cdt-debug-edc) is now obsolete and has not had any active development since 2011. Therefore the still open bugs are being marked as wontfix.

The git repo for the project still exists for posterity at https://git.eclipse.org/c/cdt/org.eclipse.cdt.edc.git/