You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building the compiler and running the tests on system with GDB 11.2 fails on current master (commit 97cde9f) with the following:
---- [debuginfo-gdb] debuginfo/borrowed-unique-basic.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 11002000
error: line not found in debugger output: $3 = 97
status: exit status: 0
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/home/nert/dev/rust/build/x86_64-unknown-linux-gnu/test/debuginfo/borrowed-unique-basic.gdb/borrowed-unique-basic.debugger.script"
--- stdout -------------------------------
GNU gdb (Gentoo 11.2 vanilla) 11.2
... a little bit down we see ...
$2 = -1
$3 = 97 'a'
$4 = 68
and the same for src/test/debuginfo/borrowed-basic.rs.
I would also like to fix this as I found out about this while trying to go through https://rustc-dev-guide.rust-lang.org/ hoping to find a possibility for my first contribution.
My commit nertpinx@def7bb9 works for me, but is definitely not a great fix. I went on Zulip to ask about how to proceed and after some redirection I found out that someone asked for an issue to be filed, so hence this issue.
I can't think of much else about fixing this than the above commit with added ignore for gdb older than 11.2. What's the best way to continue? Create a draft PR? Or should I rather leave this alone so that I do not interfere since it is part of another change?
running 268 tests
.iiiiiF....F..i..i.....i..i.ii.....i...i...............i...........iiiii....ii.......ii......i...... 100/268
.........ii..i.i.........i.......ii....i..i.....i........i..i.ii.....i...ii..i..i..ii.i............. 200/268
i.i.iii...ii.......ii......i...ii........i.....i..i......ii.i.......
failures:
---- [debuginfo-gdb] debuginfo/borrowed-basic.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 11002000
error: line not found in debugger output: $3 = 97
status: exit status: 0
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/home/matthias/vcs/github/rust/build/x86_64-unknown-linux-gnu/test/debuginfo/borrowed-basic.gdb/borrowed-basic.debugger.script"
--- stdout -------------------------------
GNU gdb (GDB) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Breakpoint 1 at 0x1423: file /home/matthias/vcs/github/rust/src/test/debuginfo/borrowed-basic.rs, line 161.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Breakpoint 1, borrowed_basic::main () at /home/matthias/vcs/github/rust/src/test/debuginfo/borrowed-basic.rs:161
161 zzz(); // #break
$1 = true
$2 = -1
$3 = 97 'a'
$4 = 68
$5 = -16
$6 = -32
$7 = -64
$8 = 1
$9 = 100
$10 = 16
$11 = 32
$12 = 64
$13 = 2.5
$14 = 3.5
A debugging session is active.
Inferior 1 [process 109076] will be killed.
Quit anyway? (y or n) [answered Y; input not from terminal]
------------------------------------------
stderr: none
---- [debuginfo-gdb] debuginfo/borrowed-unique-basic.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 11002000
error: line not found in debugger output: $3 = 97
status: exit status: 0
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/home/matthias/vcs/github/rust/build/x86_64-unknown-linux-gnu/test/debuginfo/borrowed-unique-basic.gdb/borrowed-unique-basic.debugger.script"
--- stdout -------------------------------
GNU gdb (GDB) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Breakpoint 1 at 0x37aa: file /home/matthias/vcs/github/rust/src/test/debuginfo/borrowed-unique-basic.rs, line 164.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Breakpoint 1, borrowed_unique_basic::main () at /home/matthias/vcs/github/rust/src/test/debuginfo/borrowed-unique-basic.rs:164
164 zzz(); // #break
$1 = true
$2 = -1
$3 = 97 'a'
$4 = 68
$5 = -16
$6 = -32
$7 = -64
$8 = 1
$9 = 100
$10 = 16
$11 = 32
$12 = 64
$13 = 2.5
$14 = 3.5
A debugging session is active.
Inferior 1 [process 109238] will be killed.
Quit anyway? (y or n) [answered Y; input not from terminal]
------------------------------------------
stderr: none
failures:
[debuginfo-gdb] debuginfo/borrowed-basic.rs
[debuginfo-gdb] debuginfo/borrowed-unique-basic.rs
test result: FAILED. 202 passed; 2 failed; 64 ignored; 0 measured; 0 filtered out; finished in 111.36s
A more complicated but future looking fix could be adding [gdb-version, gdbr-version, gdbg-version]
PREFIXES to src/tools/compiletest/src/runtest.rs
I'm not sure if there is a better way of getting a parsable gdb version than something like:
gdb -ie 'interpreter-exec mi -gdb-version' --batch | head -n 1
This at least seems to avoid color styling output.
Edit: Seems like it would probably be a pain, as it'd probably need to actually be some form of version range
but I was not sure where to check what does it imply and where to find the definitions for these. I think that it is useful to check that gdb can actually display the character. Thanks @ratmice to pointing to the implementation of those. I'll try to look at that at some point, although it will probably take me quite some time O:-) so I do not want to promise anything.
Activity
nertpinx commentedon Feb 28, 2022
I would also like to fix this as I found out about this while trying to go through https://rustc-dev-guide.rust-lang.org/ hoping to find a possibility for my first contribution.
My commit nertpinx@def7bb9 works for me, but is definitely not a great fix. I went on Zulip to ask about how to proceed and after some redirection I found out that someone asked for an issue to be filed, so hence this issue.
I can't think of much else about fixing this than the above commit with added ignore for gdb older than 11.2. What's the best way to continue? Create a draft PR? Or should I rather leave this alone so that I do not interfere since it is part of another change?
matthiaskrgr commentedon Mar 1, 2022
Getting this too.
ratmice commentedon Mar 2, 2022
How about just changing that to
// gdb-command:print/d *char_ref, which should print the same on old gdb and new?ratmice commentedon Mar 3, 2022
A more complicated but future looking fix could be adding
[gdb-version, gdbr-version, gdbg-version]PREFIXES to
src/tools/compiletest/src/runtest.rsI'm not sure if there is a better way of getting a parsable gdb version than something like:
This at least seems to avoid color styling output.
Edit: Seems like it would probably be a pain, as it'd probably need to actually be some form of version range
nertpinx commentedon Mar 8, 2022
it's also possible to add
but I was not sure where to check what does it imply and where to find the definitions for these. I think that it is useful to check that gdb can actually display the character. Thanks @ratmice to pointing to the implementation of those. I'll try to look at that at some point, although it will probably take me quite some time O:-) so I do not want to promise anything.
tromey commentedon Mar 18, 2022
FYI, just
gdb --versionworks, the styling is disabled when output is not going to a tty.Fix debuginfo tests with GDB 11.2
Rollup merge of rust-lang#95063 - tromey:fix-94458-gdb-char, r=Mark-S…
Auto merge of rust-lang#95063 - tromey:fix-94458-gdb-char, r=Mark-Sim…