Commit Graph

97 Commits

Author SHA1 Message Date
Matt Jacob
8dde563eb3 like i386, add inclusion of lock.h 2001-05-03 06:33:33 +00:00
Mark Murray
573fbdc21f Compensate for dethreaded headers.
(I have no religion about how this was done. Follow-up commits welcome)
2001-05-01 09:08:09 +00:00
Jake Burkholder
aa17032fcb - Add #defines for the symbol names of the kernel interrupt, system
call and trap entry points so they're easy to find and change
- Use the cpuhead and allcpu list to locate globaldata for the current
  cpu, rather than SMP_prvspace or __globaldata
- Use offsets into struct globaldata directly to find per-cpu variables,
  rather than symbols in globals.o

Glanced at by:	peter
2001-01-10 18:15:25 +00:00
Peter Wemm
57a0ee63f0 Fix gdb -k after jake's most recent commit. The gd_XXX symbols are now
offsets in all cases, and we have to find the base address (&__globaldata)
ourselves for the UP case as well as SMP.
2001-01-07 05:08:39 +00:00
Poul-Henning Kamp
3281461493 Use macro API to <sys/queue.h>
Submitted by:	Dima Dorfman <dima@unixfreak.org>
Reviewed by:	phk
2000-12-31 11:22:42 +00:00
Joerg Wunsch
4a24038b4c Fix an annoying message ``gdb: ptrace(PT_GETDBREGS) failed: No such process''
when using gdb on a remote target.  The fix is to restrict PT_GETDBREGS
calls to `child' and `freebsd-uthreads' targets solely.

I've been in some conversation with Brian about this, and this solution
seems to be the most appropriate one.

PR:		gnu/21685
Submitted by:	bsd
2000-12-26 20:38:46 +00:00
John Baldwin
65e26c5e18 Catch up to the new kinfo_proc. 2000-12-12 23:21:24 +00:00
David E. O'Brien
1a37aa566b Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
2000-12-09 09:35:55 +00:00
David E. O'Brien
3726c08892 Deal with a real PITA in that GDB 4.18 (as we imported it) requires a
`wait.h' that was in contrib/binutils/, however this wait.h went away with
bintuils 2.10.0 so I `cvs rm'ed it.  Now we find gdb will not build.  This
binutils wait.h contained nothing we didn't already have in <sys/wait.h>.
So just hack a symlink to it.
2000-11-25 13:59:49 +00:00
Daniel Eischen
ed21d82204 Sync gdb thread support with recent changes to the threads library.
Approved by:	obrien
2000-11-10 00:36:01 +00:00
Daniel Eischen
7c021a1090 Adjust to reflect recent changes in the internal layout of a struct
pthread in libc_r.

Reviewed by:	dfr
2000-10-13 22:15:19 +00:00
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