cs01 / gdbgui
- вторник, 31 октября 2017 г. в 03:17:20
Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser.
A modern, browser-based frontend to gdb (gnu debugger). Add breakpoints, view stack traces, and more in C, C++, Go, and Rust! Simply run gdbgui
from the terminal and a new tab will open in your browser. See SCREENSHOTS.md, or check out the YouTube channel or Help page for demos and tutorials.
If you are using gdbgui in a commercial setting, consider donating to the project.
Python versions: 2.7, 3.4, 3.5, 3.6, 3.6-dev, 3.7-dev, pypy
Operating systems: Ubuntu 14.04+, macOS, Windows (in cygwin)
Browsers: Chrome, Firefox
gdb: 7.7+
Languages: C, C++, golang, rust (any language supported by gdb itself)
pip install gdbgui --upgrade
See INSTALLATION for detailed instructions.
gdbgui
A new tab in your browser will open with gdbgui in it. If a browser tab did not open, navigate to the ip/port that gdbgui is being served on (i.e. http://localhost:5000
).
For a list of gdbgui
arguments, see the Arguments
section below or type gdbgui --help
.
Because gdbgui is a server, it naturally allows you to debug programs running on other computers.
ssh
into the computer with the program that needs to be debugged.gdbgui -r
on the remote machine (this will serve publicly so beware of security here)After opening the webpage in a supported browser:
-g
flag.Load the Binary and Args
. The program and symbols will load, but will not begin running. A breakpoint will be added to main automatically (this can be changed in settings).main
will display if the program was compiled with debug symbols (i.e. -g
).Run
button, which is on the top right and looks like a circular arrow.Next
, Step
, Continue
, etc. as desired. These are also on the top right.command
: (Optional) The quote-enclosed executable and arguments to run in gdb. This is a way to script the intial loading of the inferior program you wish to debug. For example gdbgui "./mybinary -myarg value -flag1 -flag2"
(note the quotes around the executable and arguments!). Executables and arguments can also be input through the browser interface after launching (no quotes required there).-h, --help | show this help message and exit |
-p PORT, --port PORT | |
The port on which gdbgui will be hosted. Defaults to 5000 | |
--host HOST | The host ip address on which gdbgui serve. Defaults to 127.0.0.1 |
-r, --remote | Shortcut to sets host to 0.0.0.0 and suppress browser from opening. This allows remote access to gdbgui and is useful when running on a remote machine that you want to view/debug from your local browser, or let someone else debug your application remotely. |
-g GDB, --gdb GDB | |
Path to gdb or lldb executable. Defaults to gdb. lldb support is experimental. | |
--lldb | Use lldb commands (experimental) |
-v, --version | Print version |
--hide_gdbgui_upgrades | |
Hide messages regarding newer version of gdbgui. Defaults to False. | |
--debug | The debug flag of this Flask application. Pass this flag when debugging gdbgui itself to automatically reload the server when changes are detected |
-n, --no_browser | |
By default, the browser will open with gdb gui. Pass this flag so the browser does not open. | |
-x GDB_CMD_FILE, --gdb_cmd_file GDB_CMD_FILE | |
Execute GDB commands from file. |
Example code and makefiles for C, C++, go, and rust, that build and launch gdb.
See the examples folder.
gdbgui
settings can be accessed by clicking the gear icon in the top right of the frontend. Most of these settings persist between sessions for a given url and port.
The following keyboard shortcuts are available when the focus is not in an input field. They have the same effect as when the button is pressed.
If your program exits unexpectedly from something like a SEGFAULT, gdbgui
displays a button in the console to re-enter the state the program was in when it exited. This allows you to inspect the stack, the line on which the program exited, memory, variables, registers, etc.
See SCREENSHOTS.md for more.
GNU GPLv3
PyPI and this github page are the only official sources of gdbgui.
The main components of gdbgui are
backend.py
: The backend consists of a single Python file, which
makes use of pygdbmi to
interact with a gdb subprocess, and
Flask to set up url routing, websockets,
and http responses.gdbgui.pug
: HTML file that defines the frontendgdbgui.css
: css stylesheetSee CONTRIBUTING
gdbgui
would not be possible without the work of several amazing open source libraries
JavaScript
Python
and contributions from the community. Thank you!