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

Add type cache to debugger #2196

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

Add type cache to debugger #2196

wants to merge 9 commits into from

Conversation

Tiwalun
Copy link
Member

@Tiwalun Tiwalun commented Feb 17, 2024

Some initial work on trying to separate the type handling from the variable cache.

Still very much work in progress, not yet sure how to integrate this, and if it's even a good idea. (cc @bugadani and @noppej ) Most interesting file to look at right now is probably the type_info.rs one.

gitbutler-client and others added 8 commits February 15, 2024 18:55
This is an integration commit for the virtual branches that GitButler is tracking.

Due to GitButler managing multiple virtual branches, you cannot switch back and
forth between git branches and virtual branches easily. 

If you switch to another branch, GitButler will need to be reinitialized.
If you commit on this branch, GitButler will throw it away.

Here are the branches that are currently applied:
 - Add C unwind test (refs/gitbutler/add-c-unwind-test)
   - test.log
   - probe-rs/src/debug/unit_info.rs
   - probe-rs/tests/debug-unwind-tests/nRF5340_lang_c.elf
 - split-type-extraction (refs/gitbutler/split-type-extraction)
   branch head: e8b75cc972db7b6729f46306755022fbb4d622a1
   - probe-rs/src/debug/unit_info.rs
   - probe-rs/src/debug/type_info.rs
   - probe-rs/src/debug/mod.rs
   - probe-rs/src/debug/debug_info.rs
   - probe-rs/src/debug/variable.rs
   - probe-rs/src/debug/source_statement.rs
   - probe-rs/examples/read_ranges.rs
   - probe-rs/src/debug/snapshots/probe_rs__debug__debug_info__test__RP2040__full_unwind.snap
   - .vscode/launch.json
   - probe-rs/src/debug/snapshots/probe_rs__debug__debug_info__test__nRF52833_xxAA__full_unwind.snap
   - probe-rs/src/debug/variable_cache.rs
   - probe-rs/src/debug/language.rs
   - probe-rs/Cargo.toml
   - Cross.toml
   - probe-rs/src/bin/probe-rs/util/logging.rs
   - a.out
   - dbg_log.txt
   - perf.data.old
   - profile.json
   - perf.data

Your previous branch was: refs/heads/split-type-extraction

The sha for that commit was: 9059668cfb1e994cac3ebb73486d33d4b27a0f65

For more information about what we're doing here, check out our docs:
https://docs.gitbutler.com/features/virtual-branches/integration-branch
Copy link
Contributor

@bugadani bugadani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of us will have a hard time rebasing...

.vscode/launch.json Show resolved Hide resolved
probe-rs/src/bin/probe-rs/util/logging.rs Show resolved Hide resolved
probe-rs/src/debug/debug_info.rs Show resolved Hide resolved
Comment on lines +510 to +512
if (self.variable_node_type.is_deferred()
|| matches!(self.type_name, VariableType::Struct(_)))
&& self.type_name != VariableType::Struct("&str".to_string())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (self.variable_node_type.is_deferred()
|| matches!(self.type_name, VariableType::Struct(_)))
&& self.type_name != VariableType::Struct("&str".to_string())
if self.variable_node_type.is_deferred()
&& !matches!(self.type_name, VariableType::Struct(ref type_name) if type_name != "&str")

frame_info,
)?;

let resolve_children = name.starts_with("&str")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move these to some lang-specific function? Or at least could you add a todo to these to revisit later?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I've done this as part of #2199

@Tiwalun
Copy link
Member Author

Tiwalun commented Feb 18, 2024

One of us will have a hard time rebasing...

I don't mind rebasing this, the interesting work here is in the new file. Not really sure how I'll integrate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants