diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2013-02-04 18:26:34 +0000 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2013-02-04 18:26:34 +0000 |
commit | 70a38d42c5b3fdc03acd4faef4149f5f2e8a0fb4 (patch) | |
tree | 525fc36f46d8e714ddd70c291ceb77f255cf36f3 /bfd/elf-bfd.h | |
parent | 176eb98c2f159084863a303f417803dd6736f16f (diff) | |
download | gdb-70a38d42c5b3fdc03acd4faef4149f5f2e8a0fb4.zip gdb-70a38d42c5b3fdc03acd4faef4149f5f2e8a0fb4.tar.gz gdb-70a38d42c5b3fdc03acd4faef4149f5f2e8a0fb4.tar.bz2 |
2013-02-04 Sergio Durigan Junior <sergiodj@redhat.com>
Pedro Alves <palves@redhat.com>
* Makefile.in (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
* elf-bfd.h (elf_internal_linux_prpsinfo): New structure
declaration.
(elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64)
(elfcore_write_ppc32_linux_prpsinfo32): New declarations.
* elf-linux-psinfo.h: New file.
* elf.c: Include elf-linux-psinfo.h.
(elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64):
New functions.
* elf32-ppc.c: Include `elf-linux-psinfo.h'.
(elf_external_ppc_linux_prpsinfo32): New structure declaration.
(PPC_LINUX_PRPSINFO32_SWAP_FIELDS): New macro.
(elfcore_write_ppc_linux_prpsinfo32): New function.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index faaf632..1fd73cf 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -2285,6 +2285,42 @@ extern char *elfcore_write_lwpstatus extern char *elfcore_write_register_note (bfd *, char *, int *, const char *, const void *, int); +/* Internal structure which holds information to be included in the + PRPSINFO section of Linux core files. + + This is an "internal" structure in the sense that it should be used + to pass information to BFD (via the `elfcore_write_linux_prpsinfo' + function), so things like endianess shouldn't be an issue. This + structure will eventually be converted in one of the + `elf_external_linux_*' structures and written out to an output bfd + by one of the functions declared below. */ + +struct elf_internal_linux_prpsinfo + { + char pr_state; /* Numeric process state. */ + char pr_sname; /* Char for pr_state. */ + char pr_zomb; /* Zombie. */ + char pr_nice; /* Nice val. */ + unsigned long pr_flag; /* Flags. */ + unsigned int pr_uid; + unsigned int pr_gid; + int pr_pid, pr_ppid, pr_pgrp, pr_sid; + char pr_fname[16 + 1]; /* Filename of executable. */ + char pr_psargs[80 + 1]; /* Initial part of arg list. */ + }; + +/* Linux/most 32-bit archs. */ +extern char *elfcore_write_linux_prpsinfo32 + (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *); + +/* Linux/most 64-bit archs. */ +extern char *elfcore_write_linux_prpsinfo64 + (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *); + +/* Linux/PPC32 uses different layout compared to most archs. */ +extern char *elfcore_write_ppc_linux_prpsinfo32 + (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *); + extern bfd *_bfd_elf32_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type)); |