Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 45676 Details for
Bug 135250
Patch to fix function breakpoints
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Function and address breakpoints work better with this patch
functionandaddressbrekapoints.txt (text/plain), 6.15 KB, created by
Oyvind Harboe
on 2006-07-03 13:56:12 EDT
(
hide
)
Description:
Function and address breakpoints work better with this patch
Filename:
MIME Type:
Creator:
Oyvind Harboe
Created:
2006-07-03 13:56:12 EDT
Size:
6.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.debug.core >Index: src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java,v >retrieving revision 1.59 >diff -u -r1.59 CBreakpointManager.java >--- src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java 23 Jun 2006 17:26:25 -0000 1.59 >+++ src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java 3 Jul 2006 17:54:44 -0000 >@@ -671,7 +671,12 @@ > try { > ICDILocator location = cdiBreakpoint.getLocator(); > String file = location.getFile(); >- if ( !isEmpty( file ) ) { >+ if ( !isEmpty( location.getFunction() ) ) { >+ breakpoint = createFunctionBreakpoint( cdiBreakpoint ); >+ } >+ else if ( !location.getAddress().equals( BigInteger.ZERO ) ) { >+ breakpoint = createAddressBreakpoint( cdiBreakpoint ); >+ } else if ( !isEmpty( file ) ) { > Object sourceElement = getSourceElement( file ); > String sourceHandle = file; > IResource resource = getProject(); >@@ -682,7 +687,7 @@ > else if ( sourceElement instanceof IStorage ) { > sourceHandle = ((IStorage)sourceElement).getFullPath().toOSString(); > resource = ResourcesPlugin.getWorkspace().getRoot(); >- } >+ } > breakpoint = createLineBreakpoint( sourceHandle, resource, cdiBreakpoint ); > // else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) { > // breakpoint = createFunctionBreakpoint( cdiBreakpoint ); >@@ -691,12 +696,6 @@ > // breakpoint = createAddressBreakpoint( cdiBreakpoint ); > // } > } >- else if ( !isEmpty( location.getFunction() ) ) { >- breakpoint = createFunctionBreakpoint( cdiBreakpoint ); >- } >- else if ( !location.getAddress().equals( BigInteger.ZERO ) ) { >- breakpoint = createAddressBreakpoint( cdiBreakpoint ); >- } > } > catch( CDIException e ) { > } >@@ -876,18 +875,25 @@ > if ( breakpoint instanceof ICAddressBreakpoint ) > return supportsAddressBreakpoint( (ICAddressBreakpoint)breakpoint ); > if ( breakpoint instanceof ICLineBreakpoint ) { >- try { >- String handle = breakpoint.getSourceHandle(); >- ISourceLocator sl = getSourceLocator(); >- if ( sl instanceof ICSourceLocator ) >- return ( ((ICSourceLocator)sl).findSourceElement( handle ) != null ); >- else if ( sl instanceof CSourceLookupDirector ) { >- return ( ((CSourceLookupDirector)sl).contains( breakpoint ) ); >- } >- } >- catch( CoreException e ) { >- return false; >- } >+ /* if this isn't a valid line breakpoint, then GDB will produce an >+ * error message, which is sufficient handling of the problem. >+ * >+ * Arrghhh... I forget exactly why, but the code below stops address breakpoints >+ * from working correctly. >+ */ >+ return true; >+// try { >+// String handle = breakpoint.getSourceHandle(); >+// ISourceLocator sl = getSourceLocator(); >+// if ( sl instanceof ICSourceLocator ) >+// return ( ((ICSourceLocator)sl).findSourceElement( handle ) != null ); >+// else if (checkCSourceLookupDirector(sl)) { >+// return ( ((CSourceLookupDirector)sl).contains( breakpoint ) ); >+// } >+// } >+// catch( CoreException e ) { >+// return false; >+// } > } > else { > IProject project = resource.getProject(); >#P org.eclipse.cdt.debug.mi.core >Index: cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java,v >retrieving revision 1.39 >diff -u -r1.39 BreakpointManager.java >--- cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java 23 Jun 2006 17:25:38 -0000 1.39 >+++ cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java 3 Jul 2006 17:54:46 -0000 >@@ -433,14 +433,7 @@ > int line = allMIBreakpoints[i].getLine(); > String addr = allMIBreakpoints[i].getAddress(); > >- if (file != null && file.length() > 0 && line > 0) { >- LineLocation location = createLineLocation (allMIBreakpoints[i].getFile(), >- allMIBreakpoints[i].getLine()); >- // By default new breakpoint are LineBreakpoint >- Breakpoint newBreakpoint = new LineBreakpoint(target, type, location, condition); >- newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]}); >- bList.add(newBreakpoint); >- } else if (function != null && function.length() > 0) { >+ if (function != null && function.length() > 0) { > FunctionLocation location = createFunctionLocation(file, function); > // By default new breakpoint are LineBreakpoint > Breakpoint newBreakpoint = new FunctionBreakpoint(target, type, location, condition); >@@ -453,6 +446,13 @@ > Breakpoint newBreakpoint = new AddressBreakpoint(target, type, location, condition); > newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]}); > bList.add(newBreakpoint); >+ } else if (file != null && file.length() > 0 && line > 0) { >+ LineLocation location = createLineLocation (allMIBreakpoints[i].getFile(), >+ allMIBreakpoints[i].getLine()); >+ // By default new breakpoint are LineBreakpoint >+ Breakpoint newBreakpoint = new LineBreakpoint(target, type, location, condition); >+ newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]}); >+ bList.add(newBreakpoint); > } > } > eventList.add(new MIBreakpointCreatedEvent(miSession, no)); >@@ -936,9 +936,11 @@ > if (colon != -1) { > line.append(function); > } else { >- if (file != null && file.length() > 0) { >- line.append(file).append(':'); >- } >+ // FIX!!! sometimes the file can be the name of the binary(foo.elf) >+ // in which this does not work. >+// if (file != null && file.length() > 0) { >+// line.append(file).append(':'); >+// } > // GDB does not seem to accept function arguments when > // we use file name: > // (gdb) break file.c:Test(int)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
cdtdoug
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 135250
:
37866
| 45676 |
60355