This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/v2] Fix PR backtrace/16558: GDB Aarch64 signal frame unwinder issue


On 03/24/14 09:35, Yao Qi wrote:
On 03/20/2014 12:01 AM, Marcus Shawcroft wrote:
Better no diagram than a broken diagram, but wouldn't it be better to
fix the diagram rather than just remove the whole comment?

Hi, Marcus,
I've updated the diagram per my understanding, is it correct?
https://sourceware.org/ml/gdb-patches/2014-02/msg00378.html


AFAK, this pic is not right.

   |  +----------+
   ^  |          |
   |  | signal   |
   |  |          |
   |  | saved pc |        SIGTRAMP_FRAME
   +--| saved sp |
   |  | saved lr |-->interrupted_function_pc
   |  | saved fp |
   |  +----------+
   |  | saved lr |--> default_restorer (movz x8, NR_sys_rt_sigreturn; svc 0)
   +--| saved fp |<- FP
      |          |         NORMAL_FRAME
      |          |<- SP
      +----------+

interrupted_function_pc is not set to lr, the code in Linux kernel is:
setup_sigframe
	for (i = 0; i < 31; i++)
		__put_user_error(regs->regs[i], &sf->uc.uc_mcontext.regs[i],
				 err);
	__put_user_error(regs->sp, &sf->uc.uc_mcontext.sp, err);
	__put_user_error(regs->pc, &sf->uc.uc_mcontext.pc, err);
	__put_user_error(regs->pstate, &sf->uc.uc_mcontext.pstate, err);
The struct has a special part for pc,sp and pstate.

That is why I want to remove the pic and add the Linux function name to comments.
I think the code is more clear than a ascii pic.  :P

I will post a new patch that add ascii pic back.

Thanks,
Hui


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]