forked from Imagelibrary/binutils-gdb
Fedora has been carrying this test since back in the Project Archer days. A change back then caused GDB to stop being able to backtrace when only some of the object files had debug information. Even though the changed code never seems to have made its way into the main GDB project, I think it makes sense to bring the test along to ensure something like this doesn't pass unnoticed.
29 lines
1.0 KiB
C
29 lines
1.0 KiB
C
/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
Copyright 2005-2023 Free Software Foundation, Inc.
|
|
|
|
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/>. */
|
|
|
|
typedef int (*callback_t) (void);
|
|
|
|
int
|
|
caller (callback_t callback)
|
|
{
|
|
/* Ensure some frame content to push away the return address. */
|
|
volatile const long one = 1;
|
|
|
|
/* Modify the return value to prevent any tail-call optimization. */
|
|
return (*callback) () - one;
|
|
}
|