Skip to main content
summaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorAlena Laskavaia2008-06-09 12:33:55 -0400
committerAlena Laskavaia2008-06-09 12:33:55 -0400
commit2c178d6c68653464b0640bffbbb3d33e8fcbfb27 (patch)
tree32bc00024b2a5bc26c09e969a6aba95bca24ac92 /debug
parentfa79296afbf7e93ba6a13c6a8bcf6a286f034848 (diff)
downloadorg.eclipse.cdt-2c178d6c68653464b0640bffbbb3d33e8fcbfb27.tar.gz
org.eclipse.cdt-2c178d6c68653464b0640bffbbb3d33e8fcbfb27.tar.xz
org.eclipse.cdt-2c178d6c68653464b0640bffbbb3d33e8fcbfb27.zip
[236214] - patch for function breakpoints without source info
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java31
1 files changed, 29 insertions, 2 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
index f2eff24abd..1a684bf724 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
@@ -1188,11 +1188,37 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
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 ) {
- IResource resource = breakpoint.getMarker().getResource();
if ( breakpoint instanceof ICAddressBreakpoint )
return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint );
- if ( breakpoint instanceof ICLineBreakpoint ) {
+
+ if ( breakpointUsesSourceMatching( breakpoint ) ) {
try {
String handle = breakpoint.getSourceHandle();
ISourceLocator sl = getSourceLocator();
@@ -1207,6 +1233,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
}
}
else {
+ IResource resource = breakpoint.getMarker().getResource();
IProject project = resource.getProject();
if ( project != null && project.exists() ) {
ISourceLocator sl = getSourceLocator();

Back to the top