Bug 303808 - Debug console lacks many important features
Summary: Debug console lacks many important features
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 0 DD 1.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 9.2.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Ken Ryall CLA
URL:
Whiteboard:
Keywords:
: 283661 (view as bug list)
Depends on: 497166 497167 497636
Blocks:
  Show dependency tree
 
Reported: 2010-02-24 15:32 EST by Achim Bursian CLA
Modified: 2017-01-19 16:07 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Bursian CLA 2010-02-24 15:32:35 EST
Build Identifier: 20090920-1017

Whenever I suggest others to use Eclipse/CDT/CDI for their debugging needs, I get a lot of complaints about the "unusable console".
Power users are quite used to type commands in a gdb console for special stuff. Some of them have used gdb directly for years, or a different GUI like Insight/gdb. They often have little snippets of gdb commands somewhere in a notes.txt, that get pasted to the console over and over. Of course, this is nothing that is needed by novices, but experienced users are common in the embedded world :-)
 
The biggest complaints concerning the console in Eclipse are:
* no command history (scrolling up through previous commands) 
* no command repetition with the Return key 
* no prompt (as a visual sign that a command has finished), see Bug 78368
* no protocol file (to save commands and output for later processing) 
* no aliases (?) 
* no auto completion for variable names or other stuff

As far as I can see there were no enhancements in these areas with DSF. (Correct me if I'm wrong) So it wouldn't help to switch to DSF/gdb.
 
We discussed that on cdt-dev, there are already some patches available by Giuseppe MONTALTO [giuseppe.montalto@st.com], see topic "Future of debugger console" started 2010-02-24 

Reproducible: Always
Comment 1 Daniel Jacobowitz CLA 2010-02-24 15:49:37 EST
There's a lot that can be implemented separately from the normal GDB CLI; for instance, GDB exposes enough support to implement the exact same tab completion, by using -interpreter-exec console "complete partly-typed \"command\""

I do not believe a front end can exactly imitate the automatic re-execution of commands with <enter>.  GDB has internal state about whether the last command is safe to repeat.  But defaulting to repetition wouldn't be all that bad.
Comment 2 Stefano Oliveri CLA 2012-08-21 03:35:23 EDT
Hi all,
We have implemented command history and auto completion in our product, and now I found this tracker.

What is the status of the proposed patch? It is available? I'd like to compare it with our work, and, if is it useful, we could try to contribute.

Best regards,
Stefano
Comment 3 Marc Khouzam CLA 2012-08-22 08:35:39 EDT
(In reply to comment #2)
> We have implemented command history and auto completion in our product

Nice!

> What is the status of the proposed
> patch? It is available? I'd like to compare it with our work, and, if is it
> useful, we could try to contribute.

The current plan is to take a different approach and have GDB provide a separate CLI that Eclipse can hook to.  That way, all intelligent console features will be handled by GDB but available to Eclipse.

You can follow the discussion here:
http://sourceware.org/ml/gdb-patches/2012-07/msg00525.html

I'm hoping that such an approach will provide more than command-history and auto-completion.  I'm thinking of:
 Readline features (in-line editing of commands)
 Repeat last command
 Smart Prompt
 Queries

This would of course only work using a GDB that supports this new feature.

Your contribution would still be useful for older GDBs but also as a solution until that other one is available (which is not garanteed).
Comment 4 Marc Khouzam CLA 2016-03-06 09:53:26 EST
We're making progress on a full console.  A new patch has been posted for GDB:
https://sourceware.org/ml/gdb-patches/2016-02/msg00067.html

I will provide a CDT patch using that GDB support.
Comment 5 Marc Khouzam CLA 2016-06-29 13:10:33 EDT
(In reply to Marc Khouzam from comment #4)
> We're making progress on a full console.  A new patch has been posted for
> GDB:
> https://sourceware.org/ml/gdb-patches/2016-02/msg00067.html

The GDB support has been committed to GDB's master branch:
https://sourceware.org/ml/gdb-patches/2016-06/msg00345.html

We are continuing the work in CDT as part of:
https://git.eclipse.org/r/#/c/62920/
Comment 6 Marc Khouzam CLA 2016-08-04 08:52:57 EDT
I have posted a cleaned-up version of the first part of this solution at
https://git.eclipse.org/r/#/c/62920/

This version puts the full GDB console in the existing Console view.

Review https://git.eclipse.org/r/#/c/77986/ moves the full GDB console to its own view.  The patch currently works but needs cleanup.
Comment 7 Marc Khouzam CLA 2016-08-04 09:55:13 EDT
Note that in 
https://git.eclipse.org/r/#/c/62920/25/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend_7_12.java

I've explicitly disabled the new console for Windows (see GDBBackend_7_12#isFullGdbConsoleSupported()).

It would be nice if someone looked into it to see what is needed to make it work.

The problem to fix is most probably in CDT's PTY support for Windows.
Specifically, when the new GDBBackend_7_12#createPty() calls PTY#validateSlaveName(), the method throws an exception on Windows.  That would be the starting point for an investigation.
Comment 8 Eclipse Genie CLA 2016-08-24 10:13:43 EDT
New Gerrit change created: https://git.eclipse.org/r/79632
Comment 9 Eclipse Genie CLA 2016-08-29 18:13:39 EDT
New Gerrit change created: https://git.eclipse.org/r/79977
Comment 10 Eclipse Genie CLA 2016-09-01 09:41:14 EDT
New Gerrit change created: https://git.eclipse.org/r/80220
Comment 11 Eclipse Genie CLA 2016-09-07 11:07:24 EDT
New Gerrit change created: https://git.eclipse.org/r/80599
Comment 12 Eclipse Genie CLA 2016-09-07 14:22:44 EDT
New Gerrit change created: https://git.eclipse.org/r/80620
Comment 19 Eclipse Genie CLA 2016-09-08 21:12:59 EDT
New Gerrit change created: https://git.eclipse.org/r/80745
Comment 20 Eclipse Genie CLA 2016-09-08 21:50:23 EDT
New Gerrit change created: https://git.eclipse.org/r/80746
Comment 21 Eclipse Genie CLA 2016-09-13 07:56:46 EDT
New Gerrit change created: https://git.eclipse.org/r/80989
Comment 22 Eclipse Genie CLA 2016-09-13 09:30:23 EDT
New Gerrit change created: https://git.eclipse.org/r/80996
Comment 27 Eclipse Genie CLA 2016-09-14 16:36:30 EDT
New Gerrit change created: https://git.eclipse.org/r/81134
Comment 28 Eclipse Genie CLA 2016-09-14 17:58:37 EDT
New Gerrit change created: https://git.eclipse.org/r/81138
Comment 29 Eclipse Genie CLA 2016-09-15 08:57:33 EDT
New Gerrit change created: https://git.eclipse.org/r/81165
Comment 30 Eclipse Genie CLA 2016-09-19 21:08:17 EDT
New Gerrit change created: https://git.eclipse.org/r/81403
Comment 31 Eclipse Genie CLA 2016-09-22 11:19:52 EDT
New Gerrit change created: https://git.eclipse.org/r/81709
Comment 33 Eclipse Genie CLA 2016-10-03 17:30:30 EDT
New Gerrit change created: https://git.eclipse.org/r/82400
Comment 34 Eclipse Genie CLA 2016-10-06 16:42:34 EDT
New Gerrit change created: https://git.eclipse.org/r/82675
Comment 35 Eclipse Genie CLA 2016-10-20 14:15:47 EDT
New Gerrit change created: https://git.eclipse.org/r/83628
Comment 36 Marc Khouzam CLA 2016-10-20 15:08:03 EDT
(In reply to Eclipse Genie from comment #35)
> New Gerrit change created: https://git.eclipse.org/r/83628

This was a mistake and was abandoned.
Comment 42 Eclipse Genie CLA 2016-11-02 17:33:12 EDT
New Gerrit change created: https://git.eclipse.org/r/84382
Comment 43 Eclipse Genie CLA 2016-11-13 01:30:03 EST
New Gerrit change created: https://git.eclipse.org/r/84935
Comment 44 Eclipse Genie CLA 2016-11-15 09:21:22 EST
New Gerrit change created: https://git.eclipse.org/r/85057
Comment 45 Eclipse Genie CLA 2016-11-15 09:21:22 EST
New Gerrit change created: https://git.eclipse.org/r/85057
Comment 46 Eclipse Genie CLA 2016-11-15 09:21:22 EST
New Gerrit change created: https://git.eclipse.org/r/85057
Comment 47 Eclipse Genie CLA 2016-11-15 10:13:27 EST
New Gerrit change created: https://git.eclipse.org/r/85063
Comment 52 Eclipse Genie CLA 2016-12-13 14:58:33 EST
New Gerrit change created: https://git.eclipse.org/r/87079
Comment 53 Eclipse Genie CLA 2016-12-21 22:35:45 EST
New Gerrit change created: https://git.eclipse.org/r/87602
Comment 54 Eclipse Genie CLA 2016-12-21 22:35:53 EST
New Gerrit change created: https://git.eclipse.org/r/87601
Comment 55 Eclipse Genie CLA 2016-12-21 22:35:57 EST
New Gerrit change created: https://git.eclipse.org/r/87600
Comment 56 Jonah Graham CLA 2017-01-03 18:24:18 EST
*** Bug 283661 has been marked as a duplicate of this bug. ***
Comment 61 Marc Khouzam CLA 2017-01-19 16:07:42 EST
The lion-share of this feature was released in 9.2.
Some improvements are being contributed for 9.3.
From now one let's use new bugs for any improvements.