summaryrefslogtreecommitdiff
path: root/bfd/ptrace-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/ptrace-core.c')
-rw-r--r--bfd/ptrace-core.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/bfd/ptrace-core.c b/bfd/ptrace-core.c
index 77eaaeb46a..9f6ffdf9cb 100644
--- a/bfd/ptrace-core.c
+++ b/bfd/ptrace-core.c
@@ -1,6 +1,6 @@
/* BFD backend for core files which use the ptrace_user structure
Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2012 Free Software Foundation, Inc.
The structure of this file is based on trad-core.c written by John Gilmore
of Cygnus Support.
Modified to work with the ptrace_user structure by Kevin A. Buettner.
@@ -35,31 +35,29 @@
#include <sys/ptrace.h>
struct trad_core_struct
- {
- asection *data_section;
- asection *stack_section;
- asection *reg_section;
- struct ptrace_user u;
- };
+{
+ asection *data_section;
+ asection *stack_section;
+ asection *reg_section;
+ struct ptrace_user u;
+};
-#define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
-#define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
+#define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u))
+#define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section)
#define core_stacksec(bfd) ((bfd)->tdata.trad_core_data->stack_section)
-#define core_regsec(bfd) ((bfd)->tdata.trad_core_data->reg_section)
+#define core_regsec(bfd) ((bfd)->tdata.trad_core_data->reg_section)
/* forward declarations */
-const bfd_target *ptrace_unix_core_file_p PARAMS ((bfd *abfd));
-char * ptrace_unix_core_file_failing_command PARAMS ((bfd *abfd));
-int ptrace_unix_core_file_failing_signal PARAMS ((bfd *abfd));
+const bfd_target *ptrace_unix_core_file_p (bfd *abfd);
+char * ptrace_unix_core_file_failing_command (bfd *abfd);
+int ptrace_unix_core_file_failing_signal (bfd *abfd);
#define ptrace_unix_core_file_matches_executable_p generic_core_file_matches_executable_p
#define ptrace_unix_core_file_pid _bfd_nocore_core_file_pid
-static void swap_abort PARAMS ((void));
+static void swap_abort (void);
const bfd_target *
-ptrace_unix_core_file_p (abfd)
- bfd *abfd;
-
+ptrace_unix_core_file_p (bfd *abfd)
{
int val;
struct ptrace_user u;
@@ -137,10 +135,10 @@ ptrace_unix_core_file_p (abfd)
}
char *
-ptrace_unix_core_file_failing_command (abfd)
- bfd *abfd;
+ptrace_unix_core_file_failing_command (bfd *abfd)
{
char *com = abfd->tdata.trad_core_data->u.pt_comm;
+
if (*com)
return com;
else
@@ -148,15 +146,14 @@ ptrace_unix_core_file_failing_command (abfd)
}
int
-ptrace_unix_core_file_failing_signal (abfd)
- bfd *abfd;
+ptrace_unix_core_file_failing_signal (bfd *abfd)
{
return abfd->tdata.trad_core_data->u.pt_sigframe.sig_num;
}
/* If somebody calls any byte-swapping routines, shoot them. */
static void
-swap_abort ()
+swap_abort (void)
{
abort (); /* This way doesn't require any declaration for ANSI to fuck up */
}
@@ -215,7 +212,7 @@ const bfd_target ptrace_core_vec =
NULL,
- (PTR) 0 /* backend_data */
+ NULL /* backend_data */
};
#endif /* PTRACE_CORE */