[xtensa-cvscommit] linux/arch/xtensa/kernel ptrace.c,1.2,1.3 gdb-stub.c,1.4,1.5
Brought to you by:
zankel
|
From: <sfo...@us...> - 2002-09-23 19:20:23
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv28814
Modified Files:
ptrace.c gdb-stub.c
Log Message:
The panes of AR registers are stored in the reverse order of which I thought in the save area on user exceptions. Fix the algorithm to find saved AR registers accordingly. This improves backtracing with gdb markedly.
Index: ptrace.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/ptrace.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ptrace.c 19 Sep 2002 07:06:12 -0000 1.2
--- ptrace.c 23 Sep 2002 19:20:20 -0000 1.3
***************
*** 147,154 ****
}
else if(a_reg >= first_pane*4) {
! if(first_pane < 0)
! res = -EIO;
! else
! tmp = child->thread.regfile[a_reg - first_pane*4];
}
else {
--- 147,163 ----
}
else if(a_reg >= first_pane*4) {
! if(first_pane < 0)
! res = -EIO;
! else {
! /* Calculate pane of saved registers.
! * first_pane also corresponds to the number of
! * INactive panes, so num_aregs/4 - first_pane
! * is the number of active panes. The highest
! * active pane is is stored in the lowest part
! * of the regfile array. */
! tmp = XCHAL_NUM_AREGS / 4 - first_pane -
! (a_reg / 4 - first_pane) - 1;
! tmp = child->thread.regfile[tmp*4 + a_reg % 4];
! }
}
else {
Index: gdb-stub.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/gdb-stub.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** gdb-stub.c 22 Sep 2002 21:46:48 -0000 1.4
--- gdb-stub.c 23 Sep 2002 19:20:20 -0000 1.5
***************
*** 386,389 ****
--- 386,390 ----
int ar_reg, a_reg, first_pane;
extern int find_first_pane(int, int);
+ int temp;
kernel_single_step = 0;
***************
*** 575,580 ****
if (first_pane < 0)
strcpy(output_buffer, "E01");
! else
! mem2hex((char *)&(current->thread.regfile[a_reg - first_pane*4]), output_buffer, 4, 0);
}
else {
--- 576,590 ----
if (first_pane < 0)
strcpy(output_buffer, "E01");
! else {
! /* Calculate pane of saved registers.
! * first_pane also corresponds to the number of
! * INactive panes, so num_aregs/4 - first_pane
! * is the number of active panes. The highest
! * active pane is is stored in the lowest part
! * of the regfile array. */
! temp = XCHAL_NUM_AREGS / 4 - first_pane
! - (a_reg / 4 - first_pane) - 1;
! mem2hex((char *)&(current->thread.regfile[temp * 4 + a_reg % 4]), output_buffer, 4, 0);
! }
}
else {
|