Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "true" GDB console #30

Closed
simark opened this issue Nov 27, 2018 · 12 comments
Closed

Support "true" GDB console #30

simark opened this issue Nov 27, 2018 · 12 comments
Labels
enhancement New feature or request

Comments

@simark
Copy link
Contributor

simark commented Nov 27, 2018

Some improvements were made to CDT and GDB to allow having a proper GDB console in CDT. We need to have a way to do this with the adapter too.

IIRC, CDT creates a PTY, spawns GDB in CLI mode using this PTY for its stdin/stdout/stderr. But it also creates a second PTY for MI. When spawning GDB, is passes -ex "new-ui mi /dev/pts/<id>" and uses this as the MI channel.

@dschaefer
Copy link
Contributor

+1 :). In vscode we have the debug console working but it's the old style console that we had in Eclipse with the input line. Having a full pty like console would be awesome.

@paul-marechal
Copy link
Member

Did this commit resolve issue?

@noneghost
Copy link
Contributor

noneghost commented Jan 31, 2023

Some improvements were made to CDT and GDB to allow having a proper GDB console in CDT. We need to have a way to do this with the adapter too.

IIRC, CDT creates a PTY, spawns GDB in CLI mode using this PTY for its stdin/stdout/stderr. But it also creates a second PTY for MI. When spawning GDB, is passes -ex "new-ui mi /dev/pts/<id>" and uses this as the MI channel.

why no use DEBUG CONSOLE user input edit send gdb commands?

@jonahgraham jonahgraham added the enhancement New feature or request label Jan 31, 2023
@jonahgraham
Copy link
Contributor

Coincidentally I am going through all the old bugs to see what is relevant, this one certainly still is.

I am curious as to the current state of this. Not sure where this work was left off a few years ago. This is a very desirable feature.

why no use DEBUG CONSOLE user input edit send gdb commands?

A full GDB console using new-ui cli where possible would give best user experience as you get 100% features of GDB at command line. As a fallback on GDB/OS where that doesn't work, using the Debug Console to do -interpreter-exec makes sense too, but the Debug console in VS Code has functionality that is somewhere between the two, e.g. it understands structured data.

@jonahgraham
Copy link
Contributor

Reading through the comments on #47, especially #47 (comment) it seems like this may already be complete. I haven't really used it, so we should make sure it still works and is documented and then close this off.

@GitMensch
Copy link

I've just tried to use the debug console to enter GDB commands, is this expected to work (like it is with all other GDB frontends I've seen)?

show version
Evaluation of expression without frameId is not supported.
From client: evaluate({"expression":"show version","context":"repl"})
To client: {"seq":0,"type":"response","request_seq":9,"command":"evaluate","success":false,"body":{"result":"Error: could not evaluate expression","variablesReference":0,"error":{"id":1,"format":"Evaluation of expression without frameId is not supported.","showUser":true}},"message":"Evaluation of expression without frameId is not supported."}

@jonahgraham
Copy link
Contributor

I've just tried to use the debug console to enter GDB commands, is this expected to work (like it is with all other GDB frontends I've seen)?

No - it isn't.

What it is supposed to do is this:

image

And there is an enhancement request for auto complete of those variables here eclipse-cdt-cloud/cdt-gdb-vscode#75


What this issue covers is using new-ui to have a CLI in the terminal view. Ericsson folks have done it IIUC, but I have never tried it out. (But I am about to right now!)

@jonahgraham
Copy link
Contributor

Setting "openGdbConsole": true in the launch.json does indeed open a terminal as expected. I get the following. I think that means this issue is done.

image

@GitMensch
Copy link

ok, so we'd ideally have:

  • debug console:
    • shows output like communication (especially when running verbose
    • option to enter expressions to be resolved (exists, seems to work)
  • option to enter GDB commands (currently done via extra terminal and possibly "unix-only")
  • application console for stdout and stdin (missing?)

@jonahgraham
Copy link
Contributor

  • option to enter GDB commands (currently done via extra terminal and possibly "unix-only")

yes, it is unix-only, but since that code was written the work has been done on GDB side to support new-ui on Windows hosts.

  • application console for stdout and stdin (missing?)

Yes, see #161

@GitMensch
Copy link

  • option to enter GDB commands (currently done via extra terminal and possibly "unix-only")

yes, it is unix-only, but since that code was written the work has been done on GDB side to support new-ui on Windows hosts.

Can you please link to an issue to test + handle that in cdt-gdb-adapter, too?

@jonahgraham
Copy link
Contributor

  • option to enter GDB commands (currently done via extra terminal and possibly "unix-only")

yes, it is unix-only, but since that code was written the work has been done on GDB side to support new-ui on Windows hosts.

Can you please link to an issue to test + handle that in cdt-gdb-adapter, too?

#240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants