From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: vagabon.xyz@gmail.com, linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH] dump_stack() based on prologue code analysis
Date: Mon, 31 Jul 2006 16:32:52 +0200 [thread overview]
Message-ID: <44CE1494.4080801@innova-card.com> (raw)
In-Reply-To: <20060731.223923.115609520.anemo@mba.ocn.ne.jp>
Atsushi Nemoto wrote:
> On Mon, 31 Jul 2006 11:15:50 +0200, Franck Bui-Huu <vagabon.xyz@gmail.com> wrote:
>>> 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.
>
> Modern gcc somtimes do amazing optimization ;-)
>
>> 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.
>
> Why? get_frame_info() should detect frame_size and pc_offset for that
> case.
>
> Is your objection against "info->func_size / 4" part? the "4" comes
> from size of a instruction.
>
OK. I missed that, sorry.
> Well, using "4" instead of "sizeof(union mips_instruction)" or
> "sizeof(*ip)" was my old fault...
Well could we use "sizeof(union mips_instruction)" so nobody won't
make the same mistake ?
if (i >= info->func_size / sizeof(union mips_instruction))
break;
BTW I omit the first condition "info->func_size != 0" because
normally a func has a no null size. If it has we should stop
right now.
We should also test this condition _before_ testing that "*ip" is
a jal instruction, shouldn't we ?
Franck
next prev parent reply other threads:[~2006-07-31 14:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-26 14:22 [PATCH] dump_stack() based on prologue code analysis Atsushi Nemoto
2006-07-27 14:33 ` Franck Bui-Huu
2006-07-27 19:03 ` Franck Bui-Huu
2006-07-28 8:16 ` Franck Bui-Huu
2006-07-28 16:08 ` Atsushi Nemoto
2006-07-28 16:01 ` Atsushi Nemoto
2006-07-31 9:15 ` Franck Bui-Huu
2006-07-31 13:39 ` Atsushi Nemoto
2006-07-31 14:32 ` Franck Bui-Huu [this message]
2006-07-31 15:33 ` Atsushi Nemoto
2006-07-31 15:51 ` Franck Bui-Huu
2006-07-31 15:59 ` Atsushi Nemoto
2006-07-28 15:44 ` Atsushi Nemoto
2006-07-31 8:45 ` Franck Bui-Huu
2006-07-27 16:54 ` David Daney
2006-07-27 17:03 ` Thiemo Seufer
2006-07-27 17:27 ` David Daney
2006-07-27 18:51 ` Franck Bui-Huu
2006-07-27 19:12 ` Thiemo Seufer
2006-07-28 14:38 ` Atsushi Nemoto
2006-07-28 17:05 ` David Daney
2006-07-28 17:34 ` Nigel Stephens
2006-07-28 18:32 ` David Daney
2006-07-28 19:31 ` Thiemo Seufer
2006-07-29 14:25 ` Atsushi Nemoto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44CE1494.4080801@innova-card.com \
--to=vagabon.xyz@gmail.com \
--cc=anemo@mba.ocn.ne.jp \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox