From 8e6a3c35b9c93dbff0ead9659581e7b75c3e31be Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 4 Jun 2000 01:58:49 +0000 Subject: [PATCH] Eliminate safe_strsignal(). --- gdb/ChangeLog | 8 ++++++++ gdb/TODO | 9 +++++++++ gdb/corelow.c | 8 ++++++-- gdb/defs.h | 5 ----- gdb/utils.c | 20 -------------------- 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b9d9059ac46..247183e28b7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +Sat Jun 3 20:43:59 2000 Andrew Cagney + + * defs.h (strsignal, safe_strsignal): Delete declarations. + * utils.c (safe_strsignal): Delete. + * corelow.c (core_open): Replace save_strsignal with + target_signal_to_string + target_signal_from_host. + * TODO: Document problems with target_signal_from_host. + 2000-06-03 Kevin Buettner * annotate.c, annotate.h, breakpoint.c, command.c, command.h, diff --git a/gdb/TODO b/gdb/TODO index 69c61a6c719..eac185584ef 100644 --- a/gdb/TODO +++ b/gdb/TODO @@ -874,6 +874,15 @@ wrong. It involves the use of add_set_enum_cmd(). -- +Fix target_signal_from_host() etc. + +The name is wrong for starters. ``target_signal'' should probably be +``gdb_signal''. ``from_host'' should be ``from_target_signal''. +After that it needs to be multi-arched and made independant of any +host signal numbering. + +-- + Update ALPHA so that it uses ``struct frame_extra_info'' instead of EXTRA_FRAME_INFO. diff --git a/gdb/corelow.c b/gdb/corelow.c index 940776d895b..43163d927bd 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -1,5 +1,5 @@ /* Core dump and executable file functions below target vector, for GDB. - Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1986, 87, 89, 91, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation, Inc. This file is part of GDB. @@ -337,8 +337,12 @@ core_open (filename, from_tty) siggy = bfd_core_file_failing_signal (core_bfd); if (siggy > 0) + /* NOTE: target_signal_from_host() converts a target signal value + into gdb's internal signal value. Unfortunatly gdb's internal + value is called ``target_signal'' and this function got the + name ..._from_host(). */ printf_filtered ("Program terminated with signal %d, %s.\n", siggy, - safe_strsignal (siggy)); + target_signal_to_string (target_signal_from_host (siggy))); /* Build up thread list from BFD sections. */ diff --git a/gdb/defs.h b/gdb/defs.h index 79ebd0c114a..e918271fbd1 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -56,9 +56,6 @@ #include "libiberty.h" -/* libiberty.h can't declare this one, but evidently we can. */ -extern char *strsignal (int); - #include "progress.h" #ifdef USE_MMALLOC @@ -293,8 +290,6 @@ extern int subset_compare (char *, char *); extern char *safe_strerror (int); -extern char *safe_strsignal (int); - extern void init_malloc (void *); extern void request_quit (int); diff --git a/gdb/utils.c b/gdb/utils.c index 81ac1fa4bd7..f5088aff82d 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -772,26 +772,6 @@ safe_strerror (errnum) return (msg); } -/* The strsignal() function can return NULL for signal values that are - out of range. Provide a "safe" version that always returns a - printable string. */ - -char * -safe_strsignal (signo) - int signo; -{ - char *msg; - static char buf[32]; - - if ((msg = strsignal (signo)) == NULL) - { - sprintf (buf, "(undocumented signal %d)", signo); - msg = buf; - } - return (msg); -} - - /* Print the system error message for errno, and also mention STRING as the file name for which the error was encountered. Then return to command level. */ -- 2.30.2