Commit Graph

383 Commits

Author SHA1 Message Date
Marcel Moolenaar
2a5bd389cf Unwind across trapframes. All kernel entries are handled.
MFC after: 1 week
2005-09-10 23:11:54 +00:00
Marcel Moolenaar
35f38699dc Unwind across trap frames. This adds most of the meat. The sniffer
just needs to be taught about all the other entry points and the
unwinder needs to be taught about the frame variation between them.

MFC after: 1 week
2005-09-10 22:03:09 +00:00
Marcel Moolenaar
a8f01390e1 Unwind across trap frames. This adds most of the meat. The sniffer
just needs to be taught about all the other entry points and the
unwinder needs to be taught about the frame variation between them.

MFC after: 1 week
2005-09-10 21:01:36 +00:00
Marcel Moolenaar
6ab0894870 Unwind across trap frames. This adds most of the meat. The sniffer
just needs to be taught about all the other entry points and the
unwinder needs to be taught about the frame variation between them.

MFC after: 1 week
2005-09-10 20:12:52 +00:00
Marcel Moolenaar
c67d07416a Add a kluge to allow kgdb(1) to inject its own frame sniffer in the
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
2005-09-10 18:25:53 +00:00
Marcel Moolenaar
3b347f6ccc Fix backtraces. Supply registers from the register window.
MFC after: 3 days
2005-08-16 05:13:57 +00:00
Marcel Moolenaar
688deacdfa o Remove the obscure tid command, because it does what the thread
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
2005-08-06 19:22:27 +00:00
Marcel Moolenaar
9ca14a4113 o As mentioned in the previous commit: make the KVM error buffer
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
2005-08-06 19:07:07 +00:00
Giorgos Keramidas
75eb780790 Spell "currently" correctly. 2005-07-28 15:59:52 +00:00
Peter Wemm
8015e78d5d kvm_openfiles() uses the supplied buffer for storing error messages
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
2005-06-24 00:50:12 +00:00
Doug Rabson
8d7681bb7f Add support for XMM registers in GDB for x86 processors that support
SSE (or its successors).

Reviewed by: marcel, davidxu
MFC After: 2 weeks
2005-05-31 09:43:04 +00:00
David Xu
e8595f94cd Don't try to enable event reporting for core file, it is not writable. 2005-05-06 11:01:15 +00:00
David Xu
e6e653cd66 Report events from thread library. 2005-04-12 03:04:04 +00:00
David Xu
0d6c666e74 Print thread address.
PR: threads/76821
2005-04-05 11:40:58 +00:00
Marcel Moolenaar
7c6ae50b9d Implement and document the -q and -f options with their corresponding
long form (-quiet and -fullname resp.) Bump documentation date.

PR: bin/78031
MFC after: 5 days
2005-03-02 18:40:04 +00:00
David E. O'Brien
39e38e7623 .It the -v option. 2005-03-01 20:41:38 +00:00
Alexander Kabaev
d723452067 Restore r1.2 change to use TARGET_ARCH.
Submitted by:	kris
2005-02-20 23:06:03 +00:00
Alexander Kabaev
325ce5d8fb Attempt to make kgdb little more useful and easy to use. Properly initialize
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.
2005-02-20 22:55:07 +00:00
Marcel Moolenaar
56c1065a47 Remove mention of the -k and -wcore options because they don't
exist anymore.

PR: doc/70943
Submitted by: Jun <junsu at delphij dot net>
Reviewed by: delphij
2005-02-15 07:13:51 +00:00
David E. O'Brien
01950bb64f Use the system gnuregex library vs. building GNU regex bits into libiberty
and using them.

Reviewed by:	marcel,imp
Desired by:	ache
2005-02-14 12:10:14 +00:00
Ruslan Ermilov
42b28e8149 Markup nits. 2005-01-13 10:07:51 +00:00
Peter Edwards
ad93bc4a36 When grabbing registers for an lwp, fake the inferior's pid using the
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
2005-01-11 14:53:16 +00:00
Ruslan Ermilov
e653b48c80 Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
Marcel Moolenaar
6add7f75e4 Source changes to allow building a cross-debugger. Move solib.c and
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.
2004-12-05 06:59:01 +00:00
Marcel Moolenaar
3edecb0846 Fix previous commit. GDB_CROSS_DEBUGGER needs to be defined for all
subdirectories.
2004-12-05 04:08:22 +00:00
Marcel Moolenaar
20a9661305 Makefile (only) changes to allow building a cross debugger. 2004-11-30 05:12:37 +00:00
Marcel Moolenaar
88bca61ea5 s/MACHINE_ARCH/TARGET_ARCH/. We use TARGET_ARCH to pick the MD files
for libgdb and should do so here as well.
2004-11-30 02:56:53 +00:00
Joerg Wunsch
466bc517d1 [Sorry, forgot to commit my source changes in my previous commit.]
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.
2004-11-22 16:08:19 +00:00
Joerg Wunsch
fa632bb17f 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.
2004-11-22 16:07:28 +00:00
Joerg Wunsch
05127e036e Fix the abuse of Ar macros for designating flag options, use Fl instead. 2004-11-22 15:43:46 +00:00
David Xu
ba4030c7ad Always set current thread when activating thread debugger,
the current thread may already be added by fbsd_find_new_threads,
this can result that current thread is not set correctly.
2004-11-15 13:06:01 +00:00
Marcel Moolenaar
d303220319 Whitespace fix. 2004-11-09 06:32:37 +00:00
Marcel Moolenaar
8170ab332c Prepare for a subsequent import: If the first letter of the filename
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.
2004-11-09 06:02:48 +00:00
Ruslan Ermilov
a35d88931c For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
Andrey A. Chernov
082a6f6612 Update to readline 5.0 2004-10-18 10:13:24 +00:00
Brooks Davis
f52501ba8c If the argument to the -r flag starts with a ':' or a '|', don't try to
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
2004-09-03 07:11:42 +00:00
David Xu
a1ad8d2ae7 Only compile fbsd-thread.c on amd64 and i386, other architectures
have not been tested yet.
2004-08-22 10:59:33 +00:00
David Xu
44f53819a6 Fix comments, most are style fix. 2004-08-22 09:05:57 +00:00
David Xu
386c57b571 Fix some text messages. 2004-08-22 08:48:56 +00:00
David Xu
97dc8984f9 Add code to support statically linked binary and .core file of threaded
program.
2004-08-22 05:53:38 +00:00
Marcel Moolenaar
7a5bf37951 Improve the usage. Without any arguments, kgdb(1) works on /dev/mem
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.
2004-08-15 02:39:20 +00:00
David Xu
4eb32c7e19 Initialize thread_db module. 2004-08-10 12:20:00 +00:00
David Xu
2c4abc3eb7 Initialize thread_db module. 2004-08-08 22:46:22 +00:00
David Xu
d771a99114 1. Add some code check if thread suspending or resuming is failed.
2. Add code to retrieve thread tls address.
2004-08-08 22:45:36 +00:00
Marcel Moolenaar
d7d921e37e Hook kgdb into the build. 2004-07-25 05:32:50 +00:00
Marcel Moolenaar
60b992ff2f Add the beginnings of kernel debugging support. the kgdb(1) tool
is basicly a shell on top of libgdb that knows about kernel threads,
kernel modules and kvm(3). As the word "beginnings" implies, not
all of the features have been implemented yet. The tool is useful
and I'd like feedback on the taken route.

The simplest way to debug a kernel core file is:
	kgdb -n 0

This opens /var/crash/vmcore.0 with the corresponding kernel in
the object directory (kernel.debug is used if it exists).

Typical things that need to be added are:
o  Auto loading of kernel modules,
o  Handling of trapframes so that backtraces can be taken across
   them,
o  Some fancy commands to extract useful information out of a core
   file,
o  Various (probably many) other things.
2004-07-25 05:29:15 +00:00
Marcel Moolenaar
6ec5fc1963 o ps_pd{read|write} and ps_pt{read|write} are obsolete interface
functions. Only ps_p{read|write} remains.
o  Remove ps_getpid. We don't need it now.
2004-07-17 17:08:13 +00:00
David Xu
794adb75ee ptrace's first parameter is command not pid. pointy hat to me. 2004-07-16 06:11:48 +00:00
Marcel Moolenaar
306fc21ba1 Update config.h to account for the prgregset_t and psaddr_t types
that have been added to <sys/procfs.h>. This change has no effect
because the source file that would be affected is not compiled on
FreeBSD. Hence, this is for completeness only.
2004-07-16 05:03:42 +00:00
David Xu
2136835712 Add libthread_db assisted debugging support module. 2004-07-15 04:51:04 +00:00
David E. O'Brien
0b0edffbbb Prepare for upcoming Binutils house cleaning. 2004-07-06 21:55:11 +00:00
Marcel Moolenaar
f8a1406eca We don't have to reach into binutils/doc anymore for inc-hist.diff
The file was repo copied into our doc directory.
2004-06-27 03:33:17 +00:00
Bruce Evans
e0345d1748 Fixed world breakage in the NOSHARED=yes case (missing library).
Fixed some style bugs.
2004-06-26 08:48:50 +00:00
Marcel Moolenaar
a855a971e8 Add bmake glue for gdb 6.1.1. Supports alpha, amd64, i386, ia64
and sparc64.

Note that the debugger doesn't support threading, nor kernel
debugging yet.
2004-06-25 06:48:54 +00:00
Sheldon Hearn
8e887555b5 Reconnect gdb info file to the build.
Submitted by:	Szilveszter Adam <sziszi@bsd.hu>
2002-07-01 07:58:18 +00:00
Andrey A. Chernov
7b8ab0d8c9 Upgrade for readline 4.2 2001-04-11 04:27:10 +00:00
Peter Wemm
3ef5063241 A bandaid to try and make this buildable. This should probably be
rechecked by somebody who knows what is meant to happen here. The new
libreadline rluser.texinfo file duplicates the '@defcodeindex bt' entry.
2000-03-20 10:52:28 +00:00
Doug Rabson
227d42bebc Remove old bmake framework for gdb. It has moved to live next to binutils. 1999-05-02 19:51:47 +00:00
Luoqi Chen
d53bd1ea8d Make gdb work with kernel after the SMP vmspace sharing changes. 1999-04-28 01:27:55 +00:00
Bruce Evans
146fe9aaf2 echo -> ${ECHO}. 1999-04-03 07:04:53 +00:00
Bruce Evans
cc4fb50148 Fixed breakage of gdbreplay's and gdbserver's BINDIR in previous commit.
They may belong in /usr/libexec/{aout,elf}, but objformat doesn't
support that.

Fixed bogus `?=' assignments for BINDIR.
1998-10-15 14:15:09 +00:00
Peter Wemm
54751142df Install gdb in /usr/lib/aout or /usr/lib/elf depending on format. 1998-10-15 00:15:01 +00:00
John Polstra
e8f80c1aca Fix GDB so that it can handle ELF core dumps. 1998-09-14 22:49:02 +00:00
John Birrell
050c06f9e2 Missed some BINFORMATs. Fingers! Can't live with 'em. Can't live without 'em. 1998-08-30 02:46:35 +00:00
John Birrell
0e94cd8261 BINFORMAT -> OBJFORMAT ready for E-day. I tossed a coin to decide this
one. We'll probably need to revisit gdb after E-day.
1998-08-30 02:01:07 +00:00
Bruce Evans
09d693f205 Fixed printf format errors. 1998-06-30 20:48:45 +00:00
Bruce Evans
e7c80443b4 Don't attempt to read process context from the kernel when (the
kernel's) curproc is null.  This fixes endless recursion in
xfer_umem() for attempts to read from user addresses, in particular
for attempts to read %fs and %gs from the pcb for `info reg'.
1998-05-12 16:49:13 +00:00
Bruce Evans
e4e61e7b97 Simplified using new yacc rules. This is cosmetic - the old rules
worked because .ORDER prevented problems from concurrent generation
of multiple parsers (and their headers), and there were no missing
dependencies because the generated headers were not actually used.
1998-05-04 17:56:22 +00:00
Bruce Evans
cca078f55e Inherit BINDIR properly. 1998-05-01 14:48:06 +00:00
Bruce Evans
2b3c4dd72c Fixed apparent bitrot (=' changed to ?=') in the definition of BINDIR
in the previous commit.  Just don't define it here at all.  This works
now that the default is inherited properly.
1998-05-01 14:44:00 +00:00
Bruce Evans
b2198963be Removed self-inclusion-prevention ifdef. It is unnecessary now that
bsd.man.mk doesn't include ${.CURDIR}/../Makefile.inc.

Removed GDBDIR-redefinition-prevention ifdef.  It hasn't done anothing
for a long time, if ever.  The directory is defined to the same value in
each subdir and had the same value because all subdirs are at the same
level.  Keep defining it in the subdirs since that is more flexible and
no more verbose.

Prepare to inherit BINDIR by including ../Makefile.inc.
1998-05-01 14:37:36 +00:00
Bruce Evans
9ca48245eb Oops, This should have been committed with the Makefile change that
requires the new file.

Fixed stale near-copy of contrib/libreadline/doc/hsuser.texinfo.  Patch
it at build ntime, and only keep the patch for it here.

Don't keep a copy of contrib/gdb/gdb/doc/all-cfg.texi here.  Link to it
at build time.
1998-05-01 14:13:00 +00:00
Bruce Evans
5da6b79d47 Fixed dependencies.
Fixed stale near-copy of contrib/libreadline/doc/hsuser.texinfo.  Patch
it at build ntime, and only keep the patch for it here.

Don't keep a copy of contrib/gdb/gdb/doc/all-cfg.texi here.  Link to it
at build time.
1998-05-01 14:08:30 +00:00
Doug Rabson
0f9bd807c9 Add support for ELF shared libraries. Also use bfd from the binutils in that
case rather than gdb's own copy.
1998-04-30 08:03:50 +00:00
Bruce Evans
3f9af06bf9 Removed vestiges of use of beforedepend target. 1998-03-19 15:21:19 +00:00
Bruce Evans
6dd8984675 Use foo/bar.a' instead of -Lfoo -lbar' for linking to static internal
libraries, so that `ld -f' in can create correct dependencies for
yet-to-be-built libraries.
1998-03-07 08:55:00 +00:00
Bruce Evans
5983a0d1cf Fixed printing of %fs and %gs for live kernels.
Only print the current pcb on startup.  Printing it every time a utility
routine was called messed up the register dump for live kernels.
1998-02-13 02:45:26 +00:00
Bruce Evans
9bb4a86cf0 Fixed accesses to addresses between VM_MAXUSER_ADDRESS (normally
0xefbfe000) and kernel_start (normally 0xf0100000).

Things are unnecessarily (?) difficult because procfs is used to
access user addresses in the live-kernel case although we must have
access to /dev/mem to work at all, and whatever works for the
dead-kernel case should work in all cases (modulo volatility of
live kernel variables).  We used the wrong range [0, kernel_start)
for user addresses.  Procfs should only work up to VM_MAXUSER_ADDRESS,
but it bogusly works for reads up to the address 2 pages higher
(the user area, including the kernel stack, is mapped to where the
user area used to be (WTUAUTB)).  Procfs can not work at all for
addresses between WTUAUTB and kernel_start.

Now we use procfs only to access addresses up to VM_MAXUSER_ADDRESS.
Higher addresses are translated normally using kvtophys(), so the
user ptd is used for addresses below the real kernel start (0xf0000000;
see INKERNEL()) and nothing is found WTUAUTB.

Strange accesses that cross the user-kernel boundary are now handled,
but such ranges are currently always errors because they necessarily
overlap the hole WTUAUTB.

Short reads are still not handled.
1998-01-19 15:27:56 +00:00
Bruce Evans
04822660a1 Removed `kstack' and associated mistranslations in kvtophys().
Correct translations would have been null.  However, kstack was
the top of the kernel stack instead of the base of the kernel stack
like it was when the kernel exported it, so the area above the
kernel stack was mistranslated and the kernel stack was not
translated.  This bug was depended on to compensate for the wrong
value of kstack - to read the pcb, instead of just using the address
of the pcb, we used the mistranslated address of kstack, which
happened to be the same (curpcb = kstack - 0x2000).

This area is simpler than it used to be now that the kernel stack
address is per-process.  The code still seems to be more complicated
than necessary - the `found_pcb == 0' case seems to be unused.
1998-01-19 14:27:41 +00:00
Bruce Evans
8c2c0a1d2f Fixed endless loop for `p/x *(int *)0xf0000000'. kvm_uread() in
gdb was cloned from the buggy version of kvm_uread() in libkvm and
had the same bugs.  It looped endlessly on EOF and checked errno
without setting it in the lseek() error check.  The first bug caused
gdb to loop endlessly for reads from addresses between the end of
the user area and the start of the kernel text.  kvm_uread() should
not be used for addresses beyond the end of the user area, but is
due to bugs elsewhere.
1998-01-18 13:18:55 +00:00
Bruce Evans
941b2747b6 Don't override FRAME_CHAIN(). If the current frame is valid, then
the previous frame is in the usual place even for traps, interrupts
and syscalls in the kernel, because the assembly language stubs
don't change the frame pointer.  The previous frame is just not for
the calling function.  We may as well depend on this as on magic to
determine the trap frame address.  The magic is in FRAME_SAVED_PC()
which elides the correct number of stubs (1) to go back to a pc that
matches the previous frame.

Removing fbsd_kern_frame_chain() fixes bugs in it.  Xsyscall was
misspelled as _Xsyscall (gdb removes one leading underscore), so
the tf_syscall frame type was never found.  This was harmless
because tf_normal works in all cases in fbsd_kern_frame_chain()
and Xsyscall is spelled correctly in fbsd_kern_frame_saved_pc()
where it matters.  There were style bugs on almost every line,
starting with a primary indent of 7.
1998-01-18 12:35:48 +00:00
Bruce Evans
82f143c642 Fixed sloppy definitions of SIGTRAMP_START and SIGTRAMP_END. The old
range was a little too large.
1998-01-18 11:51:48 +00:00
Bruce Evans
d76f78c43c Pass the system name to dmesg. Rev.1.7 only works when the symbols in
/kernel aren't too different form those in the kernel being debugged.
1998-01-17 17:07:53 +00:00
Bruce Evans
a821e7134b Exec dmesg and awk to print everything in the message buffer
following "panic:" or "Fatal trap".  `panicstr' is still printed,
although it is redundant if there is a valid message buffer and
incomplete if it contains `%'s.  I think the awk command belongs
here and not in a script since a standard format with complete
messages is good for bug reports.
1997-12-19 21:37:18 +00:00
Bruce Evans
a964cd4bba Implemented "info float" for core files.
Implemented reading of %fs and %gs from core files.

Print weird floating point values better.  We have to convert long
doubles to doubles here because of limitations and bugs in printf()
and floatformat_to_double() (long doubles aren't really supported
and naive converion to double causes exceptions).  Conversion loses
information about weird formats (everything becomes a quiet NaN),
and printf() doesn't know about different types of NaNs anyway.
1997-11-23 09:18:18 +00:00
Peter Wemm
5c97f357a9 #include <machine/tss.h> explicitly 1997-10-10 12:53:27 +00:00
Jordan K. Hubbard
97fe7f477f Changes to support full make parallelism (-j<n>) in the world
target.
Reviewed by:	<many different folks>
Submitted by:	Nickolay N. Dudorov" <nnd@nnd.itfs.nsk.su>
1997-10-05 09:40:24 +00:00
Bruce Evans
d1ef093383 Support 4MB pages. 1997-07-27 18:29:04 +00:00
Bruce Evans
64bb6c3420 Don't define HOST_DATA_START_ADDR, since gdb works without it the
previous definition doesn't work on BSD4.4Lite[2] derived systems
without the changes in rev.1.27 of kern_proc.c.
1997-07-13 14:31:54 +00:00
Bruce Evans
68f69edcb6 Removed -I path to gdb's readline. This didn't do much in -current
because the -I path to config/libreadline had precedence, but in
2.2 it help hide the bug that the -I path to the non-contrib
libreadline was garbage.
1997-06-30 23:10:54 +00:00
Bruce Evans
7569c70b61 gdb.info still needs a near-copy of hsuser.texinfo to avoid the
reference to the programming manual.  Use this near-copy of the version
of hsuser.texinfo in contrib/libreadline instead of the stale near-copy
in contrib/gdb.
1997-06-30 12:57:58 +00:00
Tor Egge
47c8f7894f Don't depend upon the user structure having been aligned on a 8 KB boundary.
Reviewed by:	Peter Wemm <peter@spinner.dialix.com.au>
1997-06-27 15:48:22 +00:00
Peter Wemm
439ff84095 Zap some unused debugging printfs that I accidently left in. 1997-06-27 13:39:31 +00:00
Bruce Evans
b7542f0123 Support reading and writing of %fs and %gs (except from core files). 1997-06-07 04:50:43 +00:00
Gary Jennejohn
1735e8a3c8 delete kcorelow.c, it didn't produce any code and broke init.c
because 2 references to _initialize_kcorelow (the other one
from kvm-fbsd.c) resulted. This prevented gdb from working correectly.

delete kcorelow.c from XSRCS in the Makefile.
1997-05-02 11:22:51 +00:00
Paul Traina
371bcb2ecd Clean up merge from 2.2 (without spamming peter's changes) 1997-05-01 16:24:37 +00:00
Peter Wemm
5702598255 Patch up init.c generation so that it works in -current.. It was trying
to use files that do not exist here.  Also, fix(?) ${.OBJDIR}/init.c hack.
1997-05-01 13:40:57 +00:00
Peter Wemm
8808286693 Fix include of <sys/dir.h> to <dirent.h> - it hits a #warning 1997-05-01 13:36:35 +00:00
Paul Traina
5a05ca1d76 Fix up a spurious '@' I added at the last second 1997-05-01 00:26:43 +00:00
Paul Traina
54adf80955 Merge from 2.2: auto-gen init.c and add ser-tcp.c 1997-05-01 00:18:51 +00:00
Bruce Evans
a511e4a787 Fetch the registers from struct members in the pcb instead of
punning the pcb to an array of ints and using magic indices to
access values in it.  This should prevent silent breakage from
changes in the pcb.

Supply 0 for unavailable registers instead of punning the tss to
an array of ints and using magic indices to access garbage values
in it.  (The registers are in the pcb; there is nothing interesting
in the tss.  This should change someday.  At least for dumps, all
the registers should be saved, and common_tss is a good place to
put them.)

Removed ancient wrong (disabled) method for reading eip.
1997-04-30 15:33:56 +00:00
Bruce Evans
ae105a60aa Backed out previous change. It just gave a more verbose Makefile by
repeating the default for MAN1.
1997-04-30 15:23:02 +00:00
Gary Jennejohn
3e3d6b2e21 change kvm-fbsd.c so that kernel debugging works again.
document the -k and -wcore options in the manpage.

change Makefile to use a local copy of the manpage.
1997-04-27 21:36:49 +00:00
Paul Traina
e620a3be19 Activate gdbserver and gdbreplay 1997-04-26 17:34:05 +00:00
Paul Traina
f3764e7923 Initial import of gdbserver FreeBSD support 1997-04-25 22:25:50 +00:00
Paul Traina
57f37775e5 Initial import of gdbreplay build structure 1997-04-25 22:25:22 +00:00
Peter Wemm
4f71948c41 Attempt to patch up gdb so that it has a chance of working with the new
UPAGES layout.. it was entirely too comfortable with reading and writing
the U area before.  I've changed it to use PT_GETREGS/PT_PUTREGS
ptrace ops instead of READ_U etc.  The code to read the registers from
core dumps is a bandaid at best.  It seems to have problems reading
core dumps from dynamic linked executables still, but at least static
dumps work.

I desperately need help from a gdb/bfd expert. :-)  HELP!!
1997-04-07 08:08:20 +00:00
Peter Wemm
c65bfffcff generate c-exp.c, f-exp.c and m2-exp.c with yacc rather than using
the generated ones in the gdb dist.
1997-03-29 10:33:13 +00:00
Peter Wemm
a46132c1a2 Protect against multiple inclusion (All the CFLAGS+= items make the cc
command lines get rather long).  (bsd.lib.mk is particularly bad at this)
1997-03-29 10:29:40 +00:00
Gary Jennejohn
79a5f47589 delete the LINKS line (link gdb to kgdb) by popular demand. 1997-03-15 20:59:59 +00:00
Gary Jennejohn
ebab7e8272 add LINKS line to Makefile to automatically produce a link to kgdb
define START_PROGRESS in nm.h to check whether gdb was invoked as kgdb
and set the kernel_debugging flag in that case.

2.2 candidate ?
1997-03-12 22:34:09 +00:00
Peter Wemm
fce15c9ab3 Revert $FreeBSD$ to $Id$ 1997-02-22 15:48:31 +00:00
Bruce Evans
b067dd150c Oops, the last commit shouldn't have removed floatformat.c. 1997-02-15 16:24:41 +00:00
Bruce Evans
3b81404039 Don't use the private version of vasprintf(). It doesn't understand
"%%" in format strings and tends to dump core for "%%st".  I needed
"%%st" to fix the new gdb ...

Don't use the private version of strerror() either.

Use INTERNALLIB and INTERNALSTATICLIB instead of a private install
rules NOPROFILE and NOPIC.  This is only slightly cleaner.
INTERNALLIB was previously only used in compatibility libraries
(libgnumalloc etc.) and INTERNALSTATICLIB was previously unused.
INTERNAL*LIB probably should be replaced by something like NOSTATICO
together with NO{STATICO,PROFILE,PIC}INSTALL.
1997-02-15 16:14:52 +00:00
Jordan K. Hubbard
cb0a6fc85f Remove -lmalloc; it's no longer relevant.
Pointed-Out-By: jdp, dima and others.
1997-01-17 06:32:35 +00:00
Andrey A. Chernov
1d31680ea6 Simplify it using SRCDIR 1997-01-16 17:58:14 +00:00
Gary Jennejohn
753f57aff1 Remove mmalloc since we're now using phkmalloc. This is made possible
by the -DNO_MMALLOC flag in gdb/Makefile.

The one thing we lose by doing this, AFAIK, is the possibility of using
mmap. Does anyone use that feature at all ?

2.2 candidate ?
1997-01-15 22:47:36 +00:00
Gary Jennejohn
9d5922197f Changes required in directory libiberty to make gdb from the sources in
/usr/src/contrib/gdb.

This is based on /usr/ports/devel/gdb.

2.2 candidate ?
1997-01-15 22:43:15 +00:00
Gary Jennejohn
69a0423e5e The files in gdb/elf are now grabbed from /usr/src/contrib/gdb/include/elf.
This also applies to the last 2 commits for aout and coff. Oops !

This is based on /usr/ports/devel/gdb.

2.2 candidate ?
1997-01-15 22:41:13 +00:00
Gary Jennejohn
86cf61adfa The files in gdb/coff are now grabbed from /usr/src/contrib/gdb/coff.
This is based on /usr/ports/devel/gdb.

2.2 candidate ?
1997-01-15 22:39:08 +00:00
Gary Jennejohn
06e8c5e416 The files in gdb/aout are now grabbed from /usr/src/contrib/gdb/aout.
This is based on /usr/ports/devel/gdb.

2.2 candidate ?
1997-01-15 22:38:29 +00:00
Gary Jennejohn
86dd30cb93 changes required in the gdb directory for making gdb
using the sources in /usr/src/contrib/gdb.

This is based on /usr/ports/devel/gdb.

2.2 candidate ?
1997-01-15 22:37:09 +00:00
Gary Jennejohn
e5b4c7e3b4 changes required in the doc directory for making the gdb info
files using the texi sources in /usr/src/contrib/gdb/gdb/doc.

I put a pointer to /usr/src/contrib/libreadline/doc into
Makefile.inc in the hope that the appropriate files would be
picked up.

This is based on /usr/ports/devel/gdb.

2.2 candidate ?
1997-01-15 22:33:16 +00:00
Gary Jennejohn
ea2fdd1095 changes required in the bfd directory for making gdb
using the sources in /usr/src/contrib/gdb.

This is based on /usr/ports/devel/gdb.

2.2 candidate ?
1997-01-15 22:28:25 +00:00
Gary Jennejohn
2ead490eea changes required in the top-level directory for making gdb
using the sources in /usr/src/contrib/gdb.

This is based on /usr/ports/devel/gdb.

2.2 candidate ?
1997-01-15 22:26:11 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Peter Wemm
d42e7f260f Fix path to readline docs, since it's now in contrib 1997-01-12 06:33:27 +00:00
Joshua Peck Macdonald
ae0f6792aa Same deal. 1997-01-11 03:41:14 +00:00
Jordan K. Hubbard
655ad55f9c Fix bogosity with gdb documentation path.
Submitted-By: Chuck Robey <chuckr@glue.umd.edu> (with fix from me)
1997-01-07 04:41:18 +00:00
Gary Jennejohn
b7eed0a0c1 changes to gdb to:
1) add Garrett Wollman's trap frame resolving mods
2) make the `proc' command (kernel debugging) really work
3) allow use of a pid with the `proc' command (previously you had to
provide the address of the proc structure)

Unfortunately, the `proc' command won't work while doing remote debugging.
1996-10-29 21:52:21 +00:00
Bruce Evans
4523edce8b Really eliminated includes of the "temporary" backwards compatibility
header <sys/dir.h> in applications.  My previous sweep didn't find the
places that included it without needing it.
1996-09-24 08:43:04 +00:00
Jordan K. Hubbard
cd9a2f5c28 Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src.  This is the final version of the
patches, incorporating the feedback I've received from -current.
1996-06-24 04:26:21 +00:00
Bruce Evans
d85327d7bc Stop using the alias pcb_ptd' for pcb_tcc.tss_cr3'. Use the (existing)
alias `pcb_cr3' instead.  That is still one alias too many, but is convenient
for me since I've replaced the tss in the pcb by a few scalar variables in
the pcb.
1996-06-08 11:03:19 +00:00
Peter Wemm
37eb8f3805 Remove this version, it now comes from libc. 1996-05-27 11:02:40 +00:00
Wolfram Schneider
9fb933075e `mv'' -> `mv -f''
``rm'' -> ``rm -f''
so mv/rm may not ask for confirmation if you are not root
1996-05-07 23:19:49 +00:00
Poul-Henning Kamp
74de633578 PD_SHIFT -> PDRSHIFT
PGOFSET -> PAGE_MASK
1996-05-02 13:08:51 +00:00
Poul-Henning Kamp
1fa6b8217d NBPG -> PAGE_SIZE
Avoid using the struct pte stuff.
1996-05-02 09:42:45 +00:00
Peter Wemm
a5b996a7ec recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
Jordan K. Hubbard
4564c19cc7 Document the -k and -w flags.
Submitted by:	Gary Jennejohn <gj>
1995-12-19 23:42:56 +00:00
Rodney W. Grimes
4399be3cbd Remove trailing whitespace. 1995-05-30 05:05:38 +00:00
Rodney W. Grimes
1f2c9ce35f Submitted by: gj
Delete suspicious looking chunk of code that was partially commented out.
1995-05-09 13:59:22 +00:00
Rodney W. Grimes
eb0b975c2d Fix nested comments for -Wcomment warnings. 1995-05-09 12:58:53 +00:00
Jordan K. Hubbard
38f4846ec5 Gary J's patches to make gdb -w work properly.
Submitted by:	gj
1995-04-26 01:01:20 +00:00
Joerg Wunsch
e6073fb7f6 Fix for the ``gdb -k /nonexistent /dev/mem'' core dump.
Submitted by:	gj@freebsd.org (Gary Jennejohn)
1995-04-19 22:59:33 +00:00
Nate Williams
b6b718f326 as Thomas Graichen recently wrote in private mail:
> * the gdb-4.13 of current (compiled and used under 2.0R) can not attach to my
> own processes (it works only then i'm root - else i get open failed - for my
> own processes)

how embarassing ! This turns out to be a bug in infptrace.c. Below
is a patch. Could some kind soul apply it ?

Submitted by:	"Gary J." <garyj@rks32.pcs.dec.com>
1995-04-10 00:01:01 +00:00
Nate Williams
5a5755a556 Because -lcompat defines the same symbols as -lgnuregex and the weakness
of the linker to enforce linking of modules in command line order it is
not possible to link gdb shared with -lcompat.

*HACK ALERT*
Removed -lcompat from LDADD and bring in the necessary functions out of
libcompat as a source module until the linker can be fixed.
1995-04-07 05:13:26 +00:00
Bruce Evans
e322e6a55a Fix reading of stack addresses from core files. USRSTACK now really is
the (top of the) user stack.
1995-01-31 18:07:36 +00:00
Jordan K. Hubbard
5238dbaecc Here's a patch to gdb-4.13 to add dyadic frames, as per J"org Wunsch.
Could somebody apply it?
Submitted by:	gj
1995-01-17 13:52:39 +00:00
Jordan K. Hubbard
9d68e93aaf Good grammar and good taste, from Gary Jennejohn.
Submitted by:	gj
1995-01-12 11:47:02 +00:00
Andrey A. Chernov
fe80b9dc28 doc added 1995-01-11 16:40:08 +00:00
Andrey A. Chernov
ad04b53da0 Add annotate target 1995-01-11 16:38:10 +00:00
Andrey A. Chernov
eb9747a649 Install infopages 1995-01-11 16:29:45 +00:00
Andrey A. Chernov
8458a20f14 Remove regex code, use -lgnuregex instead 1995-01-06 21:26:39 +00:00
Bruce Evans
e15532385d Handle segment registers (except %fs and %gs). 1995-01-06 14:52:06 +00:00
Bruce Evans
19bc776351 Add more segment registers to list of registers (fake for %fs and %gs).
This might be useful for debugging applications that use a special LDT.
However, printing of all segment registers is currently broken.

Don't print "last exception: " before the FPU opcode and pc, etc.  The
opcode and pc, etc., are for the last FPU _instruction_.

Pass the saved exception status word to print_387_status() so that the
exception(s) that caused or will cause a trap can be seen.  The kernel
has supported this since 1.1 or before.  The kernel still clobbers the
tag word if a trap occurs.

Remove unused null function clear_regs().
1994-12-31 17:00:09 +00:00
Bruce Evans
ccd05d4df4 Fix declaration of i386_float_info(). 1994-12-31 16:56:43 +00:00
Bruce Evans
9d1e3dc7d8 Restore our local changes which were clobbered by the previous commit.
cvs is not being used effectively for gdb.  Our old changes get clobbered
and our new changes are mixed with "vendor" changes in the same updates
so they will be difficult to untangle for the next release of gdb.  The
revision logs get spammed for each release of gdb.
1994-12-31 16:34:59 +00:00
Bruce Evans
fcb54b3ee0 Hide yet another redefinition of PAGE_SIZE. Cosmetic. 1994-12-31 16:16:27 +00:00
Bruce Evans
bdeaa9bbc3 Restore our (cosmetic) local changes which were clobbered by the previous
commit (do them slightly differently).
1994-12-31 16:14:13 +00:00
Jordan K. Hubbard
3c8ea7601e Bring in the files added by Gary Jennejohn's gdb update.
Submitted by:	gj
1994-12-30 23:33:10 +00:00
Jordan K. Hubbard
01db5e69c1 Hurrah! Let the champagne flow, the olive oil barrel be opened and
the wild, slippery orgy commence!

Gary Jennejohn, too studly for his own good, has finally come through with
the new, improved gdb 4.13.  This gdb features:

o	kgdb support - if this works (and I urge folks to test it), we can
	finally purge the old and hateful version of kgdb from our source
	tree.

o	attach/detach support.  See comments in README.FreeBSD for more
	details.

o	Well, it's newer.  Our previous version was 4.11.

Comments and flames to gj, of course! :-)

Thanks, Gary.  Much appreciated.  The previous state of gdb/kgdb has been a
thorn in all of our sides for some time..
Submitted by:	gj
1994-12-30 23:27:33 +00:00
Andreas Schulz
eafe5e1c1c Add the automatically generated files: y.tab.h c-exp.tab.c ch-exp.tab.c and
m2-exp.tab.c to the CLEANFILES target.
1994-11-28 17:19:52 +00:00
Bruce Evans
a3a5ddcb52 Include <sys/types.h> early. This will be required when <stdio.h> and/or
<signal.h> are fixed to not include it.

Bruce
1994-11-14 05:16:46 +00:00
Andrey A. Chernov
02ea062a10 #define HAVE_TERMIOS added for proper terminal handling
Submitted by: smcarey@mailbox.syr.edu
1994-10-02 11:12:40 +00:00
Bruce Evans
f44ca047d4 Add dependency for -lcompat. 1994-09-20 05:17:50 +00:00
Steven Wallace
3f7f52979b Added ${DESTDIR} in the line
CFLAGS+= -I$(.CURDIR)/. -I${DESTDIR}/usr/include/readline -I$(.CURDIR)/../bfd
1994-09-15 05:17:59 +00:00
Rodney W. Grimes
88782905c0 Change all references to LIBTERM and -ltermlib to LIBTERMCAP and -ltermcap 1994-09-11 21:41:41 +00:00
Garrett Wollman
00dc83228f Need -lcompat to link under 2.0. 1994-08-05 22:04:02 +00:00
Adam David
1d13a7db2a correct location of corefile data segment 1994-06-15 08:24:25 +00:00
Andrey A. Chernov
afd4f2eb3b Add LIBREADLINE and LIBTERM to DPADD 1994-06-14 11:00:35 +00:00
Andrey A. Chernov
b36ac09a51 Remove PAGE_SIZE redifinition (from param.h) 1994-06-13 08:03:32 +00:00
Paul Richards
71dda56bca Moved -DTRAD_CORE from gdb/Makefile to bfd/Makefile 1994-06-11 16:20:42 +00:00
Paul Richards
d9a0f8b58d Modev -DTRAD_CORE for gdb/Makefile to bfd/Makefile 1994-06-11 16:20:07 +00:00
Paul Richards
013d389608 Two files I "lost" the first time.
GDB4:
1994-06-10 15:57:46 +00:00
Paul Richards
ea8c7ac7d0 GDB-4.12 from ports with support for shlibs but not the kernel.
This is a greatly pared down version of the full gdb-4.12, all the
config stuff has been removed and the supporting libraries have
been stripped to a minimum. This is a 1.1.5 only port, I'll do a
more complete port for 2.0 which will have all the config stuff
and will install the gnu support libraries as system libraries like
we do for readline.

There wasn't much point for 1.1.5 since only gdb would use them so I
went for saving space instead. For 2.0 I'll config all the
other gnu tools to use them as well.
1994-06-10 13:42:18 +00:00
Andrey A. Chernov
13adc6f931 Remove readline copy, now gdb use gnu lib tree libreadline 1994-05-09 18:13:54 +00:00
Adam David
439d0ff00b Use correct stack segment with corefiles. 1994-05-04 01:22:07 +00:00
David Greenman
0ff4fbb502 Only use syscallmap if FM_TRAP or EX_TRAPSTK are defined. 1994-01-03 08:10:47 +00:00
Andreas Schulz
5fefaf154f deleted all references to rindex and included string.h instead. 1993-12-01 16:45:42 +00:00
Andreas Schulz
285aeeb5e4 changed the order of the includes and deleted a reference to index
nd added an include to string.h instead
1993-12-01 16:44:43 +00:00
Paul Richards
add6d758b6 Added Charles changes for GCC@ symbols. 1993-07-26 22:40:41 +00:00
Nate Williams
315615555c Bruce Evans:
The enclosed diffs implement printing of the floating point state for
the version of gdb-3.5 in 386BSD-0.0.  I don't have gdb for 386BSD-0.1
but I've been told that it is also missing this feature.

The changes are small.  Code to read the FP state from the kernel was
#ifdef'ed out, but it essentially works.  Code to change the FP regs
is still #ifdef'ed out.  It is close to working too.  Printing of the
FP regs was broken because hard reg numbers were confused with stack
offsets.

4. The emulator does not handle FP errors right, and it does not
   communicate the emulated FP state to the rest of the kernel, so
   "info float" shows garbage.
1993-07-01 00:17:55 +00:00
Nate Williams
3edf564a32 Added GNU gdb to src/gnu 1993-06-29 09:48:26 +00:00