Code review request: 7186778 MachO decoder implementation for MacOSX
Kevin Walls
kevin.walls at oracle.com
Sat Jul 28 02:10:22 PDT 2012
Hi Zhengyu
Thanks for taking this on. 8-)
os_bsd.cpp at line 1976 is my comment which needs to go:
1976 // Is this where we end up for a non-dynamic symbol?
1977 // If so, here's the brute force approach:
1978 // Hoping that dladdr() sets dlinfo.dli_fbase above, or do we
need to look it up?
1979 // Perhaps verify it's not null.
1980 if (Decoder::decode(addr, localbuf, MACH_MAXSYMLEN, offset,
dlinfo.dli_fbase)) {
...or at least change to:
// Handle non-dymanic manually:
Also there's a comment at 1957 which should go. It seems that the
dladdr() call at 1961 sets our dlinfo.dli_fbase, even when it can't
return a symbol name. (If any doubt, we should check that the dli_fbase
address is at least non-null before calling Decoder::decode at 1980?...
Actually, yes we should check as we are relying on dladdr() populating
that field, but what if it failed for some reason other than it being a
dynamic symbol?)
Thanks!
Kevin
On 25/07/12 18:47, Zhengyu Gu wrote:
> This is the implementation of MachO decoder for MacOSX. The
> implementation is based on the patch provided by Kevin Walls, I
> modified it to fit it into current decoder framework.
>
>
> CR: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7186778
> Webrev: http://cr.openjdk.java.net/~zgu/7186778/webrev.00/
>
> Tests:
> The repo has ran through JPRT. I also used NMT queries to display
> the decoded callsites.
>
>
> Thanks,
>
> -Zhengyu
More information about the hotspot-dev
mailing list