https://github.com/spacewander/debugger-utils
Utils collection for extending gdb with python
https://github.com/spacewander/debugger-utils
Last synced: over 1 year ago
JSON representation
Utils collection for extending gdb with python
- Host: GitHub
- URL: https://github.com/spacewander/debugger-utils
- Owner: spacewander
- License: mit
- Created: 2016-05-19T08:37:35.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-15T04:58:16.000Z (about 10 years ago)
- Last Synced: 2025-03-28T15:04:35.772Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 66
- Watchers: 6
- Forks: 21
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Utilities for extending gdb with python
## Usage
1. Download `debugger-utils` to directory `X`
2. Put these to your `~/.gdbinit`:
```
python import sys; sys.path.append('$X/debugger-utils')
```
`$X` is where `debugger-utils` lies in.
3. `import gdb_utils` in your python script.
## Example
```python
# Create a gdb commands in hello.py
import gdb_utils
def hello(who, *args):
"""
Say hello.
"""
print('hello %s', who)
gdb_utils.define(hello)
#(gdb) so hello.py
#(gdb) hello 'world'
```
For more examples, see [example](./example).
## API
GDB commands:
- [x] break
- [x] clear
- [x] commands
- [x] delete
- [x] disable
- [x] define
- [x] enable
- [x] info
- [x] thread
- [x] thread_name
- [x] watch
Other API:
- [x] get_breakpoint
- [x] function
- [x] stop
- [x] register_pprinter
- [x] build_pprinter
- [x] globval
- [x] ty
For more info, see [API.md](./API.md).