Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369622 - Move to line fails using MinGW GDB
Summary: Move to line fails using MinGW GDB
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Marc-André Laperle CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 02:08 EST by Raphael Zulliger CLA
Modified: 2012-03-06 13:23 EST (History)
4 users (show)

See Also:


Attachments
Proposed fix/workaround (15.83 KB, patch)
2012-01-25 02:12 EST, Raphael Zulliger CLA
no flags Details | Diff
Proposed fix/workaround (15.83 KB, patch)
2012-01-25 04:06 EST, Raphael Zulliger CLA
no flags Details | Diff
Proposed fix/workaround (3.79 KB, patch)
2012-01-25 04:14 EST, Raphael Zulliger CLA
malaperle: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Zulliger CLA 2012-01-25 02:08:17 EST
Build Identifier: 20110615-0604

The move to line command refuses to work with at least the following versions of MinGW GDB:
 - GNU gdb (GDB) 7.1; This GDB was configured as "mingw32"
 - GNU gdb (GDB) 7.3.50.20110718-cvs; This GDB was configured as "--host=i686-win32-mingw32 --target=powerpc-indel-eabi" (this one contains some Indel specific pathes, but shey shoulnd't have any influence on the bug reported here)

I analyzed the failure and came up to the conclusion that the issue happens because of the same problem discussed and resolved for runToLine earlier. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=232415 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=196154

Reproducible: Always

Steps to Reproduce:
1. Start debugging on Windows using a MinGW GDB
2. Try the "move to line" command (e.g. from the context menu when right-clicking onto a C/C++ code line)
3. An error message is shown
Comment 1 Raphael Zulliger CLA 2012-01-25 02:12:14 EST
Created attachment 210030 [details]
Proposed fix/workaround

This patch applies the same fix/workaround as https://bugs.eclipse.org/bugs/show_bug.cgi?id=232415 did for runToLine. It's straight forward and has been tested with CDT 8.0.1 and "GNU gdb (GDB) 7.1" (MinGW)
Comment 2 Raphael Zulliger CLA 2012-01-25 04:06:16 EST
Created attachment 210034 [details]
Proposed fix/workaround

Previously added the wrong patch...
Comment 3 Raphael Zulliger CLA 2012-01-25 04:14:08 EST
Created attachment 210035 [details]
Proposed fix/workaround

Same s... again. (The patch file on my disk did not contain the expected changes... sorry for all this trash).
Comment 4 Branko Drevensek CLA 2012-03-01 16:51:44 EST
This seems fine in indigo SR2. Probably this bug should be closed?
Comment 5 Marc-André Laperle CLA 2012-03-05 02:10:26 EST
(In reply to comment #4)
> This seems fine in indigo SR2. Probably this bug should be closed?

Was GDB was actually fixed? It works for me using GDB 7.4 and indigo SR0 (3.7.0 + CDT 8.0.0). I'll test with other versions of GDB. Maybe the patch should still be applied to deal with GDB < 7.4.
Comment 6 Branko Drevensek CLA 2012-03-05 02:51:35 EST
Yes, it seems that it's gdb that was fixed. 
This works fine on (mingw) gdb 7.3.1, but results in same bug on gdb 6.7.1.
Comment 7 Marc Khouzam CLA 2012-03-05 10:10:40 EST
The proposed fix looks good to me, although I cannot test it.
If Marc-Andre can confirm it works ok, I think it is a good fix.
Comment 8 Branko Drevensek CLA 2012-03-05 10:38:54 EST
Sorry, my previous comment was probably unclear. What I was trying to say was: Indigo SR2 + gdb (mingw) 7.3.1 works fine, so gdb seems to have been fixed. Indigo SR2 + gdb (our mingw based port) 6.7.1 results in same "source line not found" bug. Patch looks fine. When I get to my Windows machine I can test it.
Comment 9 Marc-André Laperle CLA 2012-03-06 01:36:13 EST
(In reply to comment #7)
> The proposed fix looks good to me, although I cannot test it.
> If Marc-Andre can confirm it works ok, I think it is a good fix.

I tried with GDB 7.0.1 and I could reproduce the bug. After applying the patch it worked with both 7.0.1 and 7.4. Looks good.
Comment 10 Marc Khouzam CLA 2012-03-06 08:52:20 EST
(In reply to comment #9)
> (In reply to comment #7)
> > The proposed fix looks good to me, although I cannot test it.
> > If Marc-Andre can confirm it works ok, I think it is a good fix.
> 
> I tried with GDB 7.0.1 and I could reproduce the bug. After applying the patch
> it worked with both 7.0.1 and 7.4. Looks good.

Thanks Marc-Andre, do you want to go ahead and commit, or do you prefer I do?
Comment 11 Marc-André Laperle CLA 2012-03-06 12:05:27 EST
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #7)
> > > The proposed fix looks good to me, although I cannot test it.
> > > If Marc-Andre can confirm it works ok, I think it is a good fix.
> > 
> > I tried with GDB 7.0.1 and I could reproduce the bug. After applying the patch
> > it worked with both 7.0.1 and 7.4. Looks good.
> 
> Thanks Marc-Andre, do you want to go ahead and commit, or do you prefer I do?

I'll commit it.
Comment 12 Marc-André Laperle CLA 2012-03-06 12:52:46 EST
Committed to master, 8.1.0 > 2012-03-06 with a slight modification. In MIRunControl, I moved the line in the 'else' like for GDBRunControl.
Comment 13 CDT Genie CLA 2012-03-06 13:23:04 EST
*** cdt git genie on behalf of Raphael Zulliger ***

    Bug 369622 - Move to line fails using MinGW GDB

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=9634e0c57f0f88605597e7768b2f9d6a06c89940