|
Lines 671-677
Link Here
|
| 671 |
try { |
671 |
try { |
| 672 |
ICDILocator location = cdiBreakpoint.getLocator(); |
672 |
ICDILocator location = cdiBreakpoint.getLocator(); |
| 673 |
String file = location.getFile(); |
673 |
String file = location.getFile(); |
| 674 |
if ( !isEmpty( file ) ) { |
674 |
if ( !isEmpty( location.getFunction() ) ) { |
|
|
675 |
breakpoint = createFunctionBreakpoint( cdiBreakpoint ); |
| 676 |
} |
| 677 |
else if ( !location.getAddress().equals( BigInteger.ZERO ) ) { |
| 678 |
breakpoint = createAddressBreakpoint( cdiBreakpoint ); |
| 679 |
} else if ( !isEmpty( file ) ) { |
| 675 |
Object sourceElement = getSourceElement( file ); |
680 |
Object sourceElement = getSourceElement( file ); |
| 676 |
String sourceHandle = file; |
681 |
String sourceHandle = file; |
| 677 |
IResource resource = getProject(); |
682 |
IResource resource = getProject(); |
|
Lines 682-688
Link Here
|
| 682 |
else if ( sourceElement instanceof IStorage ) { |
687 |
else if ( sourceElement instanceof IStorage ) { |
| 683 |
sourceHandle = ((IStorage)sourceElement).getFullPath().toOSString(); |
688 |
sourceHandle = ((IStorage)sourceElement).getFullPath().toOSString(); |
| 684 |
resource = ResourcesPlugin.getWorkspace().getRoot(); |
689 |
resource = ResourcesPlugin.getWorkspace().getRoot(); |
| 685 |
} |
690 |
} |
| 686 |
breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint ); |
691 |
breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint ); |
| 687 |
// else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) { |
692 |
// else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) { |
| 688 |
// breakpoint = createFunctionBreakpoint( cdiBreakpoint ); |
693 |
// breakpoint = createFunctionBreakpoint( cdiBreakpoint ); |
|
Lines 691-702
Link Here
|
| 691 |
// breakpoint = createAddressBreakpoint( cdiBreakpoint ); |
696 |
// breakpoint = createAddressBreakpoint( cdiBreakpoint ); |
| 692 |
// } |
697 |
// } |
| 693 |
} |
698 |
} |
| 694 |
else if ( !isEmpty( location.getFunction() ) ) { |
|
|
| 695 |
breakpoint = createFunctionBreakpoint( cdiBreakpoint ); |
| 696 |
} |
| 697 |
else if ( !location.getAddress().equals( BigInteger.ZERO ) ) { |
| 698 |
breakpoint = createAddressBreakpoint( cdiBreakpoint ); |
| 699 |
} |
| 700 |
} |
699 |
} |
| 701 |
catch( CDIException e ) { |
700 |
catch( CDIException e ) { |
| 702 |
} |
701 |
} |
|
Lines 876-893
Link Here
|
| 876 |
if ( breakpoint instanceof ICAddressBreakpoint ) |
875 |
if ( breakpoint instanceof ICAddressBreakpoint ) |
| 877 |
return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint ); |
876 |
return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint ); |
| 878 |
if ( breakpoint instanceof ICLineBreakpoint ) { |
877 |
if ( breakpoint instanceof ICLineBreakpoint ) { |
| 879 |
try { |
878 |
/* if this isn't a valid line breakpoint, then GDB will produce an |
| 880 |
String handle = breakpoint.getSourceHandle(); |
879 |
* error message, which is sufficient handling of the problem. |
| 881 |
ISourceLocator sl = getSourceLocator(); |
880 |
* |
| 882 |
if ( sl instanceof ICSourceLocator ) |
881 |
* Arrghhh... I forget exactly why, but the code below stops address breakpoints |
| 883 |
return ( ((ICSourceLocator)sl).findSourceElement( handle ) != null ); |
882 |
* from working correctly. |
| 884 |
else if ( sl instanceof CSourceLookupDirector ) { |
883 |
*/ |
| 885 |
return ( ((CSourceLookupDirector)sl).contains( breakpoint ) ); |
884 |
return true; |
| 886 |
} |
885 |
// try { |
| 887 |
} |
886 |
// String handle = breakpoint.getSourceHandle(); |
| 888 |
catch( CoreException e ) { |
887 |
// ISourceLocator sl = getSourceLocator(); |
| 889 |
return false; |
888 |
// if ( sl instanceof ICSourceLocator ) |
| 890 |
} |
889 |
// return ( ((ICSourceLocator)sl).findSourceElement( handle ) != null ); |
|
|
890 |
// else if (checkCSourceLookupDirector(sl)) { |
| 891 |
// return ( ((CSourceLookupDirector)sl).contains( breakpoint ) ); |
| 892 |
// } |
| 893 |
// } |
| 894 |
// catch( CoreException e ) { |
| 895 |
// return false; |
| 896 |
// } |
| 891 |
} |
897 |
} |
| 892 |
else { |
898 |
else { |
| 893 |
IProject project = resource.getProject(); |
899 |
IProject project = resource.getProject(); |