Bug 455408 - Show GDB version at startup
Summary: Show GDB version at startup
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.5   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 8.6.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-16 16:53 EST by Marc Khouzam CLA
Modified: 2015-01-07 15:28 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2014-12-16 16:53:13 EST
I was thinking it may be useful to output the GDB version at the start of each launch.  There are different ways we could do this such as showing the entire version message, or just the version, or some other formatting.

Either way, the idea is to show what GDB is running.  I find that it can help users realize that they are not point to the right GDB or something.

If people agree with the basic idea, we can discuss the exact format to use.
Comment 1 Marc-André Laperle CLA 2014-12-16 16:58:40 EST
I completely agree! I think the full version message is OK. As a bonus, if it's easy, it could show the full path of GDB as well. Were you thinking of having this only in the GDB traces console? Or somewhere else?
Comment 2 Marc Khouzam CLA 2014-12-16 17:01:13 EST
I pushed to Gerrit one possible way of doing it:
  https://git.eclipse.org/r/38387

It shows the entire output of GDB with respect to the version, in our gdb console, as shown below.  Maybe there is value in showing this entire 'disclaimer' or maybe it is too wordy.  We could just print something like:
"GDB Version used: 7.8"

Opinions welcomed.


GNU gdb (GDB) 7.8
Copyright (C) 2014 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 "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Comment 3 Marc Khouzam CLA 2014-12-16 17:05:00 EST
(In reply to Marc-Andre Laperle from comment #1)
> I completely agree! I think the full version message is OK. As a bonus, if
> it's easy, it could show the full path of GDB as well. 

I believe CDI shows the full path in the actual debug view.  Should we (try to) do that also?  We could even show the version there too...

> Were you thinking of
> having this only in the GDB traces console? Or somewhere else?

The posted patch puts it in the gdb console itself.
To me the 'gdb traces' should not be a must for users, so it wouldn't be enough in this case.  With that in mind, maybe even the gdb console is not enough since in normal session, it is the console of the debugged process that shows; the user has to actively select the gdb console to see it.  But maybe that is enough... I'm not sure.
Comment 4 Nobody - feel free to take it CLA 2014-12-16 17:38:36 EST
(In reply to Marc Khouzam from comment #2)
> I pushed to Gerrit one possible way of doing it:
>   https://git.eclipse.org/r/38387
> 

I like the idea and the patch looks good too.

> It shows the entire output of GDB with respect to the version, in our gdb
> console, as shown below.  Maybe there is value in showing this entire
> 'disclaimer' or maybe it is too wordy.  We could just print something like:
> "GDB Version used: 7.8"
> 
> Opinions welcomed.
>

I'm not a legal expert but showing the entire disclaimer text is probably the right thing to do.
 
> 
> GNU gdb (GDB) 7.8
> Copyright (C) 2014 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 "x86_64-unknown-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word".

I assume typing "help" works as well :)
Comment 5 Nobody - feel free to take it CLA 2014-12-16 17:44:08 EST
(In reply to Marc Khouzam from comment #3)
> I believe CDI shows the full path in the actual debug view.  Should we (try
> to) do that also?  We could even show the version there too...

Showing the full path in the Debug view would be useful. As far as i remember, the full path in the CDI implementation appears only if "Show full paths option" is on.
Not sure about showing the version in the view though. Some non-standard version numbers are too long.

> The posted patch puts it in the gdb console itself.
> To me the 'gdb traces' should not be a must for users, so it wouldn't be
> enough in this case.  With that in mind, maybe even the gdb console is not
> enough since in normal session, it is the console of the debugged process
> that shows; the user has to actively select the gdb console to see it.  But
> maybe that is enough... I'm not sure.

IMO, showing the version in the gdb console is right.
Comment 6 Doug Schaefer CLA 2014-12-16 17:51:37 EST
I don't mind showing the same text a user sees when they run gdb from the command line. Might even help with UX giving a sense of familiarity.
Comment 7 Marc Khouzam CLA 2014-12-17 12:44:42 EST
(In reply to Marc-Andre Laperle from comment #1)
> I completely agree! I think the full version message is OK.

(In reply to Mikhail Khodjaiants from comment #4)
> (In reply to Marc Khouzam from comment #2)
> > I pushed to Gerrit one possible way of doing it:
> >   https://git.eclipse.org/r/38387
> > 
> 
> I like the idea and the patch looks good too.
> 
[..]
>
> I'm not a legal expert but showing the entire disclaimer text is probably
> the right thing to do.
>  
>
> I assume typing "help" works as well :)

Yes it does :)

> IMO, showing the version in the gdb console is right.

(In reply to Doug Schaefer from comment #6)
> I don't mind showing the same text a user sees when they run gdb from the
> command line. Might even help with UX giving a sense of familiarity.

Thanks for the quick feedback.  I will polish the patch and submit it so as to see the printout in the gdb console.  I'll point it out to the list since it is a change in the UI.

I'll look into full path of gdb as a separate commit.
Comment 8 Marc Khouzam CLA 2014-12-17 15:34:30 EST
(In reply to Marc Khouzam from comment #2)
> I pushed to Gerrit one possible way of doing it:
>   https://git.eclipse.org/r/38387
> 
> It shows the entire output of GDB with respect to the version, in our gdb
> console

I've commmitted this to master after Mikhail's review.

I'll keep this bug open as I look into showing the full path of GDB.
Comment 9 Elena Laskavaia CLA 2014-12-18 08:03:53 EST
Is there a way to turn this off?
Comment 10 Elena Laskavaia CLA 2014-12-18 08:04:59 EST
(In reply to Elena Laskavaia from comment #9)
> Is there a way to turn this off?

Ignore this I just look at the patch it is a step in FLS so
people can override it
Comment 11 Marc Khouzam CLA 2014-12-18 12:39:06 EST
(In reply to Marc Khouzam from comment #8)
> (In reply to Marc Khouzam from comment #2)
> > I pushed to Gerrit one possible way of doing it:
> >   https://git.eclipse.org/r/38387
> > 
> > It shows the entire output of GDB with respect to the version, in our gdb
> > console
> 
> I've commmitted this to master after Mikhail's review.

I've put a little note in the N&N
Comment 12 Marc Khouzam CLA 2014-12-18 16:23:06 EST
(In reply to Marc Khouzam from comment #3)
> I believe CDI shows the full path in the actual debug view. 

I just tried it with CDT and it is the inferior that shows the full path.  As for GDB, whatever path is put in the launch debugger tab, that is what is shown.

Currently, in DSF we only show the hard-code string 'gdb'.

I'll see how hard it is to show the full path when "Show full paths option" is enabled; when the option is disabled, we could show just 'gdb' or the last segment of what was put in the launch, or the full string of what was put in the launch.  I'll start prototyping things to get a feel for it.
Comment 13 Marc Khouzam CLA 2014-12-19 15:19:19 EST
(In reply to Marc Khouzam from comment #12)
> (In reply to Marc Khouzam from comment #3)
> > I believe CDI shows the full path in the actual debug view. 
> 
> I just tried it with CDT 

I just tried with CDI is what I meant

> and it is the inferior that shows the full path.

I believe this is easy because the binary is in the project and its location is well known.

> As for GDB, whatever path is put in the launch debugger tab, that is what is
> shown.

It turns out that finding the full path of the binary is not that easy.  I couldn't find any java API to do that, even though we have a handle to the process. To do this we may actually have to implement different, platform-specific solutions to "ask" the OS where the binary is located.

If noone has a simple suggestion for this, I won't do this now, as I have other more urgent features.  I will still propose an improvement to the current simple 'gdb' label, to provide the easily available information.
Comment 14 Marc Khouzam CLA 2014-12-22 09:53:49 EST
(In reply to Marc Khouzam from comment #13)
> I will still propose an improvement to the
> current simple 'gdb' label, to provide the easily available information.

I've pushed a proposed change to gerrit:
  https://git.eclipse.org/r/38679

Instead of just showing 'gdb' in the debug view, this shows the path of GDB as *typed* in by the user in the launch, followed by the current version *number*.  For example:

gdb (7.8.1)
gdb.7.6 (7.6)
/home/marc/bin/gdb.7.5 (7.5.1)

Mikhail has expressed concerns about showing the version as it may be long in some cases, but I wondered if just showing the number would be small enough?  This number is the one we use to determine which services to instantiate and therefore could prove valuable to show.

Opinions?
Comment 15 Marc Khouzam CLA 2014-12-22 10:28:58 EST
I've opened Bug 455962 to track any effort about showing the full path of the GDB binary.
Comment 16 Marc Khouzam CLA 2015-01-07 15:28:24 EST
(In reply to Marc Khouzam from comment #14)
> (In reply to Marc Khouzam from comment #13)
> > I will still propose an improvement to the
> > current simple 'gdb' label, to provide the easily available information.
> 
> I've pushed a proposed change to gerrit:
>   https://git.eclipse.org/r/38679
> 
> Instead of just showing 'gdb' in the debug view, this shows the path of GDB
> as *typed* in by the user in the launch, followed by the current version
> *number*.  For example:
> 
> gdb (7.8.1)
> gdb.7.6 (7.6)
> /home/marc/bin/gdb.7.5 (7.5.1)

I've committed this to master and updated the N&N with this.

Thanks everyone for the feedback and reviews.