Re: [PATCHv4] Make "skip" work on inline frames

Simon Marchi
2019-12-02T02:34:47Z

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

On 2019-11-24 6:22 a.m., Bernd Edlinger wrote:
> This is just a minor update on the patch
> since the function SYMBOL_PRINT_NAME was removed with
> commit 987012b89bce7f6385ed88585547f852a8005a3f
> I replaced it with sym->print_name (), otherwise the
> patch is unchanged.

Hi Bernd,

Sorry, I had lost this in the mailing list noise.

I played a bit with the patch and different cases of figure. I am not able to understand
the purpose of each of your changes (due to the complexity of that particular code), but
I didn't find anything that stood out as wrong to me. Pedro might be able to do a more
in-depth review of the event handling code.

If the test tests specifically skipping of inline functions, I'd name it something more
descriptive than "skip2.exp", maybe "skip-inline.exp"?

Unfortunately, your test doesn't pass on my computer (gcc 9.2.0), but neither does the
gdb.base/skip.exp. I am attaching the gdb.log when running your test, if it can help.

Simon

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gdb.log --]
[-- Type: text/x-log; name="gdb.log", Size: 11436 bytes --]

Test run by simark on Sun Dec 1 21:33:16 2019
Native configuration is x86_64-pc-linux-gnu

=== gdb tests ===

Schedule of variations:
unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /home/simark/src/binutils-gdb/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.exp ...
get_compiler_info: gcc-9-2-0
Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never -w -c -g -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip20.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -w -c -g -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip20.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c
Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never -w -c -g -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip21.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -w -c -g -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip21.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c
Executing on host: gcc -fno-stack-protector /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip20.o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip21.o -fdiagnostics-color=never -w -g -lm -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip2 (timeout = 300)
spawn -ignore SIGHUP gcc -fno-stack-protector /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip20.o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip21.o -fdiagnostics-color=never -w -g -lm -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip2
spawn /home/simark/build/binutils-gdb/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/simark/build/binutils-gdb/gdb/testsuite/../data-directory
warning: Found custom handler for signal 7 (Bus error) preinstalled.
warning: Found custom handler for signal 8 (Floating point exception) preinstalled.
warning: Found custom handler for signal 11 (Segmentation fault) preinstalled.
Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN)
won't be propagated to spawned programs.
GNU gdb (GDB) 9.0.50.20191202-git
Copyright (C) 2019 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:
<http://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".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base
Source directories searched: /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base:$cdir:$cwd
(gdb) kill
The program is not being run.
(gdb) file /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip2
Reading symbols from /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip2...
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x1141: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c, line 37.
(gdb) run
Starting program: /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip2

Breakpoint 1, main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
37 x = baz (foo ());
(gdb) skip function foo
Function foo will be skipped when stepping.
(gdb) PASS: gdb.base/skip2.exp: skip function foo
bt
#0 main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
(gdb) PASS: gdb.base/skip2.exp: in the main
step
baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:27
27 return a + 1;
(gdb) PASS: gdb.base/skip2.exp: step into baz, since foo will be skipped
bt
#0 baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:27
#1 0x000055555555514d in main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
(gdb) PASS: gdb.base/skip2.exp: in the baz, since foo was skipped
step
28 }
(gdb) PASS: gdb.base/skip2.exp: step in the baz
bt
#0 baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:28
#1 0x000055555555514d in main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
(gdb) PASS: gdb.base/skip2.exp: still in the baz
step
main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
37 x = baz (foo ());
(gdb) PASS: gdb.base/skip2.exp: step back to main
bt
#0 main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
(gdb) PASS: gdb.base/skip2.exp: again in the main
step
40 x = 0; x = baz (foo ());
(gdb) PASS: gdb.base/skip2.exp: step again into baz, since foo will be skipped
bt
#0 main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:40
(gdb) FAIL: gdb.base/skip2.exp: again in the baz
step
baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:27
27 return a + 1;
(gdb) PASS: gdb.base/skip2.exp: step in the baz, again
bt
#0 baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:27
#1 0x0000555555555163 in main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:40
(gdb) PASS: gdb.base/skip2.exp: still in the baz, again
step
28 }
(gdb) PASS: gdb.base/skip2.exp: step back to main, again
bt
#0 baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:28
#1 0x0000555555555163 in main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:40
(gdb) FAIL: gdb.base/skip2.exp: again back to main
delete breakpoints
Delete all breakpoints? (y or n) y
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 2 at 0x555555555141: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c, line 37.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip2

Breakpoint 2, main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
37 x = baz (foo ());
(gdb) bt
#0 main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
(gdb) PASS: gdb.base/skip2.exp: double step: in the main
step 2
28 }
(gdb) PASS: gdb.base/skip2.exp: double step: step into baz, since foo will be skipped
bt
#0 baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:28
#1 0x000055555555514d in main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
(gdb) PASS: gdb.base/skip2.exp: double step: still in the baz
step
main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
37 x = baz (foo ());
(gdb) PASS: gdb.base/skip2.exp: double step: step back to main
bt
#0 main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
(gdb) PASS: gdb.base/skip2.exp: double step: again in the main
step 2
baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:27
27 return a + 1;
(gdb) PASS: gdb.base/skip2.exp: double step: step again into baz, since foo will be skipped
bt
#0 baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:27
#1 0x0000555555555163 in main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:40
(gdb) PASS: gdb.base/skip2.exp: double step: again in the baz
step
28 }
(gdb) PASS: gdb.base/skip2.exp: double step: step back to main, again
bt
#0 baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:28
#1 0x0000555555555163 in main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:40
(gdb) FAIL: gdb.base/skip2.exp: double step: again back to main
delete breakpoints
Delete all breakpoints? (y or n) y
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 3 at 0x555555555141: file /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c, line 37.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.base/skip2/skip2

Breakpoint 3, main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
37 x = baz (foo ());
(gdb) bt
#0 main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
(gdb) PASS: gdb.base/skip2.exp: triple step: in the main
step 3
main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
37 x = baz (foo ());
(gdb) PASS: gdb.base/skip2.exp: triple step: step over baz
bt
#0 main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:37
(gdb) PASS: gdb.base/skip2.exp: triple step: again in the main
step 3
28 }
(gdb) PASS: gdb.base/skip2.exp: triple step: step over baz, again
bt
#0 baz (a=1) at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip1.c:28
#1 0x0000555555555163 in main () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.c:40
(gdb) FAIL: gdb.base/skip2.exp: triple step: again back to main
testcase /home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/skip2.exp completed in 1 seconds

=== gdb Summary ===

# of expected passes 24
# of unexpected failures 4
Executing on host: /home/simark/build/binutils-gdb/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/simark/build/binutils-gdb/gdb/testsuite/../data-directory --version (timeout = 300)
spawn -ignore SIGHUP /home/simark/build/binutils-gdb/gdb/testsuite/../../gdb/gdb -nw -nx -data-directory /home/simark/build/binutils-gdb/gdb/testsuite/../data-directory --version
warning: Found custom handler for signal 7 (Bus error) preinstalled.
warning: Found custom handler for signal 8 (Floating point exception) preinstalled.
warning: Found custom handler for signal 11 (Segmentation fault) preinstalled.
Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN)
won't be propagated to spawned programs.
GNU gdb (GDB) 9.0.50.20191202-git
Copyright (C) 2019 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.
/home/simark/build/binutils-gdb/gdb/gdb version 11 -nw -nx -data-directory /home/simark/build/binutils-gdb/gdb/testsuite/../data-directory

runtest completed at Sun Dec 1 21:33:17 2019