Skip to content
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

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

Closed
ehuss opened this issue May 6, 2023 · 1 comment · Fixed by #111641
Closed

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

ehuss opened this issue May 6, 2023 · 1 comment · Fixed by #111641
Assignees
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. F-debugger_visualizer `#![feature(debugger_visualizer)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-debugging Working group: Bad Rust debugging experiences

Comments

@ehuss
Copy link
Contributor

ehuss commented May 6, 2023

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
@ehuss ehuss added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. F-debugger_visualizer `#![feature(debugger_visualizer)]` WG-debugging Working group: Bad Rust debugging experiences labels May 6, 2023
@michaelwoerister michaelwoerister self-assigned this May 11, 2023
@michaelwoerister
Copy link
Member

I'm wondering why this doesn't ICE like #111295? Maybe it does ICE consistently when compiling with -Zincremental-verify-ich?

@bors bors closed this as completed in 17a6810 May 19, 2023
oli-obk pushed a commit to oli-obk/miri that referenced this issue May 23, 2023
…=cjgillot

Fix dependency tracking for debugger visualizers

This PR fixes dependency tracking for debugger visualizer files by changing the `debugger_visualizers` query to an `eval_always` query that scans the AST while it is still available. This way the set of visualizer files is already available when dep-info is emitted. Since the query is turned into an `eval_always` query, dependency tracking will now reliably detect changes to the visualizer script files themselves.

TODO:
 - [x] perf.rlo
 - [x] Needs a bit more documentation in some places
 - [x] Needs regression test for the incr. comp. case

Fixes rust-lang/rust#111226
Fixes rust-lang/rust#111227
Fixes rust-lang/rust#111295

r? `@wesleywiser`
cc `@gibbyfree`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. F-debugger_visualizer `#![feature(debugger_visualizer)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-debugging Working group: Bad Rust debugging experiences
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants