#include "target.h"
#include "gdbcore.h"
#include "gdbcmd.h"
+#include "gdbthread.h"
#if defined (NEW_PROC_API)
#define _STRUCTURED_PROC 1 /* Should be done by configure script. */
#include <sys/fault.h>
#include <sys/syscall.h>
#include <sys/errno.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <ctype.h>
+
+#include "proc-utils.h"
/*
* PROCFS.C
#ifndef PIDGET
#define PIDGET(PID) (PID)
#define TIDGET(PID) (PID)
+#endif
+#ifndef MERGEPID
#define MERGEPID(PID, TID) (PID)
#endif
procinfo *pi = find_procinfo (pid, tid);
if (pi == NULL)
- if (tid)
- error ("procfs: couldn't find pid %d (kernel thread %d) in procinfo list.",
- pid, tid);
- else
- error ("procfs: couldn't find pid %d in procinfo list.", pid);
+ {
+ if (tid)
+ error ("procfs: couldn't find pid %d (kernel thread %d) in procinfo list.",
+ pid, tid);
+ else
+ error ("procfs: couldn't find pid %d in procinfo list.", pid);
+ }
return pi;
}
procinfo *pi;
int which;
{
+#ifdef NEW_PROC_API
char tmp[MAX_PROC_NAME_SIZE];
+#endif
int fd;
/*
struct prmap *map;
procinfo *pi;
#ifndef NEW_PROC_API /* avoid compiler warning */
- int nmaps = 0, i;
+ int nmaps = 0;
+ int i;
+#else
+ int map_fd;
+ char pathname[MAX_PROC_NAME_SIZE];
#endif
int funcstat = 0;
- int fd, map_fd;
- char pathname[MAX_PROC_NAME_SIZE];
+ int fd;
pi = find_procinfo_or_die (PIDGET (inferior_pid), 0);
if ((nsysargs = proc_nsysarg (pi)) > 0 &&
(sysargs = proc_sysargs (pi)) != NULL)
{
- printf_filtered ("%d syscall arguments:\n", nsysargs);
+ printf_filtered ("%ld syscall arguments:\n", nsysargs);
for (i = 0; i < nsysargs; i++)
- printf_filtered ("#%d: 0x%08x\n",
+ printf_filtered ("#%ld: 0x%08x\n",
i, sysargs[i]);
}
if ((nsysargs = proc_nsysarg (pi)) > 0 &&
(sysargs = proc_sysargs (pi)) != NULL)
{
- printf_filtered ("%d syscall arguments:\n", nsysargs);
+ printf_filtered ("%ld syscall arguments:\n", nsysargs);
for (i = 0; i < nsysargs; i++)
- printf_filtered ("#%d: 0x%08x\n",
+ printf_filtered ("#%ld: 0x%08x\n",
i, sysargs[i]);
}
}
return 0;
}
+#if 0
/*
* Function: make_signal_thread_runnable
*
#endif
return 0;
}
+#endif
/*
* Function: target_resume
/* Convert signal to host numbering. */
if (signo == 0 ||
- signo == TARGET_SIGNAL_STOP && pi->ignore_next_sigstop)
+ (signo == TARGET_SIGNAL_STOP && pi->ignore_next_sigstop))
native_signo = 0;
else
native_signo = target_signal_to_host (signo);
procinfo *pi;
sysset_t exitset;
- sysset_t entryset;
if ((pi = create_procinfo (getpid (), 0)) == NULL)
perror_with_name ("procfs: create_procinfo failed in child.");
old_chain = make_cleanup (null_cleanup, 0);
if (args)
- if ((argv = buildargv (args)) == NULL)
- nomem (0);
- else
- make_cleanup ((make_cleanup_func) freeargv, argv);
-
+ {
+ if ((argv = buildargv (args)) == NULL)
+ nomem (0);
+ else
+ make_cleanup ((make_cleanup_func) freeargv, argv);
+ }
while (argv != NULL && *argv != NULL)
{
if (isdigit (argv[0][0]))