1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 17:25:38 +02:00

Try getting the address factory first from the CDI Target, then fall back on the executable.

This commit is contained in:
Ken Ryall 2008-04-17 15:48:02 +00:00
parent 93ddce7436
commit 0a10b91cca

View file

@ -1683,20 +1683,19 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
}
public IAddressFactory getAddressFactory() {
if ( fAddressFactory == null ) {
if ( getExecFile() != null && getProject() != null ) {
IBinaryObject file;
file = getBinaryFile();
if (file != null) {
fAddressFactory = file.getAddressFactory();
}
if ( fAddressFactory == null ) {
// Ask CDI plug-in for the default AddressFactory.
if (fCDITarget instanceof ICDIAddressFactoryManagement) {
fAddressFactory = ((ICDIAddressFactoryManagement) fCDITarget).getAddressFactory();
}
else {
// No binary file, possible when we do pure assembly level debug
// Without any binary file involved, ask CDI plugin for default
// AddressFactory, if any.
if (fCDITarget instanceof ICDIAddressFactoryManagement) {
fAddressFactory = ((ICDIAddressFactoryManagement) fCDITarget).getAddressFactory();
// And if that doesn't work, use the one from the file.
if ( fAddressFactory == null ){
if ( getExecFile() != null && getProject() != null ) {
IBinaryObject file;
file = getBinaryFile();
if (file != null) {
fAddressFactory = file.getAddressFactory();
}
}
}
}