mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-01-24 18:35:28 +00:00
Add AIX5 procfs support.
This commit is contained in:
parent
eb4a6e4f4b
commit
37de36c6ed
@ -1,3 +1,50 @@
|
||||
2001-03-26 Kevin Buettner <kevinb@redhat.com>
|
||||
|
||||
* proc-utils.h (procfs_ctl_t): New typedef.
|
||||
* proc-api.c (write_with_trace): Change type of ``opcode'' from
|
||||
long to procfs_ctl_t. Don't assume that the target has defined
|
||||
BREAKPOINT. Handle case in which PCRESET is the same as PCUNSET.
|
||||
* proc-events.c (sys/syscall.h, sys/fault.h): Include conditionally.
|
||||
* procfs.c (sys/fault.h, sys/syscall.h): Include conditionally.
|
||||
(gdb_sigset_t, gdb_sigaction_t, gdb_siginfo_t, gdb_premptysysset)
|
||||
(gdb_praddsysset, gdb_prdelsysset, gdb_pr_issyssetmember):
|
||||
Conditionally define as appropriate for AIX/non-AIX systems. Use
|
||||
these defines/typedefs as appropriate elsewhere in file.
|
||||
(struct procinfo): Change type of saved_sigset and saved_sighold
|
||||
from sigset_t to gdb_sigset_t. Make saved_exitset and
|
||||
saved_entryset pointer variables. Add two new fields, num_syscalls
|
||||
and syscall_names.
|
||||
(DYNAMIC_SYSCALLS): Define when HAVE_PRSYSENT_T is defined.
|
||||
(sysset_t_size, sysset_t_alloc): New functions.
|
||||
(load_syscalls, free_syscalls, find_syscall): New functions for
|
||||
platforms which define DYNAMIC_SYSCALLS.
|
||||
(create_procinfo): Call load_syscalls.
|
||||
(destroy_one_procinfo): Call free_syscalls.
|
||||
(GDBRESET): Don't define twice.
|
||||
(proc_modify_flag): Change type of operation code array `arg'
|
||||
from long to procfs_ctl_t.
|
||||
(proc_stop_process, proc_wait_for_stop, proc_run_process)
|
||||
(proc_set_traced_signals, proc_set_traced_faults)
|
||||
(proc_set_traced_sysentry, proc_set_traced_sysexit)
|
||||
(proc_set_held_signals, proc_clear_current_fault)
|
||||
(proc_set_current_signal, proc_clear_current_signal, proc_set_gregs)
|
||||
(proc_set_fpregs, proc_kill, proc_set_watchpoint): Likewise for `cmd'.
|
||||
(proc_set_traced_sysentry): Dynamically allocate variable sized
|
||||
struct gdb_proc_ctl_pcsentry. Also, free it at function exit.
|
||||
(proc_set_traced_sysexit): Dynamically allocate variable
|
||||
sized struct gdb_proc_ctl_pcsexit. Also, free it at
|
||||
function exit.
|
||||
(proc_get_traced_sysentry, proc_get_traced_sysexit): Add new code
|
||||
for reading the sysset_t struct on AIX5.
|
||||
(procfs_debug_inferior): Don't assume that SYS_exit will be
|
||||
defined. Add new code for finding certain syscalls on AIX5.
|
||||
(syscall_is_lwp_exit, syscall_is_exit, syscall_is_exec)
|
||||
(syscall_is_lwp_create): New functions.
|
||||
(procfs_wait): Restructured code which checks for certain
|
||||
system calls to use the new syscall_is_... functions.
|
||||
(procfs_notice_signals): Account for the fact that saved_entryset
|
||||
and saved_exitset in struct procinfo are now pointers.
|
||||
|
||||
2001-03-26 Kevin Buettner <kevinb@redhat.com>
|
||||
|
||||
* symtab.c (find_pc_sect_line): Revise method used for finding
|
||||
|
@ -446,12 +446,12 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
long *arg = (long *) varg;
|
||||
procfs_ctl_t *arg = (procfs_ctl_t *) varg;
|
||||
|
||||
prepare_to_trace ();
|
||||
if (procfs_trace)
|
||||
{
|
||||
long opcode = arg[0];
|
||||
procfs_ctl_t opcode = arg[0];
|
||||
for (i = 0; rw_table[i].name != NULL; i++)
|
||||
if (rw_table[i].value == opcode)
|
||||
break;
|
||||
@ -475,7 +475,9 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line)
|
||||
case PCUNSET:
|
||||
#endif
|
||||
#ifdef PCRESET
|
||||
#if PCRESET != PCUNSET
|
||||
case PCRESET:
|
||||
#endif
|
||||
#endif
|
||||
fprintf (procfs_file ? procfs_file : stdout,
|
||||
"write (PCRESET, %s) %s\n",
|
||||
@ -551,6 +553,7 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line)
|
||||
break;
|
||||
default:
|
||||
{
|
||||
#ifdef BREAKPOINT
|
||||
static unsigned char break_insn[] = BREAKPOINT;
|
||||
|
||||
if (len == sizeof (break_insn) &&
|
||||
@ -558,7 +561,9 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line)
|
||||
fprintf (procfs_file ? procfs_file : stdout,
|
||||
"write (<breakpoint at 0x%08lx>) \n",
|
||||
(unsigned long) lseek_offset);
|
||||
else if (rw_table[i].name)
|
||||
else
|
||||
#endif
|
||||
if (rw_table[i].name)
|
||||
fprintf (procfs_file ? procfs_file : stdout,
|
||||
"write (%s) %s\n",
|
||||
rw_table[i].name,
|
||||
|
@ -40,8 +40,12 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/procfs.h>
|
||||
#ifdef HAVE_SYS_SYSCALL_H
|
||||
#include <sys/syscall.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_FAULT_H
|
||||
#include <sys/fault.h>
|
||||
#endif
|
||||
|
||||
/* Much of the information used in the /proc interface, particularly for
|
||||
printing status information, is kept as tables of structures of the
|
||||
|
@ -92,3 +92,11 @@ extern void procfs_note (char *, char *, int);
|
||||
#define PROCFS_NOTE(X) procfs_note (X, __FILE__, __LINE__)
|
||||
#define PROC_PRETTYFPRINT_STATUS(X,Y,Z,T) \
|
||||
proc_prettyfprint_status (X, Y, Z, T)
|
||||
|
||||
/* Define the type (and more importantly the width) of the control
|
||||
word used to write to the /proc/PID/ctl file. */
|
||||
#if defined (PROC_CTL_WORD_TYPE)
|
||||
typedef PROC_CTL_WORD_TYPE procfs_ctl_t;
|
||||
#else
|
||||
typedef long procfs_ctl_t;
|
||||
#endif
|
||||
|
1009
gdb/procfs.c
1009
gdb/procfs.c
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user