Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add num_children method to some gdb pretty-printers#148541

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
tromey wants to merge1 commit intorust-lang:master
base:master
Choose a base branch
Loading
fromtromey:add-num-children

Conversation

@tromey
Copy link
Contributor

gdb doesn't have a way to know when an object hasn't yet been initialized, and in this case, if a pretty-printer returns an absurd number of children, this can result in apparent hangs in some modes. This came up specifically with DAP, see this bug report:

https://sourceware.org/bugzilla/show_bug.cgi?id=33594

This patch (mostly) addresses this potential issue in the Rust pretty-printers, by adding 'num_children' methods. In particular a method like this is added when the number of children is variable and also relatively easy to compute. (I.e., I didn't attempt the btree printers.)

Supplying num_children is good for DAP regardless of the initialization problem, because DAP requires a count of child objects and this is more efficient than enumerating the children, which is gdb's fallback approach.

gdb doesn't have a way to know when an object hasn't yet beeninitialized, and in this case, if a pretty-printer returns an absurdnumber of children, this can result in apparent hangs in some modes.This came up specifically with DAP, see this bug report:https://sourceware.org/bugzilla/show_bug.cgi?id=33594This patch (mostly) addresses this potential issue in the Rustpretty-printers, by adding 'num_children' methods.  In particular amethod like this is added when the number of children is variable andalso relatively easy to compute.  (I.e., I didn't attempt the btreeprinters.)Supplying num_children is good for DAP regardless of theinitialization problem, because DAP requires a count of child objectsand this is more efficient than enumerating the children, which isgdb's fallback approach.
@rustbotrustbot added the S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. labelNov 5, 2025
@rustbot
Copy link
Collaborator

r?@Mark-Simulacrum

rustbot has assigned@Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

User? to explicitly pick a reviewer

Copy link
Member

@bjorn3bjorn3 left a comment
edited by rustbot
Loading

Choose a reason for hiding this comment

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

@bjorn3
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commentedNov 5, 2025

📌 Commitd2b021c has been approved bybjorn3

It is now in thequeue for this repository.

@borsbors added S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. labelsNov 5, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull requestNov 6, 2025
Add num_children method to some gdb pretty-printersgdb doesn't have a way to know when an object hasn't yet been initialized, and in this case, if a pretty-printer returns an absurd number of children, this can result in apparent hangs in some modes. This came up specifically with DAP, see this bug report:https://sourceware.org/bugzilla/show_bug.cgi?id=33594This patch (mostly) addresses this potential issue in the Rust pretty-printers, by adding 'num_children' methods.  In particular a method like this is added when the number of children is variable and also relatively easy to compute.  (I.e., I didn't attempt the btree printers.)Supplying num_children is good for DAP regardless of the initialization problem, because DAP requires a count of child objects and this is more efficient than enumerating the children, which is gdb's fallback approach.
@ZalatharZalathar mentioned this pull requestNov 6, 2025
bors added a commit that referenced this pull requestNov 6, 2025
Rollup of 7 pull requestsSuccessful merges: -#145656 (Stabilize s390x `vector` target feature and `is_s390x_feature_detected!` macro) -#147043 (Add default sanitizers to TargetOptions) -#147803 (Add -Zannotate-moves for profiler visibility of move/copy operations (codegen)) -#147912 ([rustdoc] Gracefully handle error in case we cannot run the compiler in doctests) -#148540 (Minor fixes to StdNonZeroNumberProvider for gdb) -#148541 (Add num_children method to some gdb pretty-printers) -#148549 (Fix broken qemu-cskyv2 link)Failed merges: -#147586 (std-detect: improve detect macro docs)r? `@ghost``@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull requestNov 6, 2025
Add num_children method to some gdb pretty-printersgdb doesn't have a way to know when an object hasn't yet been initialized, and in this case, if a pretty-printer returns an absurd number of children, this can result in apparent hangs in some modes. This came up specifically with DAP, see this bug report:https://sourceware.org/bugzilla/show_bug.cgi?id=33594This patch (mostly) addresses this potential issue in the Rust pretty-printers, by adding 'num_children' methods.  In particular a method like this is added when the number of children is variable and also relatively easy to compute.  (I.e., I didn't attempt the btree printers.)Supplying num_children is good for DAP regardless of the initialization problem, because DAP requires a count of child objects and this is more efficient than enumerating the children, which is gdb's fallback approach.
bors added a commit that referenced this pull requestNov 6, 2025
Rollup of 7 pull requestsSuccessful merges: -#143037 (Make named asm_labels lint not trigger on hexagon register spans) -#147043 (Add default sanitizers to TargetOptions) -#147586 (std-detect: improve detect macro docs) -#147912 ([rustdoc] Gracefully handle error in case we cannot run the compiler in doctests) -#148540 (Minor fixes to StdNonZeroNumberProvider for gdb) -#148541 (Add num_children method to some gdb pretty-printers) -#148549 (Fix broken qemu-cskyv2 link)Failed merges: -#147935 (Add LLVM realtime sanitizer)r? `@ghost``@rustbot` modify labels: rollup
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@bjorn3bjorn3bjorn3 approved these changes

Assignees

@Mark-SimulacrumMark-Simulacrum

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@tromey@rustbot@bjorn3@bors@Mark-Simulacrum

[8]ページ先頭

©2009-2025 Movatter.jp