Commit Graph

84 Commits

Author SHA1 Message Date
John Polstra
98ad0dae72 Give up on a.out support in binutils. It has too many problems to
be worth much effort.  Install all i386 binutils programs in
"/usr/libexec/elf".  Disable a.out support in libbfd.  It's too
dangerous to leave it in.  Some of the utilities think they can
handle a.out, but they generate bad object files.
1998-03-30 02:21:27 +00:00
John Polstra
dc84a8ccd6 Add c++filt. 1998-03-30 02:19:09 +00:00
Bruce Evans
3f9af06bf9 Removed vestiges of use of beforedepend target. 1998-03-19 15:21:19 +00:00
John Polstra
09ce8fd795 Make the binutils strip ELF-only for now. It isn't quite right for a.out. 1998-03-15 02:08:04 +00:00
John Polstra
66f259f3f5 Disable support for the a.out-i386-bsd target. Everything it can do
seems to be supported in the a.out-i386-freebsd target.  When both
are present, there are sometimes complaints of "ambiguous file
format."
1998-03-14 01:40:31 +00:00
John Birrell
db7662af72 Configure alpha to disassemble both alpha and i386 opcodes. 1998-03-12 13:02:46 +00:00
John Birrell
38bc294e8d Configure bfd for elf64, elf32, and aout. Yes alpha can handle i386
formats. No i386 can't handle alpha formats. 8-)
1998-03-12 12:29:20 +00:00
John Birrell
ab9475bf88 Define the target type for alpha. 1998-03-12 08:00:03 +00:00
John Birrell
9fa2607935 Add the alpha makefile.
Move tc-i386.c from Makefile to Makefile.i386 'cause alpha doesn't
like trying to swallow it. Indigestion, I think.
1998-03-12 06:51:48 +00:00
John Birrell
ec14ed6ee5 Change the include path for bfd.h to libbfd/${MACHINE_ARCH} since
I moved the location of that architecture specific file.
1998-03-12 05:59:22 +00:00
John Birrell
06e95425f7 This file was generated on i386, so it has been moved to the i386
sub-directory. It differs from the alpha version.
1998-03-12 05:31:34 +00:00
John Birrell
823093fcc3 This file was generated on i386 by the update.sh script in
src/gnu/usr.bin/binutils.
1998-03-12 05:29:44 +00:00
John Birrell
8e6a3bf016 These files were generated on alpha by the update.sh script in
src/gnu/usr.bin/binutils.
1998-03-12 05:26:30 +00:00
John Polstra
f07eaee2fc Replace empty install targets with definitions of INTERNALLIB and
INTERNALSTATICLIB to suppress installation of internal libraries.
1998-03-12 05:14:19 +00:00
John Birrell
e6956da5e0 Change script to get the machine type from `uname -m' and make
the binutils headers for (machine)-unknown-freebsdelf.

Also copy the bfd.h header to an architecture specific directory
because there are two fundamental lines that differ (32-bit vs 64-bit)
between i386 and alpha.

The config.h for libbinutils generates the same on alpha as i386,
so I didn't change that (though I was tempted!).
1998-03-12 04:54:42 +00:00
John Polstra
ab5ad3a4b5 Restructure the binutils hierarchy somewhat in order to better
support building it for variant architectures.  It was already
becoming clear that the former structure was too rigid and didn't
scale well.

The usual sort of makefile magic arranges to .include an architecture
specific makefile "Makefile.${MACHINE_ARCH}" in each directory
where it exists.  Also, sources will be found in each subdirectory
"${MACHINE_ARCH}" that exists.  This is all taken care of automatically
by the top level "Makefile.inc0".

This all seems to work right for the i386 now.  I have also converted
those alpha pieces already present to the new schema as best I
could.

Also: change the BINDIR on the i386 to /usr/libexec/elf for "ar"
and "ranlib".  They are not object format independent enough to
put into /usr/bin.
1998-03-12 02:55:43 +00:00
John Birrell
49ee5e93ce We want ld in /usr/bin, not some weird and wonderful hiding place
that might be inspired by some creation from Intel. Doh.
1998-03-09 06:07:27 +00:00
John Birrell
25c5530515 Import of alpha specific bits to configure binutils for FreeBSD/Alpha.
Other changes that affect the i386-elf work are on hold to avoid
stuffing up other work in progress.
1998-03-09 00:33:28 +00:00
Peter Wemm
a4f46b7116 Set LIB_PATH explicitly otherwise genscripts makes (incorrect) references
all over the place.
1998-03-08 08:08:39 +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
John Polstra
b6e7a280a9 Fix the broken installation of strip. It tried to use the installed
strip program (via "install") to strip itself.  But the program
wasn't executable because "install" hadn't made it so yet.  I
borrowed the method used for the old strip to get around this.
1998-03-06 00:28:04 +00:00
John Polstra
2e280533a1 Add bmakefiles for building binutils from the contrib tree.
This finishes up the binutils import.  But I am leaving it disabled
in "src/gnu/usr.bin/Makefile" for now.  It is not used by anything
yet, so I'll take this opportunity to run one more round of tests
before enabling it.
1998-03-01 23:41:17 +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
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