Skip to content

Commit

Permalink
terminal updates; dashboard rewrite; use tailwind css; other updates (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Chad Smith authored Aug 23, 2020
1 parent ed2a1a1 commit ad576ad
Show file tree
Hide file tree
Showing 94 changed files with 7,087 additions and 3,698 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 88
ignore = E501, E203, W503 # line length, whitespace before ':', line break before binary operator
ignore = E501, E203, W503, E402, E231 # line length, whitespace before ':', line break before binary operator, module level import not at top of file
8 changes: 4 additions & 4 deletions .github/workflows/build_executable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest]
python-version: [3.8]
include:
- os: ubuntu-latest
buildname: linux
- os: windows-latest
buildname: windows
# - os: windows-latest
# buildname: windows
- os: macos-latest
buildname: mac
steps:
Expand All @@ -35,7 +35,7 @@ jobs:
run: |
nox --non-interactive --session build_executable_${{ matrix.buildname }}
- name: Upload ${{ matrix.buildname }} executable
if: github.ref == 'refs/heads/master'
# if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v1
with:
name: gdbgui_${{ matrix.buildname }}
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ yarn-error.log
venv
.vscode
site
build.js
build.js.map
gdbgui/static/js/*
__pycache__
3 changes: 3 additions & 0 deletions .vulture_whitelist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_.sessions # unused attribute (noxfile.py:7)
_.reuse_existing_virtualenvs # unused attribute (noxfile.py:6)
_.secret_key # unused attribute (gdbgui/backend.py:104)
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# gdbgui release history

## development
**Breaking Changes**
* Removed support for Windows
* 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`.
* Removed `--rr` flag. Use `--gdb-cmd rr replay` instead.
* Removed deprecated and hidden `--hide-gdbgui-upgrades` argument. It will now raise an error.

**Additional Changes**
* 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.
* Updates to the dashboard
* Add ability to specify gdb command from the browser. This can now be accomplished from the dashboard.
* Removed gdbgui binaries from source control. They can now be downloaded as artifacts of [releases](https://github.com/cs01/gdbgui/releases).
* [documentation] Fix bug when generating md5 checksum for binary releases
* Remove "shutdown" button in UI


## 0.13.2.1
* No end user changes. This release builds the gdbgui executables with GitHub actions.
Expand Down
73 changes: 17 additions & 56 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Thanks for your interest in contributing to gdbgui!

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.

## Development Instructions
## Dependencies

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

You can install it with pipx (recommended):
```
Expand All @@ -15,72 +15,33 @@ or pip:
> pip install --user nox
```

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

gdbgui compiles JavaScript source code into a single .js file.

Note that `yarn` can be replaced with `npm`:

First install JavaScript dependencies:
```bash
yarn install
## Developing
Development can be done with one simple step:
```

To watch JavaScript files for changes and build non-optimized code for each change, use
```
yarn start
> nox -s develop
```
This will install all Python and JavaScript dependencies, and build and watch Python and JavaScript files for changes, automatically reloading as things are changed.

This is useful for iterating on changes.

To build once for production-optimized code, you can run
```
yarn build
```

### Step 2: Run Server
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.

## Running and Adding tests
```bash
git clone https://github.com/cs01/gdbgui
cd gdbgui
nox -s develop-3.7 # replace with desired Python version
source .nox/develop-3-7/bin/activate # replace with desired Python version
> nox
```

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

```bash
python -m gdbgui --debug
Python tests are in `gdbgui/tests`. They are run as part of the above command, but can be run with
```

The `--debug` flag:

1. Automatically reloads the server when it detects changes you've made
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.
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`


### Step 3: Make your changes

Open the browser to view gdbgui. Refresh the page as you make changes to JavaScript code.

!!! Note

Make sure you have caching turned off in your browser. In Chrome, for example, this is a setting in the developer console.

### Step 4: Run and Add tests

To continue, you must have nox installed.

```bash
nox
> nox -s python_tests
```

runs gdbgui unit tests.

If you have changed any Python code, add new tests to `gdbgui/tests/test_app.py` as necessary.

JavaScript tests are minimal, so you will have to manually excercise any code paths that may be affected.
JavaScript tests are in `gdbgui/src/js/tests`. They are run as part of the above command, but can be run with
```
> nox -s js_tests
```

## Documentation

Expand Down
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ include README.md
include LICENSE

graft gdbgui
# these files are built and must be included in distribution
# but shouldn't be included in git repository since they
# are generated
graft gdbgui/static/js

prune examples
prune downloads
Expand All @@ -16,6 +20,7 @@ exclude mypy.ini
exclude .eslintrc.json
exclude .coveragerc
exclude .flake8
exclude .vulture_whitelist.py
exclude .prettierrc.js
exclude jest.config.js
exclude make_executable.py
Expand All @@ -29,3 +34,5 @@ exclude yarn.lock
exclude noxfile.py
exclude CHANGELOG.md
exclude CONTRIBUTING.md
exclude postcss.config.js
exclude tailwind.config.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

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

<p align="center">
Expand Down
21 changes: 11 additions & 10 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,34 @@ gdbgui
set the inferior program, pass argument, set a breakpoint at main

```
gdbgui "./myprogram myarg -myflag"
gdbgui --args ./myprogram myarg -myflag
```

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

```
gdbgui --args ./myprogram myarg command -myflag
gdbgui "./myprogram myarg -myflag"
```

use gdb binary not on your $PATH

```
gdbgui -g build/mygdb
gdbgui --gdb-cmd build/mygdb
```

run on port 8080 instead of the default port
Pass arbitrary arguments directly to gdb when it is launched

```
gdbgui --port 8080
gdbgui --gdb-cmd="gdb -x gdbcmds.txt"
```

Pass arbitrary arguments directly to gdb when it is launched
run on port 8080 instead of the default port

```
gdbgui --gdb-args="-x gdbcmds.txt"
gdbgui --port 8080
```



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

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

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.
```
gdbgui --rr
gdbgui --gdb-cmd "rr replay"
```

Use recording other than the most recent one

```
gdbgui --rr RECORDED_DIRECTORY
gdbgui --gdb-cmd "rr replay RECORDED_DIRECTORY"
```

Don't automatically open the browser when launching
Expand Down
15 changes: 6 additions & 9 deletions docs/gettingstarted.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
Now that you have `gdbgui` installed, all you need to do is run
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`.

For more details, consult your compiler's documentation or a search engine.

Now that you have `gdbgui` installed and your program compiled with debug symbols, all you need to do is run
```
gdbgui
```

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

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

Expand Down Expand Up @@ -32,10 +36,3 @@ The following keyboard shortcuts are available when the focus is not in an input
* Up: u or up arrow
* Next Instruction: m
* Step Instruction: ,


## Debugging Faults

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.

![](https://raw.githubusercontent.com/cs01/gdbgui/master/screenshots/SIGSEV.png)
18 changes: 10 additions & 8 deletions docs/guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ Remember, these guides, like gdbgui, are **open source** and can be edited by yo
After downloading gdbgui, you can launch it like so:

* `gdbgui` (or whatever the binary name is, i.e. `gdbgui_0.10.0.0`)
* `gdbgui "./mybinary -myarg value -flag1 -flag2"` (note the quotes around the arguments)
* `gdbgui --args "./mybinary -myarg value -flag1 -flag2"` (note the quotes around the arguments)
* `gdbgui --args ./mybinary -myarg value -flag1 -flag2`

Make sure the program you want to debug was compiled with debug symbols. See the getting started section for more details.

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

Expand Down Expand Up @@ -42,9 +43,11 @@ cd myprog
cargo build
```

You can start debugging with a simple
You can start debugging with

`gdbgui target/debug/myprog`
```
gdbgui --args target/debug/myprog
```

There are a couple of small difficulties.

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

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

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

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

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

If the machine gdbgui is running on and the target being debugged have different architectures, make sure gdb is built properly. See []
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`).

## Remote Debugging Between Different Architectures

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

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

<p align="center">
Expand Down
2 changes: 2 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ instructions](http://andresabino.com/2015/04/14/codesign-gdb-on-mac-os-x-yosemit

### Windows Dependencies

Note that windows is only supported for gdbgui versions less than 0.14.

- [Python 3](https://www.python.org/downloads/windows/)
- gdb, make, gcc

Expand Down
9 changes: 3 additions & 6 deletions docs/screenshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/gdbgui2.png)

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

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

Expand All @@ -11,7 +11,7 @@ Next, Step, Return, Next Instruction, Step Instruction.

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

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.
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.
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/reverse_debugging.png)

## Stack/Threads
Expand All @@ -22,13 +22,10 @@ pointing and clicking.

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

## Send Signal to Inferior
## Send Signal to Inferior (debugged) Process
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.
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/send_signal.png)

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.
![image](https://github.com/cs01/gdbgui/raw/master/screenshots/SIGSEV.png)


## Source Code
View source, assembly, add breakpoints. All symbols used to compile the
Expand Down
Loading

0 comments on commit ad576ad

Please sign in to comment.