Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » integration with older gdb version / linux
integration with older gdb version / linux [message #1721170] Mon, 25 January 2016 13:04 Go to next message
Vlad Gheorghe is currently offline Vlad GheorgheFriend
Messages: 127
Registered: May 2011
Senior Member
Dear all,

We are trying to use CDT/Mars with an older version of the gcc toolchain (~2004).
When starting a Remote debugging session, the following error occurs :
Could not determine GDB version using command: 
/view/regres8_l905/cc/tag/mt/3.4-gnupro-04r1-6p1/Linux/tagopert/bin/gdb
--version
Unexpected output format:

GNU gdb gnupro-04r1-6p1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=i386-tagopert-elf".


What are the pre-requisites of a gdb version to be used with CDT/Mars ?
Is there any work-around for this issue ? (e.g. a wrapper script that adapts the output format.. )

Best regards
Vlad Gheorghe

Re: integration with older gdb version / linux [message #1721175 is a reply to message #1721170] Mon, 25 January 2016 13:27 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
Eclipse CDT 8.7 that is part of Mars (or 8.8 pars of Mars.1) has support for gdb >= 7.1: See the details at the bottom of: https://wiki.eclipse.org/CDT/User/NewIn86#Support_for_older_GDB_versions

Quote:

Discontinued support for some older GDB versions

As of CDT 8.6, we will actively support GDB versions 7.1 and higher only.

Older GDB versions are not always working well with newer compilers; it has become difficult and time-consuming to support those versions in newer CDT releases. As of CDT 8.6, we will actively support GDB versions 7.1 and higher. Version 7.1 already dates back to March, 2010. We will not remove the support for older GDBs from the code, but we will make no effort to test or support these older versions.



Note that although 7.1 is oldest officially supported, GDB 6.6 or greater is in the code base still and probably does work.

However, 2004 was circa GDB 6.0 (www.gnu.org/software/gdb/schedule/). Do you know which version you are using?

The fact that the version you are using does not ever respond to --version isn't a great sign, but you can certainly write a wrapper (a bit of Python to wrap around the real gdb) that can handle --version, but it is unknown how much farther after that it will work for. CDT does a version check by launching gdb with --version before even starting the debug session.

Another thing you could try is to use the deprecated CDI aka Legacy launcher instead of the DSF. CDT 9.0 (Eclipse Neon) has it scheduled for removal.

To use the legacy launcher:

1) In the launch configuration, click "select other..." (see step1.png)
2) Check the "Use configuration specific settings" (see step2.png)
3) Choose "Legacy Create Process Launcher" (see step2.png)

You can also change it globally in the preferences (Run/Debug -> Launching -> Default Launchers) if you prefer (see prefs.png)

  • Attachment: step1.png
    (Size: 20.89KB, Downloaded 840 times)
  • Attachment: step2.png
    (Size: 12.92KB, Downloaded 732 times)
  • Attachment: prefs.png
    (Size: 29.33KB, Downloaded 731 times)
Re: integration with older gdb version / linux [message #1721294 is a reply to message #1721175] Tue, 26 January 2016 11:56 Go to previous messageGo to next message
Vlad Gheorghe is currently offline Vlad GheorgheFriend
Messages: 127
Registered: May 2011
Senior Member
Dear Jonah,

Thank you for your support.

1/ I could not easily determine the gdb version we are using.
Note that the ouput of 'gdb --version' is mentioned in the initial post - but the version string is unusual ("GNU gdb gnupro-04r1-6p1").

It comes from a package called '3.4-gnupro-04r1-6p1', which I assume is documented at this link :
https://www.redhat.com/services/focus/embedded/GNUPro-04r1-Embedded-AnnouncementLetter.pdf

Therefore, I assume that we have GDB 6.1.

2/ What I didn't mention in the original post is that we need to do Remote debugging.

3/ We use CDT 8.8.0

4/ We have succeeded to fix the initial version check in CDT by implementing a wrapper script. We are still investigating if the full integration works.

5/ For the second alternative you have suggested, the mentioned option is available under 'Debug configurations/ C/C++ Application', but NOT under 'Debug configurations/ C/C++ Remote Application'.
( I do not know what function is implemented by this component CDI/DSF, but probably it is not applicable for remote debugging... (?) ).

I'll come back with more info as we advance.

Thanks again for the help.

Best regards
Vlad Gheorghe
Re: integration with older gdb version / linux [message #1721298 is a reply to message #1721294] Tue, 26 January 2016 12:27 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 416
Registered: June 2014
Senior Member
I re-read your post on --version, it is CDT that is not understanding the version string output by your custom GDB. So a wrapper script that prints it like more modern GDBs is probably a good workaround.

As for doing a remote launch, you may want to install the "C/C++ GDB Hardware Debugging" CDT plug-ins, they should give you more options and a new kind of launch configuration called "GDB Hardware Debugging". You can get it from the Mars update site (Help -> Install New Software -> choose Mars from drop down list -> type GDB Hardware in filter box).
Re: integration with older gdb version / linux [message #1721612 is a reply to message #1721298] Thu, 28 January 2016 15:41 Go to previous message
Vlad Gheorghe is currently offline Vlad GheorgheFriend
Messages: 127
Registered: May 2011
Senior Member
Dear Jonah,

I confirm that we were able to use GDB with CDT, after implementing the wrapper script.
#!/bin/bash
#
#   gdb mock for CDT 8.6+ version check
#  https://www.eclipse.org/forums/index.php/t/1074148/
#

if [ x"$1" == x--version ] ; then
cat<<EOF
GNU gdb 6.1-gnupro-04r1-6p1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=i386-tagopert-elf".
EOF
else

# use GDB from TASPlf
exec $GCC_DIR/bin/gdb $*
fi



Thanks again for the tip related to the GDB HW debug - we'll check that out later on.

Best regards
Vlad Gheorghe
Previous Topic:Arduino C++ error while using Sparkfun Pro Micro - 5V/16MHz
Next Topic:The User Operation is waiting for background work to complete
Goto Forum:
  


Current Time: Thu Mar 28 12:20:24 GMT 2024

Powered by FUDForum. Page generated in 0.02474 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top