[RFC] Patch to add kernel threads support for FreeBSD 6.1

Mark Kettenis mark.kettenis@xs4all.nl
Thu Feb 8 21:47:00 GMT 2007


> From: Fred Fish <fnf@specifix.com>
> Date: Tue, 6 Feb 2007 17:18:47 -0700
> 
> This patch adds support for kernel threads on FreeBSD 6.1.  There are
> obviously some rough edges still, and I'd appreciate feedback from
> people with FreeBSD experience and also experience with thread support
> in gdb.

This looks quite reasonable.  A couple of remarks:

Can you avoid introducing supply_xxregset()/fill_xxregset() and use
register sets instead?

Is the child_suppress_run hack really necessary?  I thought the right
stratum was automatically chosen.

> +#define GET_PID(ptid)		ptid_get_pid (ptid)
> +#define GET_LWP(ptid)		ptid_get_lwp (ptid)
> +#define GET_THREAD(ptid)	ptid_get_tid (ptid)
> +
> +#define IS_LWP(ptid)		(GET_LWP (ptid) != 0)
> +#define IS_THREAD(ptid)		(GET_THREAD (ptid) != 0)
> +
> +#define BUILD_LWP(lwp, pid)	ptid_build (pid, lwp, 0)
> +#define BUILD_THREAD(tid, pid)	ptid_build (pid, 0, tid)

These days these macros are really pointless and I think they should
die (here and elsewhere in the code).

Mark



More information about the Gdb-patches mailing list