mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-28 18:07:37 +01:00
Use `UNUSED' in tests
This commit is contained in:
parent
5e7e890a0b
commit
6b55e0ab51
17 changed files with 76 additions and 55 deletions
|
@ -127,7 +127,7 @@ do_backtrace (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
foo (long val __attribute__((unused)))
|
foo (long val UNUSED)
|
||||||
{
|
{
|
||||||
do_backtrace ();
|
do_backtrace ();
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ bar (long v)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
|
sighandler (int signal, void *siginfo UNUSED, void *context)
|
||||||
{
|
{
|
||||||
ucontext_t *uc UNUSED;
|
ucontext_t *uc UNUSED;
|
||||||
int sp;
|
int sp;
|
||||||
|
@ -206,7 +206,7 @@ sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
stack_t stk;
|
stack_t stk;
|
||||||
|
|
|
@ -27,6 +27,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
@ -46,7 +48,7 @@ int got_usr1, got_usr2;
|
||||||
char *sigusr1_sp;
|
char *sigusr1_sp;
|
||||||
|
|
||||||
void
|
void
|
||||||
handler (int sig __attribute__((unused)))
|
handler (int sig UNUSED)
|
||||||
{
|
{
|
||||||
unw_word_t ip;
|
unw_word_t ip;
|
||||||
unw_context_t uc;
|
unw_context_t uc;
|
||||||
|
@ -68,7 +70,7 @@ handler (int sig __attribute__((unused)))
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
worker (void *arg __attribute__((unused)))
|
worker (void *arg UNUSED)
|
||||||
{
|
{
|
||||||
signal (SIGUSR1, handler);
|
signal (SIGUSR1, handler);
|
||||||
|
|
||||||
|
@ -102,7 +104,7 @@ doit (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
|
|
|
@ -27,6 +27,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
#include "flush-cache.h"
|
#include "flush-cache.h"
|
||||||
|
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -157,13 +159,13 @@ sighandler (int signal)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
dev_null (const char *format __attribute__((unused)), ...)
|
dev_null (const char *format UNUSED, ...)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[] __attribute__((unused)))
|
main (int argc, char *argv[] UNUSED)
|
||||||
{
|
{
|
||||||
unw_dyn_region_info_t *region;
|
unw_dyn_region_info_t *region;
|
||||||
unw_dyn_info_t di;
|
unw_dyn_info_t di;
|
||||||
|
|
|
@ -31,6 +31,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
int verbose, errors;
|
int verbose, errors;
|
||||||
|
|
||||||
|
@ -99,7 +100,7 @@ Test_Class::Test_Class (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
verbose = argc > 1;
|
verbose = argc > 1;
|
||||||
return atexit (a);
|
return atexit (a);
|
||||||
|
|
|
@ -27,6 +27,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -64,8 +66,8 @@ get_bsp (void)
|
||||||
#ifdef TEST_WITH_SIGINFO
|
#ifdef TEST_WITH_SIGINFO
|
||||||
void
|
void
|
||||||
handler (int sig,
|
handler (int sig,
|
||||||
siginfo_t *si __attribute__((unused)),
|
siginfo_t *si UNUSED,
|
||||||
void *ucontext __attribute__((unused)))
|
void *ucontext UNUSED)
|
||||||
#else
|
#else
|
||||||
void
|
void
|
||||||
handler (int sig)
|
handler (int sig)
|
||||||
|
@ -135,7 +137,7 @@ handler (int sig)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
float d = 1.0;
|
float d = 1.0;
|
||||||
|
|
|
@ -139,7 +139,7 @@ do_backtrace (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
foo (long val __attribute__((unused)))
|
foo (long val UNUSED)
|
||||||
{
|
{
|
||||||
do_backtrace ();
|
do_backtrace ();
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ bar (long v)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
|
sighandler (int signal, void *siginfo UNUSED, void *context)
|
||||||
{
|
{
|
||||||
ucontext_t *uc UNUSED;
|
ucontext_t *uc UNUSED;
|
||||||
int sp;
|
int sp;
|
||||||
|
@ -220,7 +220,7 @@ sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
stack_t stk;
|
stack_t stk;
|
||||||
|
|
|
@ -26,6 +26,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
#define UNW_LOCAL_ONLY
|
#define UNW_LOCAL_ONLY
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
@ -1333,7 +1334,7 @@ foo_128 (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
bar(void *p __attribute__((unused)))
|
bar(void *p UNUSED)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < ITERS; ++i) {
|
for (i = 0; i < ITERS; ++i) {
|
||||||
|
@ -1487,7 +1488,7 @@ int doit ()
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
|
|
|
@ -64,7 +64,7 @@ a (int d, ...)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
|
|
|
@ -27,6 +27,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -159,7 +161,7 @@ sighandler (int signal)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
long i = 0;
|
long i = 0;
|
||||||
|
|
|
@ -263,7 +263,7 @@ static void install_sigsegv_handler(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc __attribute__((unused)), char **argv)
|
main(int argc UNUSED, char **argv)
|
||||||
{
|
{
|
||||||
unw_addr_space_t as;
|
unw_addr_space_t as;
|
||||||
struct UCD_info *ui;
|
struct UCD_info *ui;
|
||||||
|
|
|
@ -32,6 +32,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -91,7 +93,7 @@ foo (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
verbose = (argc > 1);
|
verbose = (argc > 1);
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -82,7 +84,7 @@ consume_some_stack_space (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
struct rlimit rlim;
|
struct rlimit rlim;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
int errors;
|
int errors;
|
||||||
|
|
||||||
|
@ -43,20 +44,20 @@ int errors;
|
||||||
{ ++errors; fprintf (stderr, args); return -1; }
|
{ ++errors; fprintf (stderr, args); return -1; }
|
||||||
|
|
||||||
static int
|
static int
|
||||||
find_proc_info (unw_addr_space_t as __attribute__((unused)),
|
find_proc_info (unw_addr_space_t as UNUSED,
|
||||||
unw_word_t ip __attribute__((unused)),
|
unw_word_t ip UNUSED,
|
||||||
unw_proc_info_t *pip __attribute__((unused)),
|
unw_proc_info_t *pip UNUSED,
|
||||||
int need_unwind_info __attribute__((unused)),
|
int need_unwind_info UNUSED,
|
||||||
void *arg __attribute__((unused)))
|
void *arg UNUSED)
|
||||||
{
|
{
|
||||||
return -UNW_ESTOPUNWIND;
|
return -UNW_ESTOPUNWIND;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
access_mem (unw_addr_space_t as __attribute__((unused)),
|
access_mem (unw_addr_space_t as UNUSED,
|
||||||
unw_word_t addr __attribute__((unused)),
|
unw_word_t addr UNUSED,
|
||||||
unw_word_t *valp, int write,
|
unw_word_t *valp, int write,
|
||||||
void *arg __attribute__((unused)))
|
void *arg UNUSED)
|
||||||
{
|
{
|
||||||
if (!write)
|
if (!write)
|
||||||
*valp = 0;
|
*valp = 0;
|
||||||
|
@ -64,10 +65,10 @@ access_mem (unw_addr_space_t as __attribute__((unused)),
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
access_reg (unw_addr_space_t as __attribute__((unused)),
|
access_reg (unw_addr_space_t as UNUSED,
|
||||||
unw_regnum_t regnum __attribute__((unused)),
|
unw_regnum_t regnum UNUSED,
|
||||||
unw_word_t *valp, int write,
|
unw_word_t *valp, int write,
|
||||||
void *arg __attribute__((unused)))
|
void *arg UNUSED)
|
||||||
{
|
{
|
||||||
if (!write)
|
if (!write)
|
||||||
*valp = 32;
|
*valp = 32;
|
||||||
|
@ -75,10 +76,10 @@ access_reg (unw_addr_space_t as __attribute__((unused)),
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
access_fpreg (unw_addr_space_t as __attribute__((unused)),
|
access_fpreg (unw_addr_space_t as UNUSED,
|
||||||
unw_regnum_t regnum __attribute__((unused)),
|
unw_regnum_t regnum UNUSED,
|
||||||
unw_fpreg_t *valp, int write,
|
unw_fpreg_t *valp, int write,
|
||||||
void *arg __attribute__((unused)))
|
void *arg UNUSED)
|
||||||
{
|
{
|
||||||
if (!write)
|
if (!write)
|
||||||
memset (valp, 0, sizeof (*valp));
|
memset (valp, 0, sizeof (*valp));
|
||||||
|
@ -86,37 +87,37 @@ access_fpreg (unw_addr_space_t as __attribute__((unused)),
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_dyn_info_list_addr (unw_addr_space_t as __attribute__((unused)),
|
get_dyn_info_list_addr (unw_addr_space_t as UNUSED,
|
||||||
unw_word_t *dilap __attribute__((unused)),
|
unw_word_t *dilap UNUSED,
|
||||||
void *arg __attribute__((unused)))
|
void *arg UNUSED)
|
||||||
{
|
{
|
||||||
return -UNW_ENOINFO;
|
return -UNW_ENOINFO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
put_unwind_info (unw_addr_space_t as __attribute__((unused)),
|
put_unwind_info (unw_addr_space_t as UNUSED,
|
||||||
unw_proc_info_t *pi __attribute__((unused)),
|
unw_proc_info_t *pi UNUSED,
|
||||||
void *arg __attribute__((unused)))
|
void *arg UNUSED)
|
||||||
{
|
{
|
||||||
++errors;
|
++errors;
|
||||||
fprintf (stderr, "%s() got called!\n", __FUNCTION__);
|
fprintf (stderr, "%s() got called!\n", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
resume (unw_addr_space_t as __attribute__((unused)),
|
resume (unw_addr_space_t as UNUSED,
|
||||||
unw_cursor_t *reg __attribute__((unused)),
|
unw_cursor_t *reg UNUSED,
|
||||||
void *arg __attribute__((unused)))
|
void *arg UNUSED)
|
||||||
{
|
{
|
||||||
panic ("%s() got called!\n", __FUNCTION__);
|
panic ("%s() got called!\n", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
get_proc_name (unw_addr_space_t as __attribute__((unused)),
|
get_proc_name (unw_addr_space_t as UNUSED,
|
||||||
unw_word_t ip __attribute__((unused)),
|
unw_word_t ip UNUSED,
|
||||||
char *buf __attribute__((unused)),
|
char *buf UNUSED,
|
||||||
size_t buf_len __attribute__((unused)),
|
size_t buf_len UNUSED,
|
||||||
unw_word_t *offp __attribute__((unused)),
|
unw_word_t *offp UNUSED,
|
||||||
void *arg __attribute__((unused)))
|
void *arg UNUSED)
|
||||||
{
|
{
|
||||||
panic ("%s() got called!\n", __FUNCTION__);
|
panic ("%s() got called!\n", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,8 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -104,7 +106,7 @@ bar (int v)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
int val = argc;
|
int val = argc;
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
/* The setjmp()/longjmp(), sigsetjmp()/siglongjmp(). */
|
/* The setjmp()/longjmp(), sigsetjmp()/siglongjmp(). */
|
||||||
|
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -139,7 +141,7 @@ sighandler (int signal)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
volatile sigset_t sigset1, sigset2, sigset3;
|
volatile sigset_t sigset1, sigset2, sigset3;
|
||||||
volatile struct sigaction act;
|
volatile struct sigaction act;
|
||||||
|
|
|
@ -33,6 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
#define UNW_LOCAL_ONLY
|
#define UNW_LOCAL_ONLY
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
|
#include "compiler.h"
|
||||||
|
|
||||||
extern int test_generic (void);
|
extern int test_generic (void);
|
||||||
|
|
||||||
|
@ -87,7 +88,7 @@ test_local (void)
|
||||||
#endif /* !UNW_REMOTE_ONLY */
|
#endif /* !UNW_REMOTE_ONLY */
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
#include "compiler.h"
|
||||||
#include <libunwind.h>
|
#include <libunwind.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv __attribute__((unused)))
|
main (int argc, char **argv UNUSED)
|
||||||
{
|
{
|
||||||
int i, verbose = argc > 1;
|
int i, verbose = argc > 1;
|
||||||
const char *msg;
|
const char *msg;
|
||||||
|
|
Loading…
Reference in a new issue