freebsd-nq/gnu/usr.bin
John Baldwin 3461a0f244 Rework how kgdb manages kernel and vmcore files to be a bit more gdb-ish
so that kgdb can be used more like a normal gdb:
- Load the kernel via the standard 'exec' target and allow it to be changed
  via the 'file' command.
  - Instead of explicitly loading the kernel file as the mail symbol file
    during startup, just pass it to gdb_main() as the executable file.
  - Change the kld support (via shared libraries) to cache the address of
    the linker_files and linker_kernel_file variables in addition to the
    offsets of various members in 'struct linker_file'.
  - When a new symbol file is loaded, recompute the addresses and offsets
    used by the kld support code.
  - When a new symbol file is loaded, recalculate the ofs_fix variable to
    account for the different ways a trapframe can be passed to trap
    frame handlers in i386.  This is done by adding a MD
    kgdb_trgt_new_objfile() hook that is empty on all but i386.
  - Don't use the directory name of the kernel specified on the command
    line to find kernel modules in the kld support code.  Instead,
    extract the filename of the current executable via exec_bfd.  Now
    the 'kernel' variable is private to main.c again.
  - Make the 'add-kld' command explicitly fail if no executable is loaded.
- Make the support for vmcores a real core-dump target that opens the
  kernel and vmcore on open and closes the kvm connection when closed, etc.
  - The 'core' command can now be used to select a vmcore to use, either
    a crash dump file or /dev/mem for live debugging.
  - The 'detach' command can be used to detach from a vmcore w/o attaching
    to a new one.
  - kgdb no longer explicitly opens a core dump during startup and no longer
    has to use an atexit() hook to close the kvm connection on shutdown.
  - Symbols for kld's are automatically loaded anytime a core is opened.
    Also, the unread portion of dmesg is dumped just as it was done on kgdb
    startup previously.
- Don't require either a remote target or core dump if a kernel is specified.
  You can now just run 'kgdb kernel' similar to running gdb on an executable
  and later connect to a remote target or core dump.
- Use a more relaxed way to verify remote targets specified via -r.
  Instead of explicitly allowing a few non-file target specifications,
  just assume that if stat() on the arg and on "/dev/" + arg both fail
  that is some non-file target and pass it to gdb.
- Don't use a custom interpreter.  The existing kgdb_init() hook and the
  target_new_objfile() hook give us sufficient hooks during startup to
  setup kgdb-specific behavior now.
- Always add the 'proc', 'tid', and 'add-kld' commands on startup and not
  just if we have a core dump.  Currently the 'proc' and 'tid' commands do
  not work for remote targets (I will fix at least 'tid' in the next round
  of changes though).  However, the 'add-kld' command works fine for
  loading symbols for a kernel module on a remote target.
- Always setup the 'kld' shared library target operations instead of just
  if we have a core dump.  Although symbols for kernel modules are not
  automatically loaded when connecting to a remote target, you can do
  'info sharedlibrary' after connecting to the remote target and kgdb will
  find all the modules.  You can then use the 'sharedlibrary' command to
  load symbols from the module files.
- Change kthr_init() to free the existing list of kthr objects before
  generating a new one.  This allows it to be invoked multiple times
  w/o leaking memory.

MFC after:	1 week
2008-04-29 20:32:45 +00:00
..
bc Reimplementation of world/kernel build options. For details, see: 2006-03-17 18:54:44 +00:00
binutils Add support for the 32-bit EFI target. 2008-04-17 23:36:35 +00:00
cc Use LC_ALL=C before awk generating "optionlist" 2007-11-18 11:59:44 +00:00
cpio Compile with -DHAVE_LSTAT since, for whatever reason, the configure script 2005-10-06 09:49:37 +00:00
cvs Update for version 1.11-20080310. 2008-03-19 15:19:42 +00:00
dc Remove getopt*.c, we already have compatible getopt_long() in libc 2004-02-17 01:34:53 +00:00
dialog Reimplementation of world/kernel build options. For details, see: 2006-03-17 18:54:44 +00:00
diff style.Makefile(5) 2007-10-12 18:03:00 +00:00
diff3 Update build skeleton after diffutils 2.8.7 update. 2007-06-15 07:09:34 +00:00
gdb Rework how kgdb manages kernel and vmcore files to be a bit more gdb-ish 2008-04-29 20:32:45 +00:00
gperf Remove getopt*.c, we already have compatible getopt_long() in libc 2004-02-17 01:49:20 +00:00
grep Add the -P option back, but with a note that it is not supported on FreeBSD. 2006-10-11 09:52:32 +00:00
groff Bump the default .Os version to FreeBSD 8.0. 2008-02-23 19:27:54 +00:00
man getopt(3) returns -1, not EOF. 2008-02-19 07:09:19 +00:00
patch Get rid of a spurious "the". 2004-03-18 20:36:14 +00:00
rcs Remove kludges intended to support src trees with partial obj trees. 2005-06-10 06:12:53 +00:00
sdiff Update build skeleton after diffutils 2.8.7 update. 2007-06-15 07:09:34 +00:00
send-pr Add 'arm' category. 2008-04-23 03:05:31 +00:00
sort style.Makefile(5) 2007-10-12 18:15:40 +00:00
texinfo Catch up with the demise of /usr/X11R6 2007-09-19 14:21:18 +00:00
Makefile Re-enable the CVS build. 2008-03-19 15:21:44 +00:00
Makefile.inc