Skip to content

Merge from base #1

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

Merged
merged 5 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 24 additions & 28 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
{
"env": {
"browser": true,
"es6": true,
"jquery": true
"env": {
"browser": true,
"es6": true,
"jquery": true
},
"globals": {
"initial_data": true,
"module": true,
"_": true,
"moment": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"globals":{
"initial_data": true,
"module": true,
"_": true,
"moment": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"no-console": [
0
],
"react/jsx-uses-vars": 1
},
"parser": "babel-eslint"
"sourceType": "module"
},
"plugins": ["react"],
"rules": {
"no-console": [0],
"react/jsx-uses-vars": 1
},
"parser": "babel-eslint"
}
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__
21 changes: 21 additions & 0 deletions .vulture_whitelist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
_.sessions # unused attribute (noxfile.py:7)
_.reuse_existing_virtualenvs # unused attribute (noxfile.py:6)
_.secret_key # unused attribute (gdbgui/backend.py:104)
_.reuse_existing_virtualenvs # unused attribute (noxfile.py:6)
_.sessions # unused attribute (noxfile.py:7)
cover # unused function (noxfile.py:50)
lint # unused function (noxfile.py:78)
autoformat # unused function (noxfile.py:94)
docs # unused function (noxfile.py:103)
develop # unused function (noxfile.py:109)
serve # unused function (noxfile.py:118)
publish # unused function (noxfile.py:133)
watch_docs # unused function (noxfile.py:142)
build_executable_current_platform # unused function (noxfile.py:154)
build_executable_mac # unused function (noxfile.py:162)
build_executable_linux # unused function (noxfile.py:169)
build_executable_windows # unused function (noxfile.py:176)
on_connect # unused function (tests/test_backend.py:14)
monkeypatch # unused variable (tests/test_cli.py:23)
monkeypatch # unused variable (tests/test_cli.py:33)
monkeypatch # unused variable (tests/test_cli.py:43)
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# gdbgui release history

## development
## 0.14.0.1
* Hide "No registers." message

## 0.14.0.0
**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)
Loading