mode. This allows one to use kgdb on /dev/mem and be able to patch memory
on a live system. This is identical to what -wcore used to do in previous
gdb versions for FreeBSD.
Requested by: wpaul
list of frame sniffers so that trapframes can be detected. The kluge
is needed because this version of gdb only supports appending a
sniffer to the list of sniffers and the moment kgdb gets a chance to
add its own frame sniffer, the target's default frame sniffer is
already in the list. Since the default frame sniffer claims any
frame thrown at it, kgdb's frame sniffer never gets to smell (a
process much akin to tasting, but with lesser chance of hurling :-)
This commit adds dummy frame sniffers that never claim a frame and
as such don't fix anything yet. However, we now have frame sniffers
and they are being called, so it's just a matter of adding meat to
the bones and we'll be able to properly unwind across trapframes.
MFC after: 1 week
command does, but worse.
o Remove the obscure proc command, because it does what the thread
command does, but not unambigously.
o Move the PID to the extra thread info, where it makes sense and
where it doesn't confuse users. The extra thread info holds some
process information, to which the PID belongs.
o Implement the to_find_new_threads target method by having it call
the target beneath us if we're not using KVM. This makes sure that
new threads are found when using the remote target.
o Fix various core dump scenarios:
- Implement the to_files_info target method. Previously the
'info target' command would cause a NULL pointer dereference.
- Don't assume there's a current thread. We're not initialized
in all cases. This prevents a NULL pointer dereference.
- When we're not ussing KVM, have the to_xfer_memory target
method call the target beneath us. This avoids calling into
KVM with a NULL pointer.
MFC after: 1 week
static.
o Register a function with atexit(3) to close the KVM object if
we have one open.
o Show the unread portion of the kernel's message buffer before
presenting the prompt. It's bound to provide some useful info.
o Don't call kgdb_target() twice. It results in having all threads
listed twice.
MFC after: 1 week
in future calls, so we can't free it here. The right place to free the
buffer would be to be after kvm_close(), but we don't do that yet. A
static buffer would work too.
Reviewed by: marcel (who has other plans for this anyway)
Approved by: re
it to recognise what ABI to use on amd64 (and possibly others) platform.
Display PID and process name as a part of the 'info threads' output, TIDs
alone are too confusing. Introduce new commmands 'tid <tid>' and 'proc <pid>'
to accompany gdb's default 'thread <thread num>' to make the task of switching
between different contexts easier.
lwp ID before invoking the underlying target operation.
For corefiles, we rely on gdb internals to do this, and it uses the
pid as an index, rather than the lwpid, so previously, backtraces
for multithreaded core files wasn't working correctly. For processes,
we currently use ptrace directly, so fixup that code to also use
the pid directly.
Discussed With: marcel, davidxu
MFC After: 4 days
solib-svr4.c to the MD makefiles because they are native files for
alpha and sparc64, but target files for amd64, i386 and ia64.
Note that kgdb(1) does not yet build as a cross-debugger due to
libkvm.
Document all options and general usage.
Implement the -a option to bump the annotation_level. This improves
the Emacs gud behaviour. You can now supply the following function
(defun gud-gdb-massage-args (file args) (cons "-a" args))
(e.g. by evaluating it from the *scratch* buffer) and get the normal
jump to the source window when browsing the stack.
We should probably eventually supply our own kgdb submode to gud.el.
Implement the -a option to bump the annotation_level. This improves
the Emacs gud behaviour. You can now supply the following function
(defun gud-gdb-massage-args (file args) (cons "-a" args))
(e.g. by evaluating it from the *scratch* buffer) and get the normal
jump to the source window when browsing the stack.
We should probably eventually supply our own kgdb submode to gud.el.
changes, start on a new line. Insertion of a filename will keep the
diff limited to the block of filenames that have the same first letter
instead of creating a huge diff. While here, move remote.c after the
remote-*.c files and move tui.c after the tui-*.c files. This matches
the order of ls(1) and makes it easier to compare object files created
by a stock gdb(1) build with the list of files we have here.
This is a non-functional change only.
make sure it is a device. GDB special cases these prefixes and treats
:#### as a tcp port on localhost and executes what ever follows '|'.
This allows kgdb to debug via dconschat.
Discussed with: marcel
with the currently running kernel image. Otherwise, one of -c, -n or
-r is expected for working on a particular core file (-c), working
on a saved dump (-n) or working remotely (-r). When working on a
saved dump, a kernel may be omitted.
For a remote debugging session (-r), kgdb(1) will use the specified
device.