one more comment,
2006/7/27, Franck Bui-Huu <vagabon.xyz@gmail.com>:
Hi Atsushi ;)
Atsushi Nemoto wrote:
> +unsigned long unwind_stack(struct task_struct *task,
> + unsigned long **sp, unsigned long pc)
> +{
> + unsigned long stack_page;
> + struct mips_frame_info info;
> + char *modname;
> + char namebuf[KSYM_NAME_LEN + 1];
> + unsigned long size, ofs;
> +
> + stack_page = (unsigned long)task_stack_page(task);
> + if (!stack_page)
> + return 0;
> +
> + if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
> + return 0;
> + if (ofs == 0)
> + return 0;
> +
> + 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.
> + get_frame_info(&info);
> + if (info.pc_offset < 0 || !info.frame_size) {
> + /* leaf? */
for leaf case, can't we simply do this test:
if (info.pc_offset < 0) {
--
Franck
|