Add support for threads.
Fix build (undefined variable).

Index: gdb/hppa-obsd-nat.c
--- gdb/hppa-obsd-nat.c.orig
+++ gdb/hppa-obsd-nat.c
@@ -194,7 +194,7 @@ hppaobsd_collect_fpregset (struct regcache *regcache,
 void
 hppa_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
 {
-  pid_t pid = regcache->ptid ().pid ();
+  pid_t pid = get_ptrace_pid (regcache->ptid ());
 
   if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum))
     {
@@ -223,6 +223,8 @@ hppa_obsd_nat_target::fetch_registers (struct regcache
 void
 hppa_obsd_nat_target::store_registers (struct regcache *regcache, int regnum)
 {
+  pid_t pid = get_ptrace_pid (regcache->ptid ());
+
   if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum))
     {
       struct reg regs;
