Skip to content

Commit f39f798

Browse files
committed
terminal updates; dashboard rewrite; use tailwind css; other updates
1 parent ed2a1a1 commit f39f798

Some content is hidden

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

62 files changed

+4847
-3005
lines changed

.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__

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# gdbgui release history
22

33
## development
4+
**Breaking Changes**
5+
* Removed `cmd` positional argument from CLI. Use `--args` instead.
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"`.
7+
* Removed `--rr` flag. Use `--gdb-cmd rr replay` instead.
8+
9+
**Additional Changes**
10+
* 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.
11+
* Updates to the dashboard
12+
* Add ability to specify gdb command from the browser. This can now be accomplished from the dashboard.
413
* Removed gdbgui binaries from source control. They can now be downloaded as artifacts of [releases](https://github.com/cs01/gdbgui/releases).
514

615
## 0.13.2.1

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

+6
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
@@ -29,3 +33,5 @@ exclude yarn.lock
2933
exclude noxfile.py
3034
exclude CHANGELOG.md
3135
exclude CONTRIBUTING.md
36+
exclude postcss.config.js
37+
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

+7-11
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ 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 command -myflag
1818
```
1919

20-
alternate way to do the same thing (note the lack of quotes)
20+
use gdb binary not on your $PATH
2121

2222
```
23-
gdbgui --args ./myprogram myarg command -myflag
23+
gdbgui --gdb-cmd build/mygdb
2424
```
2525

26-
use gdb binary not on your $PATH
26+
Pass arbitrary arguments directly to gdb when it is launched
2727

2828
```
29-
gdbgui -g build/mygdb
29+
gdbgui --gdb-cmd="gdb -x gdbcmds.txt"
3030
```
3131

3232
run on port 8080 instead of the default port
@@ -35,11 +35,7 @@ run on port 8080 instead of the default port
3535
gdbgui --port 8080
3636
```
3737

38-
Pass arbitrary arguments directly to gdb when it is launched
3938

40-
```
41-
gdbgui --gdb-args="-x gdbcmds.txt"
42-
```
4339

4440
run on a server and host on 0.0.0.0. Accessible to the outside world as long as port 80 is not blocked.
4541

@@ -63,13 +59,13 @@ gdbgui -r --auth --key private.key --cert host.cert
6359

6460
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.
6561
```
66-
gdbgui --rr
62+
gdbgui --gdb-cmd "rr replay"
6763
```
6864

6965
Use recording other than the most recent one
7066

7167
```
72-
gdbgui --rr RECORDED_DIRECTORY
68+
gdbgui --gdb-cmd "rr replay RECORDED_DIRECTORY"
7369
```
7470

7571
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` or `rustc`, this means using `-g`. To disable most optimizations in gdcc `gcc` use the `-O0` flag.
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

+5-4
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,9 @@ 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+
`gdbgui --args target/debug/myprog`
4849

4950
There are a couple of small difficulties.
5051

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/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

examples/c/hello.c

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
#include <stdio.h>
22
#include <string.h>
3-
4-
void say_something(const char* str)
3+
void say_something(const char *str)
54
{
65
printf("%s\n", str);
76
}
87

9-
struct mystruct_t {
8+
struct mystruct_t
9+
{
1010
int value;
1111
char letter;
1212
char *string;
1313

14-
struct {
14+
struct
15+
{
1516
double dbl;
1617
} substruct; /* named sub-struct */
1718

18-
struct {
19+
struct
20+
{
1921
float fp;
2022
}; /* anonymous struct */
2123

@@ -27,8 +29,8 @@ struct mystruct_t {
2729
};
2830
};
2931

30-
31-
int main(int argc, char **argv) {
32+
int main(int argc, char **argv)
33+
{
3234
printf("Hello World\n");
3335

3436
int retval = 1;
@@ -46,11 +48,13 @@ int main(int argc, char **argv) {
4648
s.unionint = 0;
4749
s.uniondouble = 1.0;
4850

49-
for (int i = 0; i < 2; i++) {
51+
for (int i = 0; i < 2; i++)
52+
{
5053
printf("i is %d\n", i);
5154
}
5255

53-
if (!strcmp(s.string, "pass")) {
56+
if (!strcmp(s.string, "pass"))
57+
{
5458
retval = 0;
5559
}
5660

examples/c/input.c

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <stdio.h>
2+
#include <string.h>
3+
4+
int main(int argc, char **argv)
5+
{
6+
char name[20];
7+
printf("Hello. What's your name?\n");
8+
fgets(name, 20, stdin);
9+
printf("Hi there, %s", name);
10+
return 0;
11+
}

examples/c/makefile

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
GDBGUI=../../gdbgui/backend.py
1+
ROOT:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
22

33
hello: hello.c
44
gcc hello.c -o hello_c.a -std=c99 -g
5-
$(GDBGUI) hello_c.a
5+
@echo Run with gdbgui: gdbgui --args $(ROOT)/hello_c.a
6+
7+
input: input.c
8+
gcc input.c -o input.a -std=c99 -g
9+
@echo Run with gdbgui: gdbgui --args $(ROOT)/input.a
610

711
debug_segfault: debug_segfault.c
812
gcc debug_segfault.c -g -o debug_segfault.a -std=c99
9-
$(GDBGUI) debug_segfault.a
13+
@echo Run with gdbgui: gdbgui --args $(ROOT)/debug_segfault.a
1014

1115
threads: threads.c
1216
gcc threads.c -o threads.a -std=c99 -lpthread -g
13-
$(GDBGUI) threads.a
17+
@echo Run with gdbgui: gdbgui --args $(ROOT)/threads.a
1418

1519
sleeper: sleeper.c
1620
gcc sleeper.c -o sleeper.a -std=c99 -g
17-
$(GDBGUI) sleeper.a
21+
@echo Run with gdbgui: gdbgui --args $(ROOT)/sleeper.a

0 commit comments

Comments
 (0)