Commit Graph

113 Commits

Author SHA1 Message Date
bde
1a3527cffb Removed an especially bogus cast. 1999-05-13 13:01:46 +00:00
bde
39c8a35bcf Restored used include of <sys/systm.h>. -Wmissing-prototypes doesn't work
for builtin functions.
1999-05-13 06:07:44 +00:00
phk
e8f4fc4a1d add some amount of sanity to the way the gdb stuff finds its device.
I'm not too happy about the result either, but at least it has less
chance of backfiring.

This particular feature could be called "a mess" without offending
anybody.
1999-05-09 10:51:13 +00:00
mckusick
6106d6252c Get rid of extern declarations on gdb stuff so systems compiled without
DDB will compile. Warn users that try to use GDB without specifying a GDB
port in their configuration file.
1999-05-07 23:08:23 +00:00
bde
5382007cd0 Fixed -Wcast-qual warnings. 1999-02-12 12:44:19 +00:00
bde
a24330a338 Fixed fatal type mismatches in the aout case. Const poisoning in
db_sym.h had not reached here.
1999-02-12 12:15:07 +00:00
dillon
f9a4729a9b Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile.

    This commit includes significant work to proper handle const arguments
    for the DDB symbol routines.
1999-01-27 23:45:44 +00:00
dillon
153f359f37 Changes to support -Wall, -Wcast-qual. Had to make physical code changes
in db_lookup() to avoid the *cp = 0 / *cp = ':' combo ( temporary
    nul-terminate-then-restore-original ) on a const char * string.
1999-01-27 19:00:49 +00:00
jdp
b5fcc979e2 Replace includes of <sys/kernel.h> with includes of
<sys/linker_set.h> in those files that use only the linker set
definitions.
1999-01-14 06:22:10 +00:00
archie
982e80577d Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.

These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
Reviewed by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	Mike Spengler <mks@networkcs.com>
1998-12-04 22:54:57 +00:00
peter
d13c281654 Forgot to commit this; the alpha uses the kld symbol interface now. The
tables that db_elf.c is expecting are not loaded in that format any more.
1998-10-15 02:01:50 +00:00
peter
887fa28cea Call some helper routines to be supplied by kern_linker.c in order to
get to all the symbol tables for all modules, not just the core kernel
symbol table.  Yes, DDB can see KLD module symbols with this, both by
lookup and in tracebacks.  No more references to _end from tracebacks
within an LKM. :-)
1998-10-09 23:34:09 +00:00
peter
692ee06246 At the moment, the alpha tentatively uses the ddb elf code rather than KLD,
because the alpha boot loader hasn't been converted yet, and because
it needs the full symbol tables with local symbols in order to make sense
of stack tracebacks.  KLD will implement this (using full sybmol table
rather than the globals only) shortly.
1998-10-09 23:32:03 +00:00
peter
0ece9ad76d We don't compile this on an elf kernel (and explicitly not on alpha in
case it's possible to compile in something like ECOFF)
The three db_xxx.c symbol interfaces are "standard" because config isn't
flexible enough without forcing the user to know about it.
1998-10-09 23:29:44 +00:00
dfr
988c605cbc Update to work with the new elf headers. 1998-08-17 08:06:31 +00:00
bde
bf1a9b4c37 Added macros __printflike() and __scanflike() to <sys/cdefs.h>.
Use them to `make gcc -Wformat' check formats for all printf-like
and scanf-like functions in /usr/src except for the err()/warn()
family.  err() isn't quite printf-like since its format arg can
legitimately be NULL.  syslog() isn't quite printf-like, but gcc
already accepts %m, even for plain printf() when it shouldn't.
1998-07-13 06:45:23 +00:00
bde
c9efed72bc Use not-so-new printf formats %r and/or %z instead of %n and/or %+x. 1998-07-08 10:53:58 +00:00
bde
eee2789d0f Fixed bogus type of valuep in struct db_variable. It was `int *' and
became `long *' for alpha, but should always have been `db_expr_t *'.
Fixed variable types to match.
1998-07-08 09:11:43 +00:00
bde
e4073f6c6f Fixed db_printf format errors. 1998-07-08 06:43:57 +00:00
bde
51d1a0c22d Fixed db_printf format errors (except for ones using broken extensions
(nonstandard %n and '+' with %x), and ones not found by -Wformat on
386's (some db_expr_t's are still printed as ints).

I decided not to change the arg type for %n from [unsigned] int to
register_t, since about half of the uses of %n are to print plain
ints and casting to [unsigned] long for %n is no harder than for %x.
1998-07-08 06:27:22 +00:00
dfr
03c89f33a9 Remove the two single step breakpoints in the reverse order of setting to
ensure that single stepping a branch to the next instruction works.
1998-07-05 10:12:18 +00:00
dfr
520ba75a03 Add symtab parameter to X_db_symbol_values. 1998-07-05 10:11:20 +00:00
dfr
8b469e8ce9 Support 'g' format for printing 8 byte values. 1998-07-05 10:10:33 +00:00
dfr
54c71cf68a Forgot to mention:
Obtained from: NetBSD
1998-06-28 00:59:26 +00:00
dfr
f0112afdb9 Add DDB symbol support for ELF and KLD. The KLD support only supports global
symbols so its not too useful.  Changes to the kernel linker to allow it to
supply DDB with symbols will come later.
1998-06-28 00:57:28 +00:00
dfr
0cc7230297 Supply the symbol table as an argument to X_db_symbol_values (required for elf). 1998-06-28 00:55:02 +00:00
dfr
e1316cb0ae Use db_addr_t for the breakpoint address in db_set_single_step. 1998-06-28 00:52:50 +00:00
dfr
3231ba4ceb Make db_tok_number a long to allow typing 64bit numbers on alpha. 1998-06-27 15:40:56 +00:00
dfr
1cc4fc358b Use %+11ln for printing in r format to make it work for 64bit registers. 1998-06-27 15:39:51 +00:00
dfr
224577d6cf Add initial support for the FreeBSD/alpha kernel. This is very much a
work in progress and has never booted a real machine.  Initial
development and testing was done using SimOS (see
http://simos.stanford.edu for details).  On the SimOS simulator, this
port successfully reaches single-user mode and has been tested with
loads as high as one copy of /bin/ls :-).

Obtained from: partly from NetBSD/alpha
1998-06-10 10:57:29 +00:00
dfr
a7c0d1c5c9 Make DDB work again after I broke it :-(. 1998-06-08 08:43:20 +00:00
bde
2f5fcc4998 Backed out previous commit, which just consisted of a 1-byte editing
error.
1998-06-08 02:15:37 +00:00
bde
9ac818096c Fixed missing ifdefs and disordering in previous commit. 1998-06-08 02:12:19 +00:00
bde
128c893269 Fixed ifdef bogotification in previous commit. 1998-06-08 02:11:19 +00:00
dfr
1d5f38ac22 This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
phk
d3d65c6b2e Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.
Clean up (or if antipodic: down) some of the msgbuf stuff.

Use an inline function rather than a macro for timecounter delta.

Maintain process "on-cpu" time as 64 bits of microseconds to avoid
needless second rollover overhead.

Avoid calling microuptime the second time in mi_switch() if we do
not pass through _idle in cpu_switch()

This should reduce our context-switch overhead a bit, in particular
on pre-P5 and SMP systems.

WARNING:  Programs which muck about with struct proc in userland
will have to be fixed.

Reviewed, but found imperfect by:       bde
1998-05-28 09:30:28 +00:00
phk
af59853834 Redo the previous commit in a more Bruce-friendly fashion.
Urged by:	bde
1998-05-19 18:42:09 +00:00
phk
e9c01f2e74 Add "show msgbuf" command 1998-05-19 11:02:24 +00:00
bde
e159c8ff97 Ensure that the linker sets for commands exist by putting a standard
command in each of them.  This removes the need for hard-to-configure
dummy instantiations of the sets.
1998-02-13 02:19:29 +00:00
eivind
d7a6ab2803 Staticize. 1998-02-09 06:11:36 +00:00
dyson
0f54a3a55f Some fixes from John Hood:
1) Fix the initialization of malloc structure that changed
		due to perf opt.
	2) Remove unneeded include.
	3) An initialization assert added to malloc.
Submitted by:	John Hood <cgull@smoke.marlboro.vt.us>
1997-12-05 05:36:58 +00:00
bde
7cd32186da Cleaned up revs.1.19-1.21: 1997-11-20 16:53:23 +00:00
msmith
67ba7220fd A better fix for the ddb command history buffer problem; use a static
buffer instead of trying to use malloc() in the input routine.
Submitted by:	john hood <cgull@smoke.marlboro.vt.us>
1997-11-09 06:30:29 +00:00
msmith
cfad384768 Don't try to do anything with the input history if MALLOC() for the buffer
failed.

This broke early debugging.
1997-11-07 02:34:50 +00:00
bde
3ef4a761cf Fixed scrolling. Newline at the "--More--" prompt scrolled 2 lines. 1997-10-09 00:20:00 +00:00
phk
159b51570f Print the filename, not the directory we compiled in. 1997-09-28 08:34:46 +00:00
joerg
2819c5d8c9 Minor hack to also allow for syscons's "interesting" arrow keys.
I'm using "#if __i386__ && __FreeBSD__" to check for a ``potentially
syscons-relevant environment''.  Hope that's ok...
1997-08-17 21:21:50 +00:00
bde
0f00fbdf2b Some staticized variables were still declared to be extern. 1997-06-30 23:54:50 +00:00
bde
276d810752 Don't depend on gcc's feature of interpreting `int foo(c) char c; ...'
as `int foo(char c) ...' if there is a bogus prototype `int foo(char c);'
in scope.
1997-06-30 23:49:17 +00:00
bde
302a2f962e Removed unused #includes. 1997-06-14 11:52:37 +00:00