diff options
author | Ian Lance Taylor <ian@airs.com> | 1993-07-22 19:39:41 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1993-07-22 19:39:41 +0000 |
commit | a643e6260e2b817cffecd200214b1fceee802ab8 (patch) | |
tree | bb6274bcd78551b72293e2a00e83d0715fc544b8 /bfd/hppa.c | |
parent | 88b457e59a1d0d51b2950e448c5e8deffc9b9b61 (diff) | |
download | gdb-a643e6260e2b817cffecd200214b1fceee802ab8.zip gdb-a643e6260e2b817cffecd200214b1fceee802ab8.tar.gz gdb-a643e6260e2b817cffecd200214b1fceee802ab8.tar.bz2 |
* hpux-core.c: New file; backend for HP/UX style core files.
* bfd.c (struct _bfd): Renamed hppa_core_data field to
hpux_core_data.
* bfd-in2.h: Updated.
* hppa.c (make_bfd_asection, hppa_core_file_p,
hppa_core_file_failing_command, hppa_core_file_failing_signal,
hppa_core_file_matches_executable_p): Moved into hpux-core.c.
Removed from target vector.
* libhppa.h (struct hppa_core_struct and accessor macros): Moved
into hpux-core.c.
* targets.c: If HPUX_CORE is defined, add hpux_core_vec to
target list.
* config/hp300.mh (HDEFINES): Set to -DHPUX_CORE.
(HDEPFILES): Set to hpux-core.o.
* config/hppabsd.mh, config/hppahpux.mh: Likewise.
* hosts/hp300.h (HOST_HP300HPUX): Define.
* Makefile.in (OPTIONAL_BACKENDS): Added sco-core.o,
aix386-core.o, hpux-core.o.
(sco-core.o, aix386-core.o, hpux-core.o): New dependencies.
Diffstat (limited to 'bfd/hppa.c')
-rw-r--r-- | bfd/hppa.c | 135 |
1 files changed, 6 insertions, 129 deletions
@@ -511,134 +511,6 @@ hppa_sizeof_headers (abfd, reloc) return (0); } -static asection * -make_bfd_asection (abfd, name, flags, _raw_size, vma, alignment_power) - bfd *abfd; - CONST char *name; - flagword flags; - bfd_size_type _raw_size; - bfd_vma vma; - unsigned int alignment_power; -{ - asection *asect; - - asect = bfd_make_section (abfd, name); - if (!asect) - return NULL; - - asect->flags = flags; - asect->_raw_size = _raw_size; - asect->vma = vma; - asect->filepos = bfd_tell (abfd); - asect->alignment_power = alignment_power; - - return asect; -} - -#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) -/* This requires system include files. */ - -static bfd_target * -hppa_core_file_p (abfd) - bfd *abfd; -{ - core_hdr (abfd) = bfd_zalloc (abfd, sizeof (struct hppa_core_struct)); - if (!core_hdr (abfd)) - return NULL; - - while (1) - { - int val; - struct corehead core_header; - - val = bfd_read ((void *) &core_header, 1, sizeof core_header, abfd); - if (val <= 0) - break; - switch (core_header.type) - { - case CORE_KERNEL: - case CORE_FORMAT: - bfd_seek (abfd, core_header.len, SEEK_CUR); /* Just skip this */ - break; - case CORE_EXEC: - { - struct proc_exec proc_exec; - bfd_read ((void *) &proc_exec, 1, core_header.len, abfd); - strncpy (core_command (abfd), proc_exec.cmd, MAXCOMLEN + 1); - } - break; - case CORE_PROC: - { - struct proc_info proc_info; - core_regsec (abfd) = make_bfd_asection (abfd, ".reg", - SEC_ALLOC + SEC_HAS_CONTENTS, - core_header.len, - (int) &proc_info - (int) &proc_info.hw_regs, - 2); - bfd_read (&proc_info, 1, core_header.len, abfd); - core_signal (abfd) = proc_info.sig; - } - if (!core_regsec (abfd)) - return NULL; - break; - case CORE_DATA: - core_datasec (abfd) = make_bfd_asection (abfd, ".data", - SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, - core_header.len, - core_header.addr, - 2); - if (!core_datasec (abfd)) - return NULL; - bfd_seek (abfd, core_header.len, SEEK_CUR); - break; - case CORE_STACK: - core_stacksec (abfd) = make_bfd_asection (abfd, ".stack", - SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, - core_header.len, - core_header.addr, - 2); - if (!core_stacksec (abfd)) - return NULL; - bfd_seek (abfd, core_header.len, SEEK_CUR); - break; - default: - fprintf (stderr, "Unknown HPPA/HPUX core file section type %d\n", - core_header.type); - bfd_seek (abfd, core_header.len, SEEK_CUR); - break; - } - } - - /* OK, we believe you. You're a core file (sure, sure). */ - - return abfd->xvec; -} - -static char * -hppa_core_file_failing_command (abfd) - bfd *abfd; -{ - return core_command (abfd); -} - -/* ARGSUSED */ -static int -hppa_core_file_failing_signal (abfd) - bfd *abfd; -{ - return core_signal (abfd); -} - -/* ARGSUSED */ -static boolean -hppa_core_file_matches_executable_p (core_bfd, exec_bfd) - bfd *core_bfd, *exec_bfd; -{ - return true; /* FIXME, We have no way of telling at this point */ -} - -#endif /* HPUX or BSD. */ - /* Miscellaneous Support Functions -- Control Structures and Functions for the PA. */ @@ -1036,6 +908,11 @@ hppa_get_symbol_info (ignore_abfd, symbol, ret) #define hppa_bfd_make_debug_symbol \ ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) +/* Core file support is in the hpux-core backend. */ +#define hppa_core_file_failing_command _bfd_dummy_core_file_failing_command +#define hppa_core_file_failing_signal _bfd_dummy_core_file_failing_signal +#define hppa_core_file_matches_executable_p _bfd_dummy_core_file_matches_executable_p + bfd_target hppa_vec = { "hppa", /* name */ @@ -1063,7 +940,7 @@ bfd_target hppa_vec = {_bfd_dummy_target, hppa_object_p, /* bfd_check_format */ bfd_generic_archive_p, - hppa_core_file_p, + bfd_false }, { bfd_false, |