Commit Graph

86 Commits

Author SHA1 Message Date
Joerg Wunsch
22c68d23f5 Implement the GDB counterpart to use hardware watchpoints in connection
with Brian's kernel support for i386 debug registers.  This makes
watchpoints actually usable for real-life problems.  Note: you can
only set watchpoints on 1-, 2- or 4-byte locations, gdb automatically
falls back to [sloooow] software watchpoints when attempting to use
them on variables which don't fit into this category.  To circumvent
this, one can use the following hack:

watch *(int *)0x<some address>

David O'Brien is IMHO considering to get this fully integrated into the
official GDB, but as long as we've got the i386/* files sitting around
in our private FreeBSD tree here, the feature can now be tested more
extensively, so i'm committing this for the time being.

This work has been done in order to debug a tix toolkit problem, thus
it has been sponsored by teh Deutsche Post AG.

Reviewed by:	bsd (not the operating system, but Brian :-)
2000-08-17 16:27:26 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
David E. O'Brien
7f3d7f20f8 Pull the switch and activate our Binutils to a snapshot of the up and
comming 2.10 release.
2000-05-22 08:09:42 +00:00
David E. O'Brien
56d2e40e38 callback.c is not really used, nor is it part of GDB 4.18. 2000-05-17 19:30:59 +00:00
Doug Rabson
a052d1ca88 Add support for debugging programs using libc_r's implementation of
pthreads.
2000-04-29 09:03:49 +00:00
Gary Jennejohn
f367e39024 Add a '+' to the first LDADD, otherwise it clobbers the LDADD in
Makefile.alpha such that the -lkvm disappears and the link fails.

This time I tested it, honest :)
2000-04-04 11:12:55 +00:00
Bruce Evans
6a18627411 Use ${dir}/libfoo.a' instead of -L${dir} -lfoo' for local static
libraries in LDADD so that `make checkdpadd' doesn't report non-errors.

Fixed some style bugs (the usual ones for DPADD and LDADD, and misformatting
of $FreeBSD$).
2000-03-27 18:02:04 +00:00
Peter Wemm
9b7a44a60e $Id$ -> $FreeBSD$ 1999-08-27 23:37:10 +00:00
Andrew Gallatin
4331c85a32 Live & postmortem kernel debugging support for the alpha platform.
This was modeled after NetBSD's kernel debugging support.

Reviewed by: Doug Rabson <dfr@nlsystems.com>
1999-06-21 15:00:15 +00:00
Dmitrij Tejblum
8ea9dacf53 Fix placement of signal trampoline. 1999-06-13 19:41:50 +00:00
Bruce Evans
583393551b Fixed some regressions in rev.1.40:
- rev.1.39 was clobbered.
- PROG was defined twice, once as nm.
- style bugs.
1999-05-11 08:07:51 +00:00
Doug Rabson
0ba2f2a9ba Implement corefiles for FreeBSD/alpha. This requires a separate change to
the kernel which is awaiting review.
1999-05-07 21:49:06 +00:00
Doug Rabson
657b29aa29 Add core-regset.c to the Makefile to allow debugging elf corefiles. 1999-05-07 19:53:05 +00:00
Doug Rabson
5c3925f8f9 * Add bmake framework for using gdb alongside binutils. The old bmake
framework was repository copied from gnu/usr.bin/gdb.
* Add alpha support.
1999-05-02 11:32:14 +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
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
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
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
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
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