Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [dsdp-dd-dev] GDB source lookup issues

Here are some scenarios that should be supported:

1) Sources compiled on one host and IDE is used on another. Could be cross
platform, meaning problems with / and \, besides the path mapping.
Breakpoints are set by user using host path.

2) Combination of gcc and gdb makes paths like /bar/foo/../a.c and gdb does
not convert them to canonicalized name for comparison.
Breakpoints are set by user using canonic file name. Meaning unless IDE does
something setting /bar/a.c would fail.

3) Breakpoint is set on the file not within the set of debugged binary,
while basename of a file match one of the files within the set (correct
behaviour: breakpoint set should fail)

-----Original Message-----
From: dsdp-dd-dev-bounces@xxxxxxxxxxx
[mailto:dsdp-dd-dev-bounces@xxxxxxxxxxx] On Behalf Of Tobias Södergren XT
Sent: March 3, 2008 3:41 AM
To: Device Debugging developer discussions
Subject: RE: [dsdp-dd-dev] GDB source lookup issues

Hi Pawel and others,
I'm not sure that Elena Laskavaia's issue applies to dsdp-dd:

This is what happens in CDT:

*.cdt.debug.mi.core.cdi.BreakpointManager:
MIBreakInsert[] createMIBreakInsert(LocationBreakpoint bkpt)
...
	ICDILocator locator = bkpt.getLocator();
	String file = locator.getFile();
	if (file != null) {
		file = new File(file).getName(); // <-- Just using the
filename
	} 
...

This is what happens in DD:

*.dd.dsf.debug.service.BreakpointsMediator:
void breakpointAdded(final IBreakpoint breakpoint)
...
	final List<Map<String, Object>> attrsArray = 
		fAttributeTranslator.getBreakpointAttributes(breakpoint,
fBreakpointManager.isEnabled()); // <-- Creating attributes
...
	for (final IBreakpointsTargetDMContext dmc : fPlatformBPs.keySet())
{
		installBreakpoint(dmc, breakpoint, attrsArray, new
RequestMonitor(getExecutor(), countingRm));
	}

*.dd.mi.service.MIBreakpoints:
void addBreakpoint(.., Map<String, Object> attributes, ...)
...
	String location = formatLocation(attributes) // <-- Using attributes
...

String formatLocation(..)
...
	String location = (String)  getProperty(attributes, ADDRESS,
NULL_STRING);
...
	if (!fileName.equals(NULL_STRING)) {
		if (lineNumber != -1) {
			location = fileName + ":" + lineNumber;
//$NON-NLS-1$ 
		} else {
			location = fileName + ":" + function;
//$NON-NLS-1$
		}
	}
	return location;
...

So whatever is returned from the
fAttributeTranslator.getBreakpointAttributes(), is used "umodified".

That said, there seem to be a lot of discussion about source lookup issues.
Would it be possible to create unit tests that explains the existing
problems? I'm having a hard time understanding the all the underlying
problem from the discussions on the mailing lists. There seem to be a lot of
"common" knowledge of issues which _hopefully_ could be expressed in tests.

Cheers,
Tobias

-----Original Message-----
From: dsdp-dd-dev-bounces@xxxxxxxxxxx
[mailto:dsdp-dd-dev-bounces@xxxxxxxxxxx] On Behalf Of Pawel Piech
Sent: den 26 februari 2008 22:56
To: Device Debugging developer discussions
Subject: [dsdp-dd-dev] GDB source lookup issues

Hi Tobias and All,
I'm want to cross-post the following discussion from cdt-dev, which we
mentioned in this mornings DSF-GDB meeting: 
http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg11583.html

It seems that Windows and cross platform development with GDB could be much
improved if this source lookup issue was addressed.  If after fixing bug
219920 source lookup continues to be a problem for your use cases, I
recommend that you follow up and contribute to fixing this issue in CDT.

Cheers,
Pawel
_______________________________________________
dsdp-dd-dev mailing list
dsdp-dd-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-dd-dev
_______________________________________________
dsdp-dd-dev mailing list
dsdp-dd-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-dd-dev


Back to the top