Bug 304700 - gdb-dsf does not recognize correct gdb version under cygwin
Summary: gdb-dsf does not recognize correct gdb version under cygwin
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 0 DD 1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-04 11:47 EST by itaisteiner CLA
Modified: 2020-09-04 15:17 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description itaisteiner CLA 2010-03-04 11:47:51 EST
Build Identifier: 20100218-1602

I am using Eclipse CDT with Cygwin and trying to use the new DSF-GDB non-stop-mode for debugging.
I d/l the source for gdb 7.01 and installed it manually in cygwin. it works perfectly via cygwin shell.

However, when I try to use the dsf-gdb with non-stop-mode marked, I get an error saying "Non-stop mode is only supported starting with GDB 6.8.50". When the box is unmarked, the dsf debugger works normally.


Reproducible: Always

Steps to Reproduce:
1.d/l cygwin and gdb 7.01 sources
2.manually make and install gdb 7.01 in cygwin (and verify correct version when calling gdb)
3.Run eclipse and perform the detailed description
Comment 1 Marc Khouzam CLA 2010-03-04 14:27:21 EST
What is the output when you do

gdb -version
Comment 2 itaisteiner CLA 2010-03-07 03:53:11 EST
(In reply to comment #1)
> What is the output when you do
> gdb -version

GNU gdb (GDB) 7.0.1
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Comment 3 Marc Khouzam CLA 2010-03-08 12:28:50 EST
(In reply to comment #2)
> (In reply to comment #1)
> > What is the output when you do
> > gdb -version
> 
> GNU gdb (GDB) 7.0.1
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "i686-pc-cygwin".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.

I don't see why this would fail.  I believe we parse this output correctly.
Comment 4 Marc-André Laperle CLA 2010-03-08 21:31:20 EST
(In reply to comment #3)
> I don't see why this would fail.  I believe we parse this output correctly.

I can reproduce this. I'm not sure why but the versionOutput string is empty when LaunchUtils.getGDBVersionFromText is called.
Comment 5 Marc-André Laperle CLA 2010-03-08 21:50:04 EST
I assume that gdb was not installed in cygwin's bin path? The problem is that gdb doesn't launch because it's looking for dlls (cygwin1.dll, etc) so you need to have your cygwin bin dir in the PATH variable or copy every dlls where the new gdb is. So, you have to make sure that you can start gdb from plain cmd.exe then start Eclipse and gdb's version will be recognized. Once that's done, I'm getting

!MESSAGE Failed to execute MI command:
-exec-run
Error message from debugger back end:
The target does not support running in non-stop mode.
!STACK 0
java.lang.Exception: The target does not support running in non-stop mode.
Comment 6 Marc Khouzam CLA 2010-03-09 08:45:28 EST
(In reply to comment #5)

Thanks Marc-Andre for reproducing this.

> I assume that gdb was not installed in cygwin's bin path? The problem is that
> gdb doesn't launch because it's looking for dlls (cygwin1.dll, etc) so you need
> to have your cygwin bin dir in the PATH variable or copy every dlls where the
> new gdb is. 

How come this problem didn't happen without non-stop?

> So, you have to make sure that you can start gdb from plain cmd.exe
> then start Eclipse and gdb's version will be recognized. Once that's done, I'm
> getting
> 
> !MESSAGE Failed to execute MI command:
> -exec-run
> Error message from debugger back end:
> The target does not support running in non-stop mode.
> !STACK 0
> java.lang.Exception: The target does not support running in non-stop mode.

So the Windows target does not support Non-Stop.  It is not very surprising, as most of the advanced features of GDB have mostly focused on Linux.

Can the person that opened the bug confirm that things work the way Marc-Andre suggest, and we can mark this as INVALID.
Comment 7 itaisteiner CLA 2010-03-09 09:53:31 EST
(In reply to comment #6)
> (In reply to comment #5)
> Thanks Marc-Andre for reproducing this.
> > I assume that gdb was not installed in cygwin's bin path? The problem is that
> > gdb doesn't launch because it's looking for dlls (cygwin1.dll, etc) so you need
> > to have your cygwin bin dir in the PATH variable or copy every dlls where the
> > new gdb is. 
> How come this problem didn't happen without non-stop?
> > So, you have to make sure that you can start gdb from plain cmd.exe
> > then start Eclipse and gdb's version will be recognized. Once that's done, I'm
> > getting
> > 
> > !MESSAGE Failed to execute MI command:
> > -exec-run
> > Error message from debugger back end:
> > The target does not support running in non-stop mode.
> > !STACK 0
> > java.lang.Exception: The target does not support running in non-stop mode.
> So the Windows target does not support Non-Stop.  It is not very surprising, as
> most of the advanced features of GDB have mostly focused on Linux.
> Can the person that opened the bug confirm that things work the way Marc-Andre
> suggest, and we can mark this as INVALID.

Unfortunately, I got the same result on my system after changing the path var. I guess it's about time I move to linux...
Comment 8 Marc-André Laperle CLA 2010-03-09 10:27:34 EST
(In reply to comment #6)> new gdb is. 
> How come this problem didn't happen without non-stop?

Good question, I'll test some more tonight.

> So the Windows target does not support Non-Stop.  It is not very surprising, as
> most of the advanced features of GDB have mostly focused on Linux.

It seems to be the case with MinGW also. This could be problematic, it means DSF-GDB can't rely on gdb's version to determine if non-stop is supported.

(In reply to comment #7)
> Unfortunately, I got the same result on my system after changing the path var.
> I guess it's about time I move to linux...

Did you restart Eclipse? Can you run this gdb from plain cmd.exe?
Comment 9 John Cortell CLA 2010-03-09 10:33:12 EST
(In reply to comment #8)
> > So the Windows target does not support Non-Stop.  It is not very surprising, as
> > most of the advanced features of GDB have mostly focused on Linux.
> 
> It seems to be the case with MinGW also. This could be problematic, it means
> DSF-GDB can't rely on gdb's version to determine if non-stop is supported.

Why would it need to rely on the version, given the state of things? The code just needs to detect that it's running on Windows and, if so, not use non-stop.
Comment 10 Marc Khouzam CLA 2010-03-09 10:46:58 EST
(In reply to comment #9)

> Why would it need to rely on the version, given the state of things? The code
> just needs to detect that it's running on Windows and, if so, not use non-stop.

Yes, I think we're gonna have to start looking at the OS we're running on as well as version.

In this particular case, do we really need to change anything?  If the user selects Non-Stop on Windows, she'll get the error "target not supported".  If GDB ever supports it on Windows, it will work.  As long as the error message is clear, I think we are ok.