Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353577 - Add support for polymorphicly operating over multiple objects describing memory regions
Summary: Add support for polymorphicly operating over multiple objects describing memo...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-edc (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Ken Ryall CLA
QA Contact: Ken Ryall CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-02 09:33 EDT by Daniel Thomas CLA
Modified: 2012-05-22 20:35 EDT (History)
2 users (show)

See Also:


Attachments
Patch to add and use IAddressInterval and HasSize interfaces (15.50 KB, patch)
2011-08-02 09:42 EDT, Daniel Thomas CLA
no flags Details | Diff
Tests for IAddressInterval and HasSize (8.70 KB, patch)
2011-08-04 10:01 EDT, Daniel Thomas CLA
cdtdoug: iplog+
Details | Diff
Patch to add and use IAddressInterval and HasSize interfaces (15.99 KB, patch)
2011-08-04 11:26 EDT, Daniel Thomas CLA
cdtdoug: iplog+
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-02 09:33:40 EDT
Build Identifier: I20110613-1736

When working with lots of the classes which represent regions of memory such as IExecutableSection, IScope, ISection and ISymbol it is useful to be able to write code which can use any one of those as they have common methods.

I have a patch which adds an IAddressInterval interface which collects together these common methods and adds a HasSize interface as this a method not supported by all (as the concept of size doesn't always hold).

Reproducible: Always
Comment 1 Daniel Thomas CLA 2011-08-02 09:42:56 EDT
Created attachment 200713 [details]
Patch to add and use IAddressInterval and HasSize interfaces
Comment 2 Daniel Thomas CLA 2011-08-04 10:01:13 EDT
Created attachment 200917 [details]
Tests for IAddressInterval and HasSize

These reveal a couple of bugs which will be reported separately.
Comment 3 Daniel Thomas CLA 2011-08-04 11:26:52 EDT
Created attachment 200927 [details]
Patch to add and use IAddressInterval and HasSize interfaces

Additionally copes with cases where there is no buffer available to provide the size information (which makes the provided tests pass).
Comment 4 Kirk Beitz CLA 2011-08-05 14:09:47 EDT
this patch seems mostly quite useful.

in our local code base, i've refactored this a little further to add AbstractAddressInterval for use by methods, since getLowAddress(), getHighAddress() and hasEmptyRange() is highly similar for several of the implementers.

this code has now been nominally tested locally; awaiting final review and final merge to eclipse edc git repository by committer ken ryall.
Comment 5 Kirk Beitz CLA 2011-08-05 14:22:35 EDT
i've also slightly modified the test patch to live in org.eclipse.cdt.debug.edc.tests for now.

if/when package org.eclipse.cdt.debug.edc.symbol.tests gets created, there are probably a number of the tests in org.eclipse.cdt.debug.edc.tests that would get moved there as well.