Community
Participate
Working Groups
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
Created attachment 200713 [details] Patch to add and use IAddressInterval and HasSize interfaces
Created attachment 200917 [details] Tests for IAddressInterval and HasSize These reveal a couple of bugs which will be reported separately.
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).
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.
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.
Fixed in: http://git.eclipse.org/c/cdt/org.eclipse.cdt.edc.git/commit/?id=f7c4790c134d0cdc30cdbe8d2a016bf27cd25528