Skip to content

Commit 629472d

Browse files
committed
Add --gdb-path arg
* Update README
1 parent b982ed9 commit 629472d

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
- Add `--gdb-path` to override gdb executated [#101](https://github.com/wcampbell0x2a/heretek/pull/101)
89

910
## [0.2.0] - 2025-01-02
1011
- Remove `--local` argument, `heretek` now runs gdb locally by default [#96](https://github.com/wcampbell0x2a/heretek/pull/96)

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "heretek"
33
version = "0.2.0"
44
edition = "2021"
5-
description = "Yet Another GDB TUI"
5+
description = "GDB TUI Dashboard for the understanding of vast knowledge"
66
license = "MIT/Apache-2.0"
77
repository = "https://github.com/wcampbell0x2a/heretek"
88

Diff for: README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[<img alt="crates.io" src="https://img.shields.io/crates/v/heretek.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/heretek)
44
[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/wcampbell0x2a/heretek/main.yml?branch=master&style=for-the-badge" height="20">](https://github.com/wcampbell0x2a/heretek/actions?query=branch%3Amaster)
55

6-
Yet Another gdb TUI. Connect remotely with gdb when you don't have a working `gdbserver`, and show a tui inspired by `gef`.
6+
GDB TUI Dashboard. Connect remotely with gdb when you don't have a working `gdbserver`, and show tui inspired by `gef`.
77

88
* **No gdbserver requirements**: Many vendors ship invalid `gdbserver` binaries, this works on remote targets with just `gdb`, `nc`, `cat`, and `mkfifo`.
99
* **No python requirements**: Many vendors ship `gdb` without python support.
@@ -21,11 +21,14 @@ Or download from [github releases](https://github.com/wcampbell0x2a/heretek/rele
2121

2222
## Usage
2323
```console
24-
Yet Another GDB TUI
24+
GDB TUI Dashboard for the understanding of vast knowledge
2525

2626
Usage: heretek [OPTIONS]
2727

2828
Options:
29+
--gdb-path <GDB_PATH>
30+
Override gdb executable path
31+
2932
-r, --remote <REMOTE>
3033
Connect to nc session
3134

Diff for: src/main.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ impl<T> LimitedBuffer<T> {
8080
#[derive(Parser, Debug, Clone, Default)]
8181
#[command(version, about, long_about = None)]
8282
struct Args {
83+
/// Override gdb executable path
84+
#[arg(long)]
85+
gdb_path: Option<String>,
86+
8387
/// Connect to nc session
8488
///
8589
/// `mkfifo gdb_pipe; cat gdb_pipe | gdb --interpreter=mi | nc -l -p 12345 > gdb_pipe`
@@ -184,7 +188,7 @@ impl App {
184188
let (reader, gdb_stdin): (BufReader<Box<dyn Read + Send>>, Arc<Mutex<dyn Write + Send>>) =
185189
match &args.remote {
186190
None => {
187-
let mut gdb_process = Command::new("gdb")
191+
let mut gdb_process = Command::new(args.gdb_path.unwrap_or("gdb".to_owned()))
188192
.args(["--interpreter=mi2", "--quiet", "-nx"])
189193
.stdin(Stdio::piped())
190194
.stdout(Stdio::piped())

0 commit comments

Comments
 (0)