Skip to content

debugger_visualizer: does not update changes to GDB scripts with incremental #111295

Closed
@ehuss

Description

@ehuss

I tried this code:

foo.rs:

#![debugger_visualizer(gdb_script_file = "foo.py")]

fn main() {
    let x = 1;
    println!("breakpoint");
}

foo.py:

def lookup(val):
    print('hello!')

gdb.current_objfile().pretty_printers.append(lookup)
  1. Build the binary: rustc -Cincremental=incremental -g foo.rs
  2. Check the behavior:
    a. gdb -iex "add-auto-load-safe-path ." ./foo
    b. b foo.rs:5
    c. r
    d. p x
    e. See hello! printed.
  3. Modify foo.py and change hello to "hello world"
  4. Run rustc as in step 1.
  5. Run verification as in step 2.
  6. Notice that it still just says "hello".

I expected to see this happen: It should print "hello world".

Instead, this happened: Any changes to a gdb script are not picked up when rebuilding with incremental.

This is likely related to #111227.

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (f9a6b7158 2023-05-05)
binary: rustc
commit-hash: f9a6b71580cd53dd4491d9bb6400f7ee841d9c22
commit-date: 2023-05-05
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2

Metadata

Metadata

Labels

A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.F-debugger_visualizer`#![feature(debugger_visualizer)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-debuggingWorking group: Bad Rust debugging experiences

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions