Re: ups on FreeBSD 8.X
Callum Gibson <[email protected]> Tue, 28 Sep 2010 10:15:41 +1000
| Newsgroups | gmane.comp.debugging.ups.user |
|---|---|
| Message-ID | <[email protected]> |
--4Ckj6UjgE2iN1+kY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On 28Sep10 07:35, Bakul Shah wrote:
}The system libelf is likely to be more correct.
I think they are just separate implementations.
}I brought up my machine over the weekend. No new changes
}since your last patches. So yes, I am interested in your
}uarea changes. Would be nice if all your freebsd changes can
}be checked in. If that is not possible, perhaps we can set up
}a mercurial repo somewhere.
Well there is a ups repo already, but it's a matter of having access I guess.
UAREA patches are below. They need to be applied on top of my original
freebsd+fixes patches. No prizes for style - I just wanted to see if it
worked. The #include and the #ifdef should be fixed to be more standard.
}The linux version compiles with the system provided libelf
}(with --enable-dwarf) and allowed me to debug some 32bit
}binaries (but gets confused about shared libs for others).
}Threads seem to confuse it too. We really need atleast a
}basic test suite.
I suspect on linux the "system" libelf/libdwarf and the ups-included one
are the same thing which is why there is no clash.
}Must say though that it doesn't feel as great as I remember
}it to be :-)
You only need to use something else for a bit and you'll appreciate it again.
Using ddd drives me up the wall, and I don't really want to drag in
an entire kde environment to try kdbg, though it looks ok. Again, they both
just sit on top of gdb, which while powerful in itself leads to usability
drawbacks. I love ups's conditional breakpoint and on the fly statement
execution stuff.
But, there are a few rough edges we could clean up. Got to get it going first.
Got to get some time to get it going before that.
C
--
****** Do not contact me directly for application support ******
*** Email: [email protected] Hotline: +61 2 8258 2709 ***
Callum Gibson [email protected] +61 438 266 463 (Mob)
Rates IT, Deutsche Bank, Australia [/] +61 2 8258 1620 (Wrk)
--4Ckj6UjgE2iN1+kY
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="ups-uarea-freebsd.diff"
diff -ruw ups-freebsd/ups/ao_pt_uarea.c ups-fixed/ups/ao_pt_uarea.c
--- ups-freebsd/ups/ao_pt_uarea.c 2009-11-02 15:54:00.000000000 +1100
+++ ups-fixed/ups/ao_pt_uarea.c 2010-09-23 15:17:53.000000000 +1000
@@ -808,9 +808,41 @@
errno = 0;
handler = e_ptrace(PTRACE_PEEKUSER, ip->ip_pid, (char *)uaddr, 0);
#else
+#ifdef __FreeBSD__
+#include <sys/sysctl.h>
+ {
+ int error, name[4];
+ size_t len;
+ struct kinfo_proc *kip;
+
+ name[0] = CTL_KERN;
+ name[1] = KERN_PROC;
+ name[2] = KERN_PROC_PID;
+ name[3] = ip->ip_pid;
+
+ len = 0;
+ error = sysctl(name, 4, NULL, &len, NULL, 0);
+ if (error < 0) {
+ errf("Can't get signal info from sysctl");
+ return SGH_DEFAULT;
+ }
+ kip = malloc(len);
+ if (sysctl(name, 4, kip, &len, NULL, 0) < 0) {
+ errf("Can't get signal info from sysctl");
+ return SGH_DEFAULT;
+ }
+ if (sigismember(&kip->ki_sigignore, signo))
+ res = SGH_IGNORED;
+ else if (sigismember(&kip->ki_sigcatch, signo))
+ res = SGH_CAUGHT;
+ else
+ res = SGH_DEFAULT;
+ }
+#else
errf("ptrace_get_sigstate : UAREA desupported by OS, no signal state");
return SGH_DEFAULT; /* guess */
#endif
+#endif
if (handler == (taddr_t)SIG_IGN)
res = SGH_IGNORED;
--4Ckj6UjgE2iN1+kY--