Hi Jack, Everyone,

The existing x86_64 kdb has two blocks of code which adjust the RSP
value based on the assumption that the RSP and SS are not saved.
I don't think this code is ever need.  Once the processor is in
"Long-Mode" it always saves the SS:RSP.

I was having problems with stack trace backs when stopped at a
breakpoint at a function entry.  Fixing the RSP values made the
stack trace back work for this case.

The attached patch removes this unnecessary stack adjustment.

Jim Houston - Concurrent Computer Corp.

--

--- arch/x86_64/kdb/kdbasupport.c.0     2005-08-22 17:30:22.000000000 -0400
+++ arch/x86_64/kdb/kdbasupport.c       2005-10-04 10:31:05.000000000 -0400
@@ -699,10 +699,6 @@
 
        if (strcmp(regname, "krsp") == 0) {
                *contents = (unsigned long)regs + sizeof(struct pt_regs);
-               if ((regs->cs & 0xffff) == __KERNEL_CS) {
-                       /* rsp and ss are not on stack */
-                       *contents -= 2*4;
-               }
                return 0;
        }
 
@@ -734,22 +730,6 @@
 
        if ((i < nkdbreglist)
         && (strlen(kdbreglist[i].reg_name) == strlen(regname))) {
-               if ((regs->cs & 0xffff) == __KERNEL_CS) {
-                       /* No cpl switch, rsp is not on stack */
-                       if (strcmp(kdbreglist[i].reg_name, "rsp") == 0) {
-                               *contents = (kdb_machreg_t)regs +
-                                       sizeof(struct pt_regs) - 2*8;
-                               return(0);
-                       }
-                       if (strcmp(kdbreglist[i].reg_name, "ss") == 0) {
-                               kdb_machreg_t r;
-
-                               r = (kdb_machreg_t)regs +
-                                       sizeof(struct pt_regs) - 2*8;
-                               *contents = (kdb_machreg_t)SS(r);       /* XXX 
*/
-                               return(0);
-                       }
-               }
                *contents = *(unsigned long *)((unsigned long)regs +
                                kdbreglist[i].reg_offset);
                return(0);



---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.

Reply via email to