Commit Graph

1541 Commits

Author SHA1 Message Date
Andrey A. Chernov
0b00e7b2c0 Update usage line with new option 1998-01-21 15:15:39 +00:00
Andrey A. Chernov
8bf2e8c7e2 Add -I or --index-first option to take Index: precedence over context diff,
as it was in hacked FreeBSD version
1998-01-21 15:10:14 +00:00
Andrey A. Chernov
249a716c6c Resurrect patch 2.1 without FreeBSD Index: hack 1998-01-21 14:37:27 +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
John Birrell
a3f1de88b2 More i386 -> ${MACHINE} changes to make this Makefile machine
independent. It makes it look like you can get aout on alpha, but
that's just your imagination. The makefile above gives you no choice.
1998-01-11 04:13:25 +00:00
John Birrell
df13e7f694 Replace i386 references with ${MACHINE} to make this makefile almost
machine independent, with the only dependency being the binary format
to build. We only expect to build ELF on alpha although we'll need
ECOFF compatibility with Digital Unix.
1998-01-11 04:10:26 +00:00
John Birrell
d7ad72179f Avoid building x86 specific libraries on Alpha. 1998-01-10 22:50:00 +00:00
John Polstra
6d7a71ba59 Make the ".set" directive copy the aux field when the expression
reduces to a relocatable symbol plus an offset.  This preserves
the symbol type information (function vs. object).  It is important
for SVR4-style weak symbols, e.g., "#pragma weak foo=bar".  Without
this change, the linker complains that the jmpslot entry is not a
function.
1998-01-10 05:36:35 +00:00
Daniel O'Callaghan
09a3feaf70 PR: gnu/4385
Submitted by:	Robert Eckardt <roberte@MEP.Ruhr-Uni-Bochum.de>
Sundry man page fixes; handle Central European Summer Time (CEST);
usage fixes in line with man page fixes.
1998-01-05 11:32:39 +00:00
Andrey A. Chernov
78dd9df206 Upgrade to 2.5 (contrib version) 1998-01-04 21:41:46 +00:00
Andrey A. Chernov
1f374e009f Back out Index over +++/--- precedence.
It maybe right, if patch was FreeBSD-own program, but it break compatibility
with pre-existent patches in other systems.
The example is big ncurses patch which don't apply on FreeBSD
due to "fixed" precedence.
1998-01-03 23:42:56 +00:00
Alexander Langer
1295abe226 Removed /etc/ld.so.conf reference from FILES section (people get
confused when they can't find it), but leave the reference to it
as being a standard filename (which doesn't imply that it exists).

Discussed with:	jkh
1998-01-01 02:31:47 +00:00
Daniel O'Callaghan
52ebfb9d0f Submitted by: Peter Hawkins <peter@clari.net.au>
Actually implement --norecurse as documented in the man page.
1997-12-30 10:23:09 +00:00
Wolfram Schneider
6043106601 Check argument filename length before copying.
$ gzip `perl -e 'for(1..10240){ print "a"}'`
1997-12-27 03:38:39 +00:00
Wolfram Schneider
9c8ac6c742 Workaround to avoid a strange core dump.
gzip < /dev/null | perl -npe 's/\003\003/\003\225/' | gzip -d
1997-12-26 21:12:26 +00:00
Wolfram Schneider
1132c08dd8 Do not install the z*grep man pages if grep was linked with -lz. 1997-12-26 01:53:58 +00:00
Tim Vanderhoek
dfb9495b2a Use consistent spelling,
writeable -> writable (recall prior debate over this? :-)
	initialise -> initialize
	recognise -> recognize

Merry Christmas! :)
1997-12-25 09:36:42 +00:00
Wolfram Schneider
15ec2a04f8 When called as `zgrep', the -Z argument is assumed. Make a
link from zgrep to grep.

Pointed out by: Tim Vanderhoek <hoek@hwcn.org> and
                Mike Smith <mike@smith.net.au>
1997-12-21 19:15:12 +00:00
Wolfram Schneider
00caa62588 Added zgrep.libz. This version of zgrep(1) depend on a
grep(1) linked with libz.
1997-12-20 19:20:33 +00:00
Wolfram Schneider
50cb810d2e Added a sparc category to the list. 1997-12-20 18:54:22 +00:00
Wolfram Schneider
a6f4e3c4dc Added builtin decompression using zlib library, option -Z.
Enabled this new feature with the makefile variable GREP_LIBZ. If
you don't like it, compile with `make GREP_LIBZ='.

grep + zlib has several advantages:

- the shell script zgrep(1) will be basically a one line
  exec grep -Z "$@"

- no shell script, no bugs. The current zgrep implementations
  have many bugs and some grep options are no supported.

- no shell script, no security risks.

- it is a magnitude faster than a shell script

Also fixed:
0 -> STDIN_FILENO
Close a file descriptor only if the open call was successfully. It does
not hurt for the open(2) function, but the gzclose(3) function
died in free() to free up (not) allocated memory.
1997-12-20 18:46:09 +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
c26f14e2b9 Fixed missing dependency on version.c.
Fixed some style bugs ($@ is not recommended ...).
1997-12-18 15:22:12 +00:00
Bruce Evans
c0e045a84d <bsd.prog.mk> has always included ../Makefile.inc, and there are no
complications involving .PATH or dependencies, so don't include it here.
1997-12-17 20:22:34 +00:00
Bruce Evans
cee45d9aa8 <bsd.prog.mk> has included ../Makefile.inc for a long time, and there
are no complications involving .PATH or dependencies, so don't include
it here.
1997-12-17 19:57:35 +00:00
Bruce Evans
f34b67af93 Don't use LDDESTDIR. Just put the -L arg in LDADD. 1997-12-17 15:11:43 +00:00
Bruce Evans
45c9cb5439 Use BINOWN, etc. instead of bin, etc. so that (this part of)
`BINOWN=... make world' can be run by users other than root.
1997-12-17 12:04:53 +00:00
Wolfram Schneider
8873fd5457 Use getopts instead getopt(1). This should fix the problem
with whitespaces in pattern.
PR:	5211
1997-12-07 01:00:56 +00:00
John Polstra
6210388a93 Make emacs work again. This is a workaround for the fact that the
emacs a.out file, self-generated by emacs's "unexec" function in
"unexsunos4.c", is invalid.  In particular, its "_end" symbol has
the wrong value.  The dynamic linker was using the value of that
symbol to initialize its sbrk break level.

The workaround is to peek at the executable's a.out header in
memory, and calculate what "_end" should be based on the segment
sizes.

I will work out a fix for emacs and send it to the FSF.  This
dynamic linker workaround is still worthwhile, if only to avoid
forcing all emacs users to build a new version.

Note: xemacs gives a bogus warning at startup, for related reasons.
The warning is harmless and can safely be ignored.  I will send a
patch to the xemacs maintainers to get rid of it, and meanwhile
add a patch file to our port.
1997-12-05 02:06:37 +00:00
Steve Price
edec52ad1a Remove manpath.[ch] here and use the ones in ../manpath instead. 1997-11-30 20:08:27 +00:00
Steve Price
580e97a9d8 Resurrect manpath.c here. 1997-11-30 19:55:16 +00:00
Steve Price
609e31cc38 Remove this copy of manpath.c and add the .PATH directive to get to
the same file in ${.CURDIR}/../man.

Suggested by:	Bruce Evans
1997-11-30 17:17:29 +00:00
Steve Price
bab06090f9 Always call gripe_reading_mp_config with the required arguments.
PR:		3894
Submitted by:	Stephen Clawson <sclawson@marker.cs.utah.edu>
1997-11-30 01:01:47 +00:00
John Polstra
08bdd3d27d Get rid of the dynamic linker's internal malloc package, and arrange
things so that it uses the same malloc as is used by the program
being executed.  This has several advantages, the big one being
that you can now debug core dumps from dynamically linked programs
and get useful information out of them.  Until now, that didn't
work.  The internal malloc package placed the tables describing
the loaded shared libraries in a mapped region of high memory that
was not written to core files.  Thus the debugger had no way of
determining what was loaded where in memory.  Now that the dynamic
linker uses the application's malloc package (normally, but not
necessarily, the system malloc), its tables end up in the regular
heap area where they will be included in core dumps.  The debugger
now works very well indeed, thank you very much.

Also ...

Bring the program a little closer to conformance with style(9).
There is still a long way to go.

Add minimal const correctness changes to get rid of compiler warnings
caused by the recent const changes in <dlfcn.h> and <link.h>.

Improve performance by eliminating redundant calculations of symbols'
hash values.
1997-11-29 03:32:48 +00:00
John Polstra
873954b327 In the "ldd -v" output, display the N_AUX information for each
symbol.  It indicates whether the symbol refers to a function or a
data object.
1997-11-28 19:34:27 +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
John Polstra
14b94d0464 Add missing argument detected by "-Wformat". 1997-11-18 03:37:45 +00:00
Andrey A. Chernov
5a77e9d43b Define PR_PROGRAM properly 1997-10-29 17:35:54 +00:00
Andrey A. Chernov
53d4d0e441 Switch to contrib version 1997-10-29 16:58:20 +00:00
Andrey A. Chernov
e4b6c3604e Switch to contrib version 1997-10-29 16:50:42 +00:00
Andrey A. Chernov
cd56389a5d Switch to contrib version 1997-10-29 16:36:57 +00:00
James Raynard
be4ad1aa3f Remove yet another superfluous file. 1997-10-26 12:53:16 +00:00
Andrey A. Chernov
a1838c23b7 Add -funsigned-char to CFLAGS (for ctype macros) 1997-10-26 12:20:45 +00:00
Andrey A. Chernov
5a90c8dbf2 Add (unsigned char) cast to ctype macros 1997-10-23 02:44:23 +00:00
Andrey A. Chernov
93bb056022 Add (unsigned char) cast to ctype macros 1997-10-23 02:22:51 +00:00