diff options
author | Alexandra Hajkova <ahajkova@redhat.com> | 2017-10-27 21:07:50 +0200 |
---|---|---|
committer | Alexandra Hájková <ahajkova@redhat.com> | 2025-04-02 11:18:03 +0200 |
commit | 5cb1689a7a883251b1e90ab85648c80287a106d0 (patch) | |
tree | c46326608794fa6531a4221e67014f775ed6253d /gdb/testsuite/gdb.base/set-solib-absolute-prefix.c | |
parent | 877d74ab5f2f33aa062c4b8d1ba910a46e4ef9d1 (diff) | |
download | binutils-5cb1689a7a883251b1e90ab85648c80287a106d0.zip binutils-5cb1689a7a883251b1e90ab85648c80287a106d0.tar.gz binutils-5cb1689a7a883251b1e90ab85648c80287a106d0.tar.bz2 |
Add gdb.base/set-solib-absolute-prefix.exp
Compile a 32-bit x86 executable and then stop within a system call.
Change the sysroot to a non-existent directory, GDB should try (and
fail) to reload the currently loaded shared libraries. However, GDB
should retain the symbols for the vDSO library as that is not loaded
from the file system.
Check the backtrace to ensure that the __kernel_vsyscall symbol is
still in the backtrace, this indicates GDB still has the vDSO
symbols available.
This test was present in Fedora for a long time and was
originally written by Jan Kratochvil for this fix
829a902da291e72ad17e8c44fa8d9ead3db41b1f.
Co-Authored-By: Jan Kratochvil <jan.kratochvil@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/testsuite/gdb.base/set-solib-absolute-prefix.c')
-rw-r--r-- | gdb/testsuite/gdb.base/set-solib-absolute-prefix.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c new file mode 100644 index 0000000..685a22e --- /dev/null +++ b/gdb/testsuite/gdb.base/set-solib-absolute-prefix.c @@ -0,0 +1,32 @@ +/* Copyright (C) 2012-2025 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <stdlib.h> + +/* Global var used to generate filler code. */ +volatile int global_var = 0; + +int +main () +{ + global_var++; + global_var++; + + abort (); + + return 0; +} |