mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
[236214] - patch for function breakpoints without source info
This commit is contained in:
parent
fa79296afb
commit
2c178d6c68
1 changed files with 29 additions and 2 deletions
|
@ -1188,11 +1188,37 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
setBreakpointsOnTarget0( breakpoints );
|
setBreakpointsOnTarget0( breakpoints );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if matching between the symbolics referenced by the breakpoint
|
||||||
|
* and the symbolics of the contained CDebugTarget should be done using also source handle.
|
||||||
|
* @param breakpoint
|
||||||
|
* @return true if source handle should be used
|
||||||
|
*/
|
||||||
|
private boolean breakpointUsesSourceMatching(ICBreakpoint breakpoint) {
|
||||||
|
boolean result = false;
|
||||||
|
if (breakpoint instanceof ICLineBreakpoint) {
|
||||||
|
result = true;
|
||||||
|
if (breakpoint instanceof ICFunctionBreakpoint) {
|
||||||
|
// ICDIFunctionBreakpoint on function elements from binary objects can be
|
||||||
|
// set without having a source handle. For this case of line breakpoint
|
||||||
|
// don't try to match breakpoints with source locator of contained CDebugTarget.
|
||||||
|
String handle = "";
|
||||||
|
try {
|
||||||
|
handle = breakpoint.getSourceHandle();
|
||||||
|
} catch (CoreException ex) {
|
||||||
|
// ignore exception. source handle will be empty anyway.
|
||||||
|
}
|
||||||
|
result = handle.length() > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isTargetBreakpoint( ICBreakpoint breakpoint ) {
|
private boolean isTargetBreakpoint( ICBreakpoint breakpoint ) {
|
||||||
IResource resource = breakpoint.getMarker().getResource();
|
|
||||||
if ( breakpoint instanceof ICAddressBreakpoint )
|
if ( breakpoint instanceof ICAddressBreakpoint )
|
||||||
return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint );
|
return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint );
|
||||||
if ( breakpoint instanceof ICLineBreakpoint ) {
|
|
||||||
|
if ( breakpointUsesSourceMatching( breakpoint ) ) {
|
||||||
try {
|
try {
|
||||||
String handle = breakpoint.getSourceHandle();
|
String handle = breakpoint.getSourceHandle();
|
||||||
ISourceLocator sl = getSourceLocator();
|
ISourceLocator sl = getSourceLocator();
|
||||||
|
@ -1207,6 +1233,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
IResource resource = breakpoint.getMarker().getResource();
|
||||||
IProject project = resource.getProject();
|
IProject project = resource.getProject();
|
||||||
if ( project != null && project.exists() ) {
|
if ( project != null && project.exists() ) {
|
||||||
ISourceLocator sl = getSourceLocator();
|
ISourceLocator sl = getSourceLocator();
|
||||||
|
|
Loading…
Add table
Reference in a new issue