Skip to content

Commit ad576ad

Browse files
author
Chad Smith
authored
terminal updates; dashboard rewrite; use tailwind css; other updates (#346)
1 parent ed2a1a1 commit ad576ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+7087
-3698
lines changed

.flake8

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
22
max-line-length = 88
3-
ignore = E501, E203, W503 # line length, whitespace before ':', line break before binary operator
3+
ignore = E501, E203, W503, E402, E231 # line length, whitespace before ':', line break before binary operator, module level import not at top of file

.github/workflows/build_executable.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
os: [ubuntu-latest, windows-latest, macos-latest]
15+
os: [ubuntu-latest, macos-latest]
1616
python-version: [3.8]
1717
include:
1818
- os: ubuntu-latest
1919
buildname: linux
20-
- os: windows-latest
21-
buildname: windows
20+
# - os: windows-latest
21+
# buildname: windows
2222
- os: macos-latest
2323
buildname: mac
2424
steps:
@@ -35,7 +35,7 @@ jobs:
3535
run: |
3636
nox --non-interactive --session build_executable_${{ matrix.buildname }}
3737
- name: Upload ${{ matrix.buildname }} executable
38-
if: github.ref == 'refs/heads/master'
38+
# if: github.ref == 'refs/heads/master'
3939
uses: actions/upload-artifact@v1
4040
with:
4141
name: gdbgui_${{ matrix.buildname }}

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ yarn-error.log
1414
venv
1515
.vscode
1616
site
17-
build.js
18-
build.js.map
17+
gdbgui/static/js/*
1918
__pycache__

.vulture_whitelist.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_.sessions # unused attribute (noxfile.py:7)
2+
_.reuse_existing_virtualenvs # unused attribute (noxfile.py:6)
3+
_.secret_key # unused attribute (gdbgui/backend.py:104)

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
# gdbgui release history
22

33
## development
4+
**Breaking Changes**
5+
* Removed support for Windows
6+
* Replaced `--gdb` flag with `--gdb-cmd`. The `--gdb-cmd` argument specifies the gdb executable as well as all arguments you wish to pass to gdb at startup, for example `--gdb-cmd "gdb -nx"`. The existing `-g` argument is an alias for `--gdb-cmd`.
7+
* Removed `--rr` flag. Use `--gdb-cmd rr replay` instead.
8+
* Removed deprecated and hidden `--hide-gdbgui-upgrades` argument. It will now raise an error.
9+
10+
**Additional Changes**
11+
* Replaced single terminal on frontend with three terminals: an interactive xterm terminal running gdb, a gdbgui console for diagnostic messages, and a terminal connected to the inferior application being debugged.
12+
* Updates to the dashboard
13+
* Add ability to specify gdb command from the browser. This can now be accomplished from the dashboard.
414
* Removed gdbgui binaries from source control. They can now be downloaded as artifacts of [releases](https://github.com/cs01/gdbgui/releases).
15+
* [documentation] Fix bug when generating md5 checksum for binary releases
16+
* Remove "shutdown" button in UI
17+
518

619
## 0.13.2.1
720
* No end user changes. This release builds the gdbgui executables with GitHub actions.

CONTRIBUTING.md

+17-56
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Thanks for your interest in contributing to gdbgui!
22

33
If your change is small, go ahead and submit a pull request. If it is substantial, create a GitHub issue to discuss it before making the change.
44

5-
## Development Instructions
5+
## Dependencies
66

7-
gdbgui uses [nox](https://github.com/theacodes/nox) to automate various tasks. You will need it installed on your system before continuing.
7+
1.) [nox](https://github.com/theacodes/nox) is used to automate various tasks. You will need it installed on your system before continuing.
88

99
You can install it with pipx (recommended):
1010
```
@@ -15,72 +15,33 @@ or pip:
1515
> pip install --user nox
1616
```
1717

18-
### Step 1: Compile JavaScript Code
18+
2.) [yarn](https://yarnpkg.com/) is used for managing JavaScript files
1919

20-
gdbgui compiles JavaScript source code into a single .js file.
21-
22-
Note that `yarn` can be replaced with `npm`:
23-
24-
First install JavaScript dependencies:
25-
```bash
26-
yarn install
20+
## Developing
21+
Development can be done with one simple step:
2722
```
28-
29-
To watch JavaScript files for changes and build non-optimized code for each change, use
30-
```
31-
yarn start
23+
> nox -s develop
3224
```
25+
This will install all Python and JavaScript dependencies, and build and watch Python and JavaScript files for changes, automatically reloading as things are changed.
3326

34-
This is useful for iterating on changes.
35-
36-
To build once for production-optimized code, you can run
37-
```
38-
yarn build
39-
```
40-
41-
### Step 2: Run Server
27+
Make sure you [turn your cache off](https://www.technipages.com/google-chrome-how-to-completely-disable-cache) so that changes made locally are reflected in the page.
4228

29+
## Running and Adding tests
4330
```bash
44-
git clone https://github.com/cs01/gdbgui
45-
cd gdbgui
46-
nox -s develop-3.7 # replace with desired Python version
47-
source .nox/develop-3-7/bin/activate # replace with desired Python version
31+
> nox
4832
```
4933

50-
You are now in a virtual environment with gdbgui's dependencies installed. When finished, type `deactivate` to leave the virtual environment.
34+
runs all applicable tests and linting.
5135

52-
```bash
53-
python -m gdbgui --debug
36+
Python tests are in `gdbgui/tests`. They are run as part of the above command, but can be run with
5437
```
55-
56-
The `--debug` flag:
57-
58-
1. Automatically reloads the server when it detects changes you've made
59-
1. Adds a new component at the bottom of the right sidebar called "gdb machine interface output" that displays the raw gdb mi output to help you debug.
60-
1. Displays all changes to state data in the browser's developer console, such as `rendered_source_file_fullname null -> /home/chad/git/gdbgui/examples/hello.c`
61-
62-
63-
### Step 3: Make your changes
64-
65-
Open the browser to view gdbgui. Refresh the page as you make changes to JavaScript code.
66-
67-
!!! Note
68-
69-
Make sure you have caching turned off in your browser. In Chrome, for example, this is a setting in the developer console.
70-
71-
### Step 4: Run and Add tests
72-
73-
To continue, you must have nox installed.
74-
75-
```bash
76-
nox
38+
> nox -s python_tests
7739
```
7840

79-
runs gdbgui unit tests.
80-
81-
If you have changed any Python code, add new tests to `gdbgui/tests/test_app.py` as necessary.
82-
83-
JavaScript tests are minimal, so you will have to manually excercise any code paths that may be affected.
41+
JavaScript tests are in `gdbgui/src/js/tests`. They are run as part of the above command, but can be run with
42+
```
43+
> nox -s js_tests
44+
```
8445

8546
## Documentation
8647

MANIFEST.in

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ include README.md
22
include LICENSE
33

44
graft gdbgui
5+
# these files are built and must be included in distribution
6+
# but shouldn't be included in git repository since they
7+
# are generated
8+
graft gdbgui/static/js
59

610
prune examples
711
prune downloads
@@ -16,6 +20,7 @@ exclude mypy.ini
1620
exclude .eslintrc.json
1721
exclude .coveragerc
1822
exclude .flake8
23+
exclude .vulture_whitelist.py
1924
exclude .prettierrc.js
2025
exclude jest.config.js
2126
exclude make_executable.py
@@ -29,3 +34,5 @@ exclude yarn.lock
2934
exclude noxfile.py
3035
exclude CHANGELOG.md
3136
exclude CONTRIBUTING.md
37+
exclude postcss.config.js
38+
exclude tailwind.config.js

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
<h3 align="center">
6-
A modern, browser-based frontend to gdb (gnu debugger)
6+
A browser-based frontend to gdb (gnu debugger)
77
</h3>
88

99
<p align="center">

docs/examples.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,34 @@ gdbgui
1414
set the inferior program, pass argument, set a breakpoint at main
1515

1616
```
17-
gdbgui "./myprogram myarg -myflag"
17+
gdbgui --args ./myprogram myarg -myflag
1818
```
1919

20-
alternate way to do the same thing (note the lack of quotes)
2120

2221
```
23-
gdbgui --args ./myprogram myarg command -myflag
22+
gdbgui "./myprogram myarg -myflag"
2423
```
2524

2625
use gdb binary not on your $PATH
2726

2827
```
29-
gdbgui -g build/mygdb
28+
gdbgui --gdb-cmd build/mygdb
3029
```
3130

32-
run on port 8080 instead of the default port
31+
Pass arbitrary arguments directly to gdb when it is launched
3332

3433
```
35-
gdbgui --port 8080
34+
gdbgui --gdb-cmd="gdb -x gdbcmds.txt"
3635
```
3736

38-
Pass arbitrary arguments directly to gdb when it is launched
37+
run on port 8080 instead of the default port
3938

4039
```
41-
gdbgui --gdb-args="-x gdbcmds.txt"
40+
gdbgui --port 8080
4241
```
4342

43+
44+
4445
run on a server and host on 0.0.0.0. Accessible to the outside world as long as port 80 is not blocked.
4546

4647
```
@@ -63,13 +64,13 @@ gdbgui -r --auth --key private.key --cert host.cert
6364

6465
Use Mozilla's [record and replay](https://rr-project.org) (rr) debugging supplement to gdb. rr lets your record a program (usually with a hard-to-reproduce bug in it), then deterministically replay it as many times as you want. You can even step forwards and backwards.
6566
```
66-
gdbgui --rr
67+
gdbgui --gdb-cmd "rr replay"
6768
```
6869

6970
Use recording other than the most recent one
7071

7172
```
72-
gdbgui --rr RECORDED_DIRECTORY
73+
gdbgui --gdb-cmd "rr replay RECORDED_DIRECTORY"
7374
```
7475

7576
Don't automatically open the browser when launching

docs/gettingstarted.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
Now that you have `gdbgui` installed, all you need to do is run
1+
Before running `gdbgui`, you should compile your program with debug symbols and a lower level of optimization, so code isn't optimized out before runtime. To include debug symbols with `gcc` use `-ggdb`, with `rustc` use `-g`. To disable most optimizations in `gcc` use the `-O0` flag, with `rustc` use `-O`.
2+
3+
For more details, consult your compiler's documentation or a search engine.
4+
5+
Now that you have `gdbgui` installed and your program compiled with debug symbols, all you need to do is run
26
```
37
gdbgui
48
```
59

6-
which will start gdbgui's server and open a new tab in your browser. That tab contains a fully functional frontend running `gdb`!
10+
This will start gdbgui's server and open a new tab in your browser. That tab contains a fully functional frontend running `gdb`!
711

812
You can see gdbgui in action on [YouTube](https://www.youtube.com/channel/UCUCOSclB97r9nd54NpXMV5A).
913

@@ -32,10 +36,3 @@ The following keyboard shortcuts are available when the focus is not in an input
3236
* Up: u or up arrow
3337
* Next Instruction: m
3438
* Step Instruction: ,
35-
36-
37-
## Debugging Faults
38-
39-
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.
40-
41-
![](https://raw.githubusercontent.com/cs01/gdbgui/master/screenshots/SIGSEV.png)

docs/guides.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ Remember, these guides, like gdbgui, are **open source** and can be edited by yo
77
After downloading gdbgui, you can launch it like so:
88

99
* `gdbgui` (or whatever the binary name is, i.e. `gdbgui_0.10.0.0`)
10-
* `gdbgui "./mybinary -myarg value -flag1 -flag2"` (note the quotes around the arguments)
11-
* `gdbgui --args "./mybinary -myarg value -flag1 -flag2"` (note the quotes around the arguments)
10+
* `gdbgui --args ./mybinary -myarg value -flag1 -flag2`
11+
12+
Make sure the program you want to debug was compiled with debug symbols. See the getting started section for more details.
1213

1314
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).
1415

@@ -42,9 +43,11 @@ cd myprog
4243
cargo build
4344
```
4445

45-
You can start debugging with a simple
46+
You can start debugging with
4647

47-
`gdbgui target/debug/myprog`
48+
```
49+
gdbgui --args target/debug/myprog
50+
```
4851

4952
There are a couple of small difficulties.
5053

@@ -72,11 +75,10 @@ You can load this into gdb with the following command (changed as appropriate):
7275
symbol-file /Users/user/git/gdbgui/examples/rust/target/debug/deps/hello-486956f9dde465e5
7376
```
7477

75-
2.) The GDB pretty-printing macros that Rust ships with. GDB can't find these by default,
76-
which makes it print the message
78+
2.) The GDB pretty-printing macros that Rust ships with. GDB can't find these by default, which makes it print the message
7779

7880
```
79-
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts of file /home/phil/temp/myprog/target/debug/myprog.
81+
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts of file /home/temp/myprog/target/debug/myprog.
8082
Use `info auto-load python-scripts [REGEXP]' to list them.
8183
```
8284

@@ -106,7 +108,7 @@ Then you can launch `gdb` or `gdbgui` and connect to it. In `gdbgui`, use the dr
106108

107109
Read more at the [gdbserver homepage](https://sourceware.org/gdb/onlinedocs/gdb/Server.html).
108110

109-
If the machine gdbgui is running on and the target being debugged have different architectures, make sure gdb is built properly. See []
111+
If the machine gdbgui is running on and the target being debugged have different architectures, make sure gdb is built properly (see `Remote Debugging Between Different Architectures`).
110112

111113
## Remote Debugging Between Different Architectures
112114

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
<h3 align="center">
6-
A modern, browser-based frontend to gdb (gnu debugger)
6+
A browser-based frontend to gdb (gnu debugger)
77
</h3>
88

99
<p align="center">

docs/installation.md

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ instructions](http://andresabino.com/2015/04/14/codesign-gdb-on-mac-os-x-yosemit
9494

9595
### Windows Dependencies
9696

97+
Note that windows is only supported for gdbgui versions less than 0.14.
98+
9799
- [Python 3](https://www.python.org/downloads/windows/)
98100
- gdb, make, gcc
99101

docs/screenshots.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/gdbgui2.png)
33

44
Enter the binary and args just as you'd call them on the command line.
5-
Binary is restored when gdbgui is opened at a later time.
5+
The binary is restored when gdbgui is opened at a later time.
66

77
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/load_binary_and_args.png)
88

@@ -11,7 +11,7 @@ Next, Step, Return, Next Instruction, Step Instruction.
1111

1212
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/controls.png)
1313

14-
If using an Intel CPU and running Linux, gdbgui also works in conjunction with [rr](http://rr-project.org/) to let you debug in reverse.
14+
If the environment supports reverse debugging, such as when using an Intel CPU and running Linux and debugging with [rr](http://rr-project.org/), gdbgui allows you to debug in reverse.
1515
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/reverse_debugging.png)
1616

1717
## Stack/Threads
@@ -22,13 +22,10 @@ pointing and clicking.
2222

2323
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/stack_and_threads.png)
2424

25-
## Send Signal to Inferior
25+
## Send Signal to Inferior (debugged) Process
2626
Choose from any signal your OS supports to send to the inferior. For example, to mock `CTRL+C` in plain gdb, you can send `SIGINT` to interrupt the inferior process. If the inferior process is hung for some reason, you can send `SIGKILL`, etc.
2727
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/send_signal.png)
2828

29-
Signals are also recognized by `gdbgui`, and a button is presented to let you step back into the program and inspect the program's state in case it exits unexpectedly.
30-
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/SIGSEV.png)
31-
3229

3330
## Source Code
3431
View source, assembly, add breakpoints. All symbols used to compile the

0 commit comments

Comments
 (0)