* [Linux-ia64] get_scratch_regs in bk 2.4 unwind.c
@ 2003-03-08 3:57 Keith Owens
2003-03-10 17:00 ` David Mosberger
0 siblings, 1 reply; 2+ messages in thread
From: Keith Owens @ 2003-03-08 3:57 UTC (permalink / raw)
To: linux-ia64
The bk version of unwind.c has some changes from my patch which do not
look right.
static inline struct pt_regs *
get_scratch_regs (struct unw_frame_info *info)
{
if (!info->pt) {
/* This should not happen with valid unwind info. */
UNW_DPRINT(0, "unwind.%s: bad unwind info: resetting info->pt\n", __FUNCTION__);
info->pt = info->sp - 16;
}
UNW_DPRINT(3, "unwind.%s: sp 0x%lx pt 0x%lx\n", __FUNCTION__, info->sp, info->pt);
return info->pt;
}
__FUNCTION__ will always print get_scratch_regs which is of no use, we
need the calling function. My patch passed in the calling function
name as a parameter. Please revert to passing in the function name or
make get_scratch_regs a #define so it gets the calling function name.
Also I printed the new value of info->pt, it is useful when debugging
bad unwind data.
unw_access_gr has
/* access a scratch register */
if (!info->pt) {
UNW_DPRINT(0, "unwind.%s: no pt-regs; cannot access r%d\n",
__FUNCTION__, regnum);
return -1;
}
pt = get_scratch_regs(info);
Why the test for !info->pt? No other use of get_scratch_regs has that
test, unw_access_[abf]r will continue with whatever data get_scratch_regs
returns, using pt_regs on top of stack if info->pt is undefined. The
code is inconsistent.
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Linux-ia64] get_scratch_regs in bk 2.4 unwind.c
2003-03-08 3:57 [Linux-ia64] get_scratch_regs in bk 2.4 unwind.c Keith Owens
@ 2003-03-10 17:00 ` David Mosberger
0 siblings, 0 replies; 2+ messages in thread
From: David Mosberger @ 2003-03-10 17:00 UTC (permalink / raw)
To: linux-ia64
>>>>> On Sat, 08 Mar 2003 14:57:11 +1100, Keith Owens <kaos@sgi.com> said:
Keith> UNW_DPRINT(3, "unwind.%s: sp 0x%lx pt 0x%lx\n", __FUNCTION__, info->sp, info->pt);
Keith> __FUNCTION__ will always print get_scratch_regs which is of no use, we
Keith> need the calling function. My patch passed in the calling function
Keith> name as a parameter. Please revert to passing in the function name or
Keith> make get_scratch_regs a #define so it gets the calling function name.
Keith> Also I printed the new value of info->pt, it is useful when debugging
Keith> bad unwind data.
We're not going to pass around arguments that are only used for
debugging. If you want to, we could print __builtin_return_address(0)
along with the function name (or we could use the kernel symbol table
to print the symbolic name).
Keith> unw_access_gr has
Keith> /* access a scratch register */
Keith> if (!info->pt) {
Keith> UNW_DPRINT(0, "unwind.%s: no pt-regs; cannot access r%d\n",
Keith> __FUNCTION__, regnum);
Keith> return -1;
Keith> }
Keith> pt = get_scratch_regs(info);
Keith> Why the test for !info->pt? No other use of get_scratch_regs
Keith> has that test, unw_access_[abf]r will continue with whatever
Keith> data get_scratch_regs returns, using pt_regs on top of stack
Keith> if info->pt is undefined. The code is inconsistent.
I agree. Looks like something went wrong during the merge. I'll fix
that.
--david
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-10 17:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-08 3:57 [Linux-ia64] get_scratch_regs in bk 2.4 unwind.c Keith Owens
2003-03-10 17:00 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox