Skip to content

Spurious commands being executed in the binary #293

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

Closed
surmish opened this issue Sep 13, 2019 · 5 comments · Fixed by #346
Closed

Spurious commands being executed in the binary #293

surmish opened this issue Sep 13, 2019 · 5 comments · Fixed by #346

Comments

@surmish
Copy link

surmish commented Sep 13, 2019

Describe the bug
In the command prompt of the tool I am debugging (it uses a csh shell as its prompt), every time I run any command, some extra gdb related commands are executed along with it.

Screenshots

tool_prompt> Error: unknown command '1-thread-info'
tool_prompt> Error: unknown command '1-stack-list-variables'
tool_prompt> Error: unknown command '1-var-update'
tool_prompt> Error: unknown command '1-data-list-register-values'
tool_prompt> Error: unknown option '-break-list'

Please complete the following information:

  • OS: 2.6.32-754.11.1.el6.x86_64 Linux
  • gdbgui version: 0.13.2.0
  • gdb version: 8.3
  • browser: firefox 60.5.1
  • python packages:
    alabaster==0.7.12
    argcomplete==1.10.0
    attrs==19.1.0
    Babel==2.7.0
    certifi==2019.6.16
    chardet==3.0.4
    Click==7.0
    distro==1.4.0
    docutils==0.15.1
    docwriter==1.1.1
    Flask==0.12.4
    Flask-Compress==1.4.0
    Flask-SocketIO==2.9.6
    gdbgui==0.13.2.0
    gevent==1.4.0
    greenlet==0.4.15
    idna==2.8
    imagesize==1.1.0
    itsdangerous==1.1.0
    Jinja2==2.10.1
    livereload==2.6.1
    Markdown==3.1.1
    MarkupSafe==1.1.1
    meson==0.50.1
    mistune==0.8.4
    mkdocs==1.0.4
    mkdocs-material==4.0.2
    msgpack==0.6.1
    ninja==1.9.0
    packaging==19.1
    pycscope==1.2.1
    pygdbmi==0.9.0.2
    Pygments==2.3.1
    pymdown-extensions==6.0
    pynvim==0.3.2
    pyparsing==2.4.2
    python-engineio==3.9.3
    python-socketio==4.3.1
    pytz==2019.2
    PyYAML==5.1
    requests==2.22.0
    six==1.12.0
    snowballstemmer==1.9.1
    Sphinx==3.0.0.dev20190906
    sphinxcontrib-applehelp==1.0.1
    sphinxcontrib-devhelp==1.0.1
    sphinxcontrib-htmlhelp==1.0.2
    sphinxcontrib-jsmath==1.0.1
    sphinxcontrib-qthelp==1.0.2
    sphinxcontrib-serializinghtml==1.1.3
    tornado==6.0.3
    urllib3==1.25.3
    userpath==1.2.0
    Werkzeug==0.15.6
    xdot==1.1
@cs01
Copy link
Owner

cs01 commented Sep 13, 2019

Those commands are frequently automatically sent by gdbgui to refresh the UI. If the tool is gdb it should recognize those commands, and keep the UI in sync with gdb.

I don't know if you redacted the tool and replaced with tool_prompt, but the tool should accept "machine interface" syntax. With gdb, this is achieved with

gdb --interpreter=mi2

@surmish
Copy link
Author

surmish commented Sep 16, 2019

What is the right way to send the --interpreter=mi2 gdb argument to the gdbgui tool?

I am using gdb 8.3. The c++ binary I am debugging has a tcl interpreter in it.
(gdbgui -> gdb -> my_c_program -> tcl_interface_prompt)

Even something like pressing the tab key sends the complete command to the tcl prompt.

@cs01
Copy link
Owner

cs01 commented Sep 16, 2019

What is the right way to send the --interpreter=mi2 gdb argument to the gdbgui tool?

It's hard-coded in gdbgui's source code:

+ REQUIRED_GDB_FLAGS

I think the main problem here is that when gdbgui runs gdb as a subprocess, it does so in "non-interactive mode" because gdbgui is not using a pty. This works in most cases, but unfortunately running sub-interpreters like the one you have won't work. This is a deficiency in gdbgui and unfortunately it won't work for you use case until I change gdbgui to to use an interactive pty to launch gdb instead of launching gdb as a non-interactive subprocess.

@surmish
Copy link
Author

surmish commented Sep 16, 2019

Hmm okay. If this can be resolved it would be great. There aren't any other good gui debuggers around for gdb in linux. gdb-dashboard is what I've been using, which is fine for the most part, but scrolling through the source is not possible in the same window.

@cs01
Copy link
Owner

cs01 commented Sep 16, 2019

Thanks for the feedback. That is good motivation 😃 . I'll let you know if/when I add this.

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

Successfully merging a pull request may close this issue.

2 participants