Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] AddressFactory for CDebugTarget

Hi, 

There is a case in our debugger that a CDebugTarget has no binary file
associated with it. For instance, we need to connect debugger to a
device and just do pure assembly level debug without any source level
debug, namely no binary file is required. 

I managed to create a CDT target without a binary object. But to display
addresses of stack frames, an IAddressFactory is needed. In
CDebugTarget.getAddressFactory(), 

	public IAddressFactory getAddressFactory() {
		if ( fAddressFactory == null ) {
			if ( getExecFile() != null && getProject() !=
null ) {
				IBinaryObject file;
				file = getBinaryFile();
				if (file != null) {
					fAddressFactory =
file.getAddressFactory();
				}
			}
		}
		return fAddressFactory;
	}

we can see it requires an binary file to work. So to get rid of that
requirement, I'm considering adding an CDI interface like
	ICDITarget.getAddressFactory()
Which would ask CDI target to provide a default IAddressFactory. 

The implementation of the new interface can simply be "return null" for
most debuggers, while with our debugger it's like this:
	return new Addr32Factory();

What do you think ? Or any other better solution ?

Thanks.

-- Ling


Back to the top