home *** CD-ROM | disk | FTP | other *** search
/ Amiga GigaPD 3 / Amiga_GigaPD_v3_3of3.iso / netbsd / docs / mailinglist-archive / 1993-08 / text0178.txt < prev    next >
Encoding:
Text File  |  1993-06-25  |  1.3 KB  |  26 lines

  1.     I'm trying to get gdb working here on my 613-based kernel, but
  2. am currently hung up in u-area stuff.  I'm hoping there are some kernel
  3. gurus out there who help me understand this.
  4.  
  5.     At various points, gdb needs to get CPU register values from
  6. the process being debugged; it uses ptrace() for this.  What the
  7. amiga-specific code (based on the hp300 code) in gdb does first when it
  8. wants a register value is use ptrace() to get the u.u_kproc.kp_proc.p_regs
  9. pointer from the inferior process.  This is supposed to point to a
  10. frame structure which contains a copy of the inferior's exception stack
  11. frame (at least it contains the same kind of stuff -- cpu context).
  12. The gdb code then uses this address (appropriately indexed) in another
  13. ptrace() call to actually get the register value.  OK, sounds good.
  14. The problem is that u.u_kproc.kp_proc.p_regs is set up by the CPU trap
  15. code to point into the frame structure that is passed to it by value.
  16. In other words, p_regs points somewhere on the interrupt stack.  Oops.
  17. ptrace EFAULTs on these addresses, but even if it didn't, how can the
  18. pointer still point to something valid?
  19.  
  20.     This has really got me stumped.
  21.  
  22. --
  23. ------------------------------------------------------------------------
  24. Andy Heffernan                                            ahh@netcom.com
  25.  
  26.