Bug 236214 - Breakpoint on binary symbols are not resolved
Summary: Breakpoint on binary symbols are not resolved
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 5.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 5.0   Edit
Assignee: Elena Laskavaia CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-06-09 04:55 EDT by Teodor Madan CLA
Modified: 2014-01-29 21:37 EST (History)
3 users (show)

See Also:


Attachments
CBreakpointManager patch (1.92 KB, patch)
2008-06-09 04:58 EDT, Teodor Madan CLA
no flags Details | Diff
CBreakpointManager patch with checking for ICFunctionBreakpoint added (2.37 KB, patch)
2008-06-09 11:25 EDT, Teodor Madan CLA
cdtdoug: iplog+
Details | Diff
Fix potential NPE (864 bytes, patch)
2008-06-11 03:59 EDT, Teodor Madan CLA
cdtdoug: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Teodor Madan CLA 2008-06-09 04:55:04 EDT
Build ID: I20080523-0100

Steps To Reproduce:
1. Add "foo" method in an ANSI C project and call it from "main"
1. After build, "open" executable (binaries) in C++ Project view
2. choose "_foo" symbol and invoke "Toggle breakpoint" action.
3. Uncheck "Show source files in binaries" from "C/C++ - >Debug" workspace preferences.
3. Start debug.
4. In breakpoint view, the "_foo" breakpoint is listed but does not have the resolved tickmark.
5. When resuming application, breakpoint will never be hit

More information:
Same issue is when setting breakpoint from "Modules" view.
Comment 1 Teodor Madan CLA 2008-06-09 04:58:11 EDT
Created attachment 104126 [details]
CBreakpointManager patch

ICDIFunctionBreakpoints on function elements from binary objects do not have a source handle. Consider this case in CBreakpointManager#isTargetBreakpoint. See attached patch
Comment 2 Elena Laskavaia CLA 2008-06-09 10:32:50 EDT
If it creates ICFunctionBreakpoint we should check for this type not for source handle.
Comment 3 Teodor Madan CLA 2008-06-09 11:25:08 EDT
Created attachment 104164 [details]
CBreakpointManager patch with checking for ICFunctionBreakpoint added

The code that makes decision if to use source matching for breakpoints was refactored into a separate method "breakpointUsesSourceMatching".
Comment 4 Elena Laskavaia CLA 2008-06-09 12:09:55 EDT
I'll take it to apply patch
Comment 5 Elena Laskavaia CLA 2008-06-09 12:39:04 EDT
-> patch applied on head, thanks.
Breakpoints still won't work if project uses Absolute File Path source lookup but this is different bug
Comment 6 Anton Leherbauer CLA 2008-06-11 03:16:03 EDT
(In reply to comment #5)
> -> patch applied on head, thanks.

The patch introduces a potential NPE, namely when breakpoint.getSourceHandle() returns null.
Comment 7 Teodor Madan CLA 2008-06-11 03:59:22 EDT
Created attachment 104435 [details]
Fix potential NPE

Patch to HEAD that fixes the NPE.
Comment 8 Elena Laskavaia CLA 2008-06-11 09:36:55 EDT
Thanks Anton for noticing, I will apply the fix (it was working though for some reason when I tested it, I guess because it returned "")