This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [RFA] patch to solve libiberty strsignal changes (plus a minor cross-compilation fix)
- To: Chris Faylor <cgf at cygnus dot com>
- Subject: Re: [RFA] patch to solve libiberty strsignal changes (plus a minor cross-compilation fix)
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Sat, 03 Jun 2000 22:21:40 +1000
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <20000531182910.A29100@cygnus.com> <200006010604.CAA09992@indy.delorie.com> <20000601021247.A13381@cygnus.com> <20000601222133.A20052@cygnus.com> <393724EA.2C034823@cygnus.com> <20000602112110.A1020@cygnus.com>
Chris Faylor wrote:
> Ok. That doesn't help much with my current problem, though. How do I build
> a Windows version of gdb? I don't think you want me to be making changes to
> places like lowcore.c. I'm really not qualified for that...
Try the attached. I think I might forget to check in the changes to the
umax and suni386 files - the fix ruins their copyright lines :-)
Andrew
Sat Jun 3 20:43:59 2000 Andrew Cagney <cagney@b1.cygnus.com>
* 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.
* umax-xdep.c (core_file_command), sun386-nat.c
(core_file_command): Ditto.
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.5
diff -p -r1.5 corelow.c
*** corelow.c 2000/05/28 01:12:26 1.5
--- corelow.c 2000/06/03 12:12:16
***************
*** 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
Free Software Foundation, Inc.
This file is part of GDB.
--- 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, 2000
Free Software Foundation, Inc.
This file is part of GDB.
*************** core_open (filename, from_tty)
*** 337,344 ****
siggy = bfd_core_file_failing_signal (core_bfd);
if (siggy > 0)
printf_filtered ("Program terminated with signal %d, %s.\n", siggy,
! safe_strsignal (siggy));
/* Build up thread list from BFD sections. */
--- 337,348 ----
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,
! target_signal_to_string (target_signal_from_host (siggy)));
/* Build up thread list from BFD sections. */
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.22
diff -p -r1.22 defs.h
*** defs.h 2000/06/02 01:59:13 1.22
--- defs.h 2000/06/03 12:12:21
***************
*** 56,64 ****
#include "libiberty.h"
- /* libiberty.h can't declare this one, but evidently we can. */
- extern char *strsignal (int);
-
#include "progress.h"
#ifdef USE_MMALLOC
--- 56,61 ----
*************** extern int strcmp_iw (const char *, cons
*** 292,299 ****
extern int subset_compare (char *, char *);
extern char *safe_strerror (int);
-
- extern char *safe_strsignal (int);
extern void init_malloc (void *);
--- 289,294 ----
Index: sun386-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/sun386-nat.c,v
retrieving revision 1.1.1.3
diff -p -r1.1.1.3 sun386-nat.c
*** sun386-nat.c 1999/07/07 20:10:24 1.1.1.3
--- sun386-nat.c 2000/06/03 12:12:21
***************
*** 1,5 ****
/* Native support for Sun 386i's for GDB, the GNU debugger.
! Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
Changes for sun386i by Jean Daniel Fekete (jdf@litp.univ-p6-7.fr),
C2V Paris, April 89.
--- 1,7 ----
/* Native support for Sun 386i's for GDB, the GNU debugger.
! Copyright (C) 1986, 1987, 1989, 1991, 1992, 2000
! Free Software Foundation, Inc.
!
Changes for sun386i by Jean Daniel Fekete (jdf@litp.univ-p6-7.fr),
C2V Paris, April 89.
*************** core_file_command (filename, from_tty)
*** 119,125 ****
printf_unfiltered ("Core file is from \"%s\".\n", corestr.c_cmdname);
if (corestr.c_signo > 0)
printf_unfiltered ("Program terminated with signal %d, %s.\n",
! corestr.c_signo, safe_strsignal (corestr.c_signo));
}
if (filename[0] == '/')
corefile = savestring (filename, strlen (filename));
--- 121,128 ----
printf_unfiltered ("Core file is from \"%s\".\n", corestr.c_cmdname);
if (corestr.c_signo > 0)
printf_unfiltered ("Program terminated with signal %d, %s.\n",
! corestr.c_signo,
! target_signal_to_string (target_signal_from_host (corestr.c_signo)));
}
if (filename[0] == '/')
corefile = savestring (filename, strlen (filename));
Index: umax-xdep.c
===================================================================
RCS file: /cvs/src/src/gdb/umax-xdep.c,v
retrieving revision 1.1.1.3
diff -p -r1.1.1.3 umax-xdep.c
*** umax-xdep.c 1999/07/07 20:10:55 1.1.1.3
--- umax-xdep.c 2000/06/03 12:12:21
***************
*** 1,5 ****
/* umax host stuff.
! Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
This file is part of GDB.
--- 1,6 ----
/* umax host stuff.
! Copyright (C) 1986, 1987, 1989, 1991, 2000
! Free Software Foundation, Inc.
This file is part of GDB.
*************** core_file_command (filename, from_tty)
*** 94,100 ****
printf_unfiltered ("Core file is from \"%s\".\n", u.pt_comm);
if (u.pt_signal > 0)
printf_unfiltered ("Program terminated with signal %d, %s.\n",
! u.pt_signal, safe_strsignal (u.pt_signal));
/* Read the register values out of the core file and store
them where `read_register' will find them. */
--- 95,102 ----
printf_unfiltered ("Core file is from \"%s\".\n", u.pt_comm);
if (u.pt_signal > 0)
printf_unfiltered ("Program terminated with signal %d, %s.\n",
! u.pt_signal,
! target_signal_to_string (target_signal_from_host (u.pt_signal)));
/* Read the register values out of the core file and store
them where `read_register' will find them. */
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.14
diff -p -r1.14 utils.c
*** utils.c 2000/05/28 01:12:33 1.14
--- utils.c 2000/06/03 12:12:28
*************** safe_strerror (errnum)
*** 772,797 ****
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. */
--- 772,777 ----