- Notifications
You must be signed in to change notification settings - Fork13.9k
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
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
rustbot has assigned@Mark-Simulacrum. Use |
bjorn3 left a comment• edited by rustbot
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by rustbot
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
r=me when CI passes
@bors r+ rollup |
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.
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
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.
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
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:
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.