Bug 219863 - regression: Address breakpoints inserted from console do not resolve location properly
Summary: regression: Address breakpoints inserted from console do not resolve location...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 4.0.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 5.0   Edit
Assignee: Alain Magloire CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-02-21 15:34 EST by Elena Laskavaia CLA
Modified: 2008-06-22 03:23 EDT (History)
2 users (show)

See Also:


Attachments
4.0 patch (1.72 KB, patch)
2008-02-21 15:34 EST, Elena Laskavaia CLA
bjorn.freeman-benson: iplog+
Details | Diff
CDT 5 patch (4.83 KB, patch)
2008-02-28 15:54 EST, Elena Laskavaia CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elena Laskavaia CLA 2008-02-21 15:34:09 EST
Created attachment 90401 [details]
4.0 patch

In 3.0 when you add breakpoint from console, like b * 0x4804136c if source has debug info it was adding breakpoint with correct source info, like main.c:25,
so it is possible to navigate.
In 4.0 it adds only address line main.exe[address:0x4804136c] which opens binary editor on double click if you lucky (if not lucky it open binary file in text editor).

Expected: if address has file and line it should create breakpoint in same as as it created when adding breakpoints from disassembly view, i.e. so navigation works.





Proposed fix attached (please somebody apply before 4.0.3 is built!!):
- use same method as used by ToggleBreakpointAdapter (which is used when breakpoint set from Disassembly view) to create address breakpoint but with file and line, if available. If not use binary as before.

Tests performed:
- adding breakpoint from Disassembly works as before
- adding breakpoint from console adds main.c[0x4804136c] (line is not visible but it navigates correctly)
- with no debug info it adds main.exe[address:0x4804136c] as before
- with debug info but when file is not found it opens file not found editor
Comment 1 Ken Ryall CLA 2008-02-22 17:38:43 EST
Applied patch to cdt_4_0. Can you make a patch for HEAD?
Comment 2 Elena Laskavaia CLA 2008-02-28 15:54:43 EST
Created attachment 91048 [details]
CDT 5 patch

I started doing path for CDT 5 and found more stuff (besides original problem reported):
- breakpoints set by address and by function would not create proper resource markers and won't be visible in the editor
- breakpoints created using function name (b main) have same source navigation problem as address breakpoints

So I modify my patch that now would solve all of problems above
- Using correct resource fixed marker problems, resource created using same code as for line breakpoints
- Providing file and line for breakpoints creation fixed navigation problems
Comment 3 Alain Magloire CLA 2008-03-28 11:16:19 EDT
Patch apply to head.

Thanks Elena