Re: [PATCH RFA] procfs.c related changes for AIX 5

Kevin Buettner
2001-03-26T18:24:00Z

On Mar 13, 5:24pm, Michael Snyder wrote:

> Kevin Buettner wrote:
> >
> > The patch below represent the changes needed to procfs.c and related files
> > for making GDB work natively on AIX5/IA-64.
>
> Kevin,
>
> This patch looks fine. I just have a few requests:
>
> * struct sigaction and struct siginfo: could you use a typedef
> instead of a define? It will make debugging easier.

Done.

> * SYSENT_PROC_NAME_FMT: there is a changelog entry without a referent.

Good catch. I've removed this from the ChangeLog entries that were
just committed. Originally, I had added this, but during my merge
into the current sources, I discovered that it wasn't needed.

> * HAVE_SYS_SYSCALL_H, HAVE_SYS_FAULT_H: I didn't see any configury
> changes that would define these.

The configury changes have/had already been committed. See my
ChangeLog entry for 2001-03-05.

> Also, I think your changelog entries ought to say "include conditionally",
> rather than just "include". These headers were already being included.

You're right. I've fixed this too.

I've made the requested changes and have committed them. Prior to
the commit, I did test builds on AIX5, Solaris 8, and Unixware 7.
I've also tested for regressions on Unixware 7. (I had previously
tested for regressions on Solaris 8, but until recently, did not have
a Unixware 7 box to build on so I thought it prudent to test for
regressions there as well.)

The bulk of the patch is the same as what was originally posted, so
I won't repost the entire patch unless otherwise requested. The only
part which is different is from procfs.c and accomodates Michael's
request to use typedefs for struct sigaction and struct siginfo instead
of #define. Here it is...

@@ -195,9 +200,72 @@ init_procfs_ops (void)
};
#endif

+/* gdb_sigset_t */
+#ifdef HAVE_PR_SIGSET_T
+typedef pr_sigset_t gdb_sigset_t;
+#else
+typedef sigset_t gdb_sigset_t;
+#endif
+
+/* sigaction */
+#ifdef HAVE_PR_SIGACTION64_T
+typedef pr_sigaction64_t gdb_sigaction_t;
+#else
+typedef struct sigaction gdb_sigaction_t;
+#endif
+
+/* siginfo */
+#ifdef HAVE_PR_SIGINFO64_T
+typedef pr_siginfo64_t gdb_siginfo_t;
+#else
+typedef struct siginfo gdb_siginfo_t;
+#endif

+/* gdb_premptysysset */
+#ifdef premptysysset
+#define gdb_premptysysset premptysysset
+#else
+#define gdb_premptysysset premptyset
+#endif

+/* praddsysset */
+#ifdef praddsysset
+#define gdb_praddsysset praddsysset
+#else
+#define gdb_praddsysset praddset
+#endif
+
+/* prdelsysset */
+#ifdef prdelsysset
+#define gdb_prdelsysset prdelsysset
+#else
+#define gdb_prdelsysset prdelset
+#endif

+/* prissyssetmember */
+#ifdef prissyssetmember
+#define gdb_pr_issyssetmember prissyssetmember
+#else
+#define gdb_pr_issyssetmember prismember
+#endif
+
+/* As a feature test, saying ``#if HAVE_PRSYSENT_T'' everywhere isn't
+ as intuitively descriptive as it could be, so we'll define
+ DYNAMIC_SYSCALLS to mean the same thing. Anyway, at the time of
+ this writing, this feature is only found on AIX5 systems and
+ basically means that the set of syscalls is not fixed. I.e,
+ there's no nice table that one can #include to get all of the
+ syscall numbers. Instead, they're stored in /proc/PID/sysent
+ for each process. We are at least guaranteed that they won't
+ change over the lifetime of the process. But each process could
+ (in theory) have different syscall numbers.
+*/
+#ifdef HAVE_PRSYSENT_T
+#define DYNAMIC_SYSCALLS
+#endif
+
+
+
/* =================== STRUCT PROCINFO "MODULE" =================== */

/* FIXME: this comment will soon be out of date W.R.T. threads. */