Subject: Gdb on crash dumps with symbols
To: None <port-alpha@NetBSD.ORG>
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
List: port-alpha
Date: 05/09/1997 23:31:48
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <28583.863235087.1@cmf.nrl.navy.mil>

Well, I did a little more digging into my gdb problem.

I'm not sure if the new toolchain stuff is completely alpha core-dump
savvy.  When using the symbols out of the kernel, it ends up making the
wrong decisions about when the stack frame ends.  Also, I think that since
in this case I'm getting a kernel trap, it doesn't quite know what the
saved state of a kernel trap is, since (when I use it) it's actually missing
a frame.  But after banging on it a bit, it gives me as much of a traceback
as it did without symbols, so I call that an improvement :-)

In case anyone's interested, a patch is appended.

A lot of people asked me about AFS for NetBSD/Alpha.  If I get it working,
then I'll make an announcement.  Otherwise, assume that I've crashed and
burned like better people before me :-)

(Current status -- creates local disk cache, mounts /afs, but cannot talk
to vldb servers.  Simple pioctls (like setpag) work).

--Ken

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <28583.863235087.2@cmf.nrl.navy.mil>
Content-Description: Patch for Alpha toolchain sources

*** ./config/alpha/nm-nbsd.h.orig	Thu May  8 01:14:45 1997
--- ./config/alpha/nm-nbsd.h	Wed May  7 18:36:07 1997
***************
*** 63,69 ****
  	  kernel_debugging = 1; \
  	  break;
  
! #define	ADDITION_OPTION_HELP \
  	"  --kernel           Set kernel debugging mode.\n"
  
  #define	DEFAULT_PROMPT \
--- 63,69 ----
  	  kernel_debugging = 1; \
  	  break;
  
! #define	ADDITIONAL_OPTION_HELP \
  	"  --kernel           Set kernel debugging mode.\n"
  
  #define	DEFAULT_PROMPT \
*** ./config/alpha/tm-alphanbsd.h.orig	Thu May  8 01:17:40 1997
--- ./config/alpha/tm-alphanbsd.h	Fri May  9 16:33:37 1997
***************
*** 10,12 ****
--- 10,18 ----
  #undef CANNOT_STEP_BREAKPOINT 
  
  #define	SOLIB_BKPT_NAME		"__start"
+ 
+ #define FRAME_CHAIN_VALID(chain, thisframe)	\
+ 	((chain) != 0 &&			\
+ 	 (kernel_debugging ? (!inside_main_func ((thisframe) -> pc)	\
+ 			&& !inside_entry_func ((thisframe) -> pc)) :	\
+ 		(!inside_entry_file (FRAME_SAVED_PC (thisframe)))))
*** ./alpha-tdep.c.orig	Fri May  9 16:20:42 1997
--- ./alpha-tdep.c	Fri May  9 23:13:57 1997
***************
*** 661,667 ****
      sym = NULL;
    else
      {
!       if (startaddr > BLOCK_START (b))
  	/* This is the "pathological" case referred to in a comment in
  	   print_frame_info.  It might be better to move this check into
  	   symbol reading.  */
--- 661,667 ----
      sym = NULL;
    else
      {
!       if (kernel_debugging || startaddr > BLOCK_START (b))
  	/* This is the "pathological" case referred to in a comment in
  	   print_frame_info.  It might be better to move this check into
  	   symbol reading.  */
***************
*** 741,747 ****
      alpha_extra_func_info_t proc_desc;
      CORE_ADDR saved_pc = FRAME_SAVED_PC(frame);
  
!     if (saved_pc == 0 || inside_entry_file (saved_pc))
        return 0;
  
      proc_desc = find_proc_desc(saved_pc, frame);
--- 741,747 ----
      alpha_extra_func_info_t proc_desc;
      CORE_ADDR saved_pc = FRAME_SAVED_PC(frame);
  
!     if (saved_pc == 0 || (!kernel_debugging && inside_entry_file (saved_pc)))
        return 0;
  
      proc_desc = find_proc_desc(saved_pc, frame);
***************
*** 762,768 ****
  	&& PROC_FRAME_OFFSET (proc_desc) == 0
  	/* The previous frame from a sigtramp frame might be frameless
  	   and have frame size zero.  */
! 	&& !frame->signal_handler_caller)
        return FRAME_PAST_SIGTRAMP_FRAME (frame, saved_pc);
      else
        return read_next_frame_reg(frame, PROC_FRAME_REG(proc_desc))
--- 762,768 ----
  	&& PROC_FRAME_OFFSET (proc_desc) == 0
  	/* The previous frame from a sigtramp frame might be frameless
  	   and have frame size zero.  */
! 	&& !frame->signal_handler_caller && !kernel_debugging)
        return FRAME_PAST_SIGTRAMP_FRAME (frame, saved_pc);
      else
        return read_next_frame_reg(frame, PROC_FRAME_REG(proc_desc))

------- =_aaaaaaaaaa0--