[Top] [All Lists]

Re: [PATCH] dump_stack() based on prologue code analysis

To: Atsushi Nemoto <>
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
From: Franck Bui-Huu <>
Date: Mon, 31 Jul 2006 11:15:50 +0200
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta;; h=received:message-id:date:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:from; b=W3VDaNnNEyqPGCUyYY3ku0ori+WV5QjZCd2mQgyYMa0alxnZ6JfXAKEN1UVB4FxmiMnRR+eznCZzyCVrjyttBMdgRzE1tkhvWvKk2QrkgK9d6bS1w/y0j4OC8aMzzoZ1DaG1FxWobXrFtsq7etZWbaXmD/OXUt1+rqwXAppHLyE=
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <>
Reply-to: Franck <>
User-agent: Thunderbird (X11/20060614)
Atsushi Nemoto wrote:
> On Thu, 27 Jul 2006 21:03:07 +0200, "Franck Bui-Huu" <> 
> wrote:
>>>> +     info.func = (void *)(pc - ofs);
>>>> +     info.func_size = ofs;   /* analyze from start to ofs */
>> in get_frame_info(), there is the following condition to stop the
>> prologue analysis
>>              if (info->func_size && i >= info->func_size / 4)
>>                      break;
>> Setting info.func_size = ofs may trigger this stop condition very
>> early, specially if "ofs" is small...I would simply remove this
>> condition since it's very empirical and IMHO not very usefull.
> Yes, that is what I wanted.  Imagine if a exception happened on first
> place on non-leaf function.  In this case, we must assume the function
> is leaf since RA is not saved to the stack.

The only case I can imagine is when sp is corrupted which is unlikely.
However an exception can occure just after a prologue of a nested
function which is more likely. In that case you will assume wrongly
that the function was a leaf one.

I don't think we gain more than we loose with this test. Maybe we can
just leave

                if (i >= info->func_size)

for safety purpose.


<Prev in Thread] Current Thread [Next in Thread>