[Midnightbsd-cvs] src [10129] trunk/sys/ddb: sync ddb
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun May 27 20:28:05 EDT 2018
Revision: 10129
http://svnweb.midnightbsd.org/src/?rev=10129
Author: laffer1
Date: 2018-05-27 20:28:05 -0400 (Sun, 27 May 2018)
Log Message:
-----------
sync ddb
Modified Paths:
--------------
trunk/sys/ddb/db_access.c
trunk/sys/ddb/db_access.h
trunk/sys/ddb/db_break.c
trunk/sys/ddb/db_break.h
trunk/sys/ddb/db_capture.c
trunk/sys/ddb/db_command.c
trunk/sys/ddb/db_command.h
trunk/sys/ddb/db_examine.c
trunk/sys/ddb/db_expr.c
trunk/sys/ddb/db_input.c
trunk/sys/ddb/db_lex.c
trunk/sys/ddb/db_lex.h
trunk/sys/ddb/db_main.c
trunk/sys/ddb/db_output.c
trunk/sys/ddb/db_output.h
trunk/sys/ddb/db_print.c
trunk/sys/ddb/db_ps.c
trunk/sys/ddb/db_run.c
trunk/sys/ddb/db_script.c
trunk/sys/ddb/db_sym.c
trunk/sys/ddb/db_sym.h
trunk/sys/ddb/db_textdump.c
trunk/sys/ddb/db_thread.c
trunk/sys/ddb/db_variables.c
trunk/sys/ddb/db_variables.h
trunk/sys/ddb/db_watch.c
trunk/sys/ddb/db_watch.h
trunk/sys/ddb/db_write_cmd.c
trunk/sys/ddb/ddb.h
Modified: trunk/sys/ddb/db_access.c
===================================================================
--- trunk/sys/ddb/db_access.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_access.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -29,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_access.c 273265 2014-10-18 19:22:59Z pfg $");
#include <sys/param.h>
#include <sys/kdb.h>
@@ -54,10 +55,7 @@
#endif
db_expr_t
-db_get_value(addr, size, is_signed)
- db_addr_t addr;
- register int size;
- boolean_t is_signed;
+db_get_value(db_addr_t addr, int size, boolean_t is_signed)
{
char data[sizeof(u_int64_t)];
register db_expr_t value;
@@ -87,10 +85,7 @@
}
void
-db_put_value(addr, size, value)
- db_addr_t addr;
- register int size;
- register db_expr_t value;
+db_put_value(db_addr_t addr, int size, db_expr_t value)
{
char data[sizeof(int)];
register int i;
Modified: trunk/sys/ddb/db_access.h
===================================================================
--- trunk/sys/ddb/db_access.h 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_access.h 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -23,7 +24,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/ddb/db_access.h 139747 2005-01-06 01:34:41Z imp $
*/
#ifndef _DDB_DB_ACCESS_H_
Modified: trunk/sys/ddb/db_break.c
===================================================================
--- trunk/sys/ddb/db_break.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_break.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -33,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_break.c 273265 2014-10-18 19:22:59Z pfg $");
#include <sys/param.h>
@@ -59,7 +60,7 @@
static void db_set_breakpoint(vm_map_t map, db_addr_t addr, int count);
static db_breakpoint_t
-db_breakpoint_alloc()
+db_breakpoint_alloc(void)
{
register db_breakpoint_t bkpt;
@@ -78,8 +79,7 @@
}
static void
-db_breakpoint_free(bkpt)
- register db_breakpoint_t bkpt;
+db_breakpoint_free(db_breakpoint_t bkpt)
{
bkpt->link = db_free_breakpoints;
db_free_breakpoints = bkpt;
@@ -86,10 +86,7 @@
}
static void
-db_set_breakpoint(map, addr, count)
- vm_map_t map;
- db_addr_t addr;
- int count;
+db_set_breakpoint(vm_map_t map, db_addr_t addr, int count)
{
register db_breakpoint_t bkpt;
@@ -115,9 +112,7 @@
}
static void
-db_delete_breakpoint(map, addr)
- vm_map_t map;
- db_addr_t addr;
+db_delete_breakpoint(vm_map_t map, db_addr_t addr)
{
register db_breakpoint_t bkpt;
register db_breakpoint_t *prev;
@@ -140,9 +135,7 @@
}
static db_breakpoint_t
-db_find_breakpoint(map, addr)
- vm_map_t map;
- db_addr_t addr;
+db_find_breakpoint(vm_map_t map, db_addr_t addr)
{
register db_breakpoint_t bkpt;
@@ -158,16 +151,15 @@
}
db_breakpoint_t
-db_find_breakpoint_here(addr)
- db_addr_t addr;
+db_find_breakpoint_here(db_addr_t addr)
{
- return db_find_breakpoint(db_map_addr(addr), addr);
+ return db_find_breakpoint(db_map_addr(addr), addr);
}
static boolean_t db_breakpoints_inserted = TRUE;
#ifndef BKPT_WRITE
-#define BKPT_WRITE(addr, storage) \
+#define BKPT_WRITE(addr, storage) \
do { \
*storage = db_get_value(addr, BKPT_SIZE, FALSE); \
db_put_value(addr, BKPT_SIZE, BKPT_SET(*storage)); \
@@ -175,12 +167,12 @@
#endif
#ifndef BKPT_CLEAR
-#define BKPT_CLEAR(addr, storage) \
+#define BKPT_CLEAR(addr, storage) \
db_put_value(addr, BKPT_SIZE, *storage)
#endif
void
-db_set_breakpoints()
+db_set_breakpoints(void)
{
register db_breakpoint_t bkpt;
@@ -197,7 +189,7 @@
}
void
-db_clear_breakpoints()
+db_clear_breakpoints(void)
{
register db_breakpoint_t bkpt;
@@ -220,8 +212,7 @@
* so the breakpoint does not have to be on the breakpoint list.
*/
db_breakpoint_t
-db_set_temp_breakpoint(addr)
- db_addr_t addr;
+db_set_temp_breakpoint(db_addr_t addr)
{
register db_breakpoint_t bkpt;
@@ -242,8 +233,7 @@
}
void
-db_delete_temp_breakpoint(bkpt)
- db_breakpoint_t bkpt;
+db_delete_temp_breakpoint(db_breakpoint_t bkpt)
{
BKPT_CLEAR(bkpt->address, &bkpt->bkpt_inst);
db_breakpoint_free(bkpt);
@@ -254,7 +244,7 @@
* List breakpoints.
*/
static void
-db_list_breakpoints()
+db_list_breakpoints(void)
{
register db_breakpoint_t bkpt;
@@ -278,11 +268,7 @@
/* Delete breakpoint */
/*ARGSUSED*/
void
-db_delete_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_delete_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif)
{
db_delete_breakpoint(db_map_addr(addr), (db_addr_t)addr);
}
@@ -290,11 +276,8 @@
/* Set breakpoint with skip count */
/*ARGSUSED*/
void
-db_breakpoint_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_breakpoint_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
if (count == -1)
count = 1;
@@ -304,11 +287,8 @@
/* list breakpoints */
void
-db_listbreak_cmd(dummy1, dummy2, dummy3, dummy4)
- db_expr_t dummy1;
- boolean_t dummy2;
- db_expr_t dummy3;
- char * dummy4;
+db_listbreak_cmd(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3,
+ char *dummy4)
{
db_list_breakpoints();
}
@@ -320,8 +300,7 @@
*/
boolean_t
-db_map_equal(map1, map2)
- vm_map_t map1, map2;
+db_map_equal(vm_map_t map1, vm_map_t map2)
{
return ((map1 == map2) ||
((map1 == NULL) && (map2 == kernel_map)) ||
@@ -329,8 +308,7 @@
}
boolean_t
-db_map_current(map)
- vm_map_t map;
+db_map_current(vm_map_t map)
{
#if 0
thread_t thread;
@@ -345,8 +323,7 @@
}
vm_map_t
-db_map_addr(addr)
- vm_offset_t addr;
+db_map_addr(vm_offset_t addr)
{
#if 0
thread_t thread;
Modified: trunk/sys/ddb/db_break.h
===================================================================
--- trunk/sys/ddb/db_break.h 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_break.h 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -23,7 +24,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/ddb/db_break.h 264210 2014-04-07 01:49:30Z pfg $
*/
/*
@@ -38,7 +39,7 @@
*/
#ifndef BKPT_INST_TYPE
-#define BKPT_INST_TYPE int
+#define BKPT_INST_TYPE int
#endif
struct db_breakpoint {
Modified: trunk/sys/ddb/db_capture.c
===================================================================
--- trunk/sys/ddb/db_capture.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_capture.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2007 Robert N. M. Watson
* All rights reserved.
@@ -30,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_capture.c 217326 2011-01-12 19:54:19Z mdf $");
#include "opt_ddb.h"
Modified: trunk/sys/ddb/db_command.c
===================================================================
--- trunk/sys/ddb/db_command.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_command.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -32,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_command.c 273265 2014-10-18 19:22:59Z pfg $");
#include <sys/param.h>
#include <sys/linker_set.h>
@@ -157,7 +158,7 @@
* Utility routine - discard tokens through end-of-line.
*/
void
-db_skip_to_eol()
+db_skip_to_eol(void)
{
int t;
do {
@@ -252,11 +253,8 @@
* Helper function to match a single command.
*/
static void
-db_cmd_match(name, cmd, cmdp, resultp)
- char * name;
- struct command *cmd;
- struct command **cmdp; /* out */
- int * resultp;
+db_cmd_match(char *name, struct command *cmd, struct command **cmdp,
+ int *resultp)
{
char *lp, *rp;
int c;
@@ -291,10 +289,7 @@
* Search for command prefix.
*/
static int
-db_cmd_search(name, table, cmdp)
- char * name;
- struct command_table *table;
- struct command **cmdp; /* out */
+db_cmd_search(char *name, struct command_table *table, struct command **cmdp)
{
struct command *cmd;
int result = CMD_NONE;
@@ -315,8 +310,7 @@
}
static void
-db_cmd_list(table)
- struct command_table *table;
+db_cmd_list(struct command_table *table)
{
register struct command *cmd;
@@ -327,10 +321,8 @@
}
static void
-db_command(last_cmdp, cmd_table, dopager)
- struct command **last_cmdp; /* IN_OUT */
- struct command_table *cmd_table;
- int dopager;
+db_command(struct command **last_cmdp, struct command_table *cmd_table,
+ int dopager)
{
struct command *cmd = NULL;
int t;
@@ -483,7 +475,7 @@
}
void
-db_command_loop()
+db_command_loop(void)
{
/*
* Initialize 'prev' and 'next' to dot.
@@ -521,8 +513,7 @@
}
void
-db_error(s)
- const char *s;
+db_error(const char *s)
{
if (s)
db_printf("%s", s);
@@ -535,6 +526,11 @@
{
int error;
+ if (textdump_pending) {
+ db_printf("textdump_pending set.\n"
+ "run \"textdump unset\" first or \"textdump dump\" for a textdump.\n");
+ return;
+ }
error = doadump(FALSE);
if (error) {
db_printf("Cannot dump: ");
@@ -576,11 +572,7 @@
}
static void
-db_fncall(dummy1, dummy2, dummy3, dummy4)
- db_expr_t dummy1;
- boolean_t dummy2;
- db_expr_t dummy3;
- char * dummy4;
+db_fncall(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
{
db_expr_t fn_addr;
db_expr_t args[DB_MAXARGS];
@@ -634,16 +626,12 @@
}
static void
-db_kill(dummy1, dummy2, dummy3, dummy4)
- db_expr_t dummy1;
- boolean_t dummy2;
- db_expr_t dummy3;
- char * dummy4;
+db_kill(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
{
db_expr_t old_radix, pid, sig;
struct proc *p;
-#define DB_ERROR(f) do { db_printf f; db_flush_lex(); goto out; } while (0)
+#define DB_ERROR(f) do { db_printf f; db_flush_lex(); goto out; } while (0)
/*
* PIDs and signal numbers are typically represented in base
@@ -727,11 +715,7 @@
}
static void
-db_watchdog(dummy1, dummy2, dummy3, dummy4)
- db_expr_t dummy1;
- boolean_t dummy2;
- db_expr_t dummy3;
- char * dummy4;
+db_watchdog(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4)
{
db_expr_t old_radix, tout;
int err, i;
Modified: trunk/sys/ddb/db_command.h
===================================================================
--- trunk/sys/ddb/db_command.h 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_command.h 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -23,7 +24,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/ddb/db_command.h 208509 2010-05-24 16:41:05Z bz $
*/
#ifndef _DDB_DB_COMMAND_H_
Modified: trunk/sys/ddb/db_examine.c
===================================================================
--- trunk/sys/ddb/db_examine.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_examine.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -29,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_examine.c 273265 2014-10-18 19:22:59Z pfg $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -52,11 +53,8 @@
*/
/*ARGSUSED*/
void
-db_examine_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_examine_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
if (modif[0] != '\0')
db_strcpy(db_examine_format, modif);
@@ -68,11 +66,7 @@
}
static void
-db_examine(addr, fmt, count)
- register
- db_addr_t addr;
- char * fmt; /* format string */
- int count; /* repeat count */
+db_examine(db_addr_t addr, char *fmt, int count)
{
int c;
db_expr_t value;
@@ -197,11 +191,8 @@
/*ARGSUSED*/
void
-db_print_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_print_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
db_expr_t value;
@@ -242,8 +233,7 @@
}
void
-db_print_loc_and_inst(loc)
- db_addr_t loc;
+db_print_loc_and_inst(db_addr_t loc)
{
db_printsym(loc, DB_STGY_PROC);
db_printf(":\t");
@@ -255,11 +245,8 @@
* Syntax: search [/bhl] addr value [mask] [,count]
*/
void
-db_search_cmd(dummy1, dummy2, dummy3, dummy4)
- db_expr_t dummy1;
- boolean_t dummy2;
- db_expr_t dummy3;
- char * dummy4;
+db_search_cmd(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3,
+ char *dummy4)
{
int t;
db_addr_t addr;
@@ -323,13 +310,8 @@
}
static void
-db_search(addr, size, value, mask, count)
- register
- db_addr_t addr;
- int size;
- db_expr_t value;
- db_expr_t mask;
- unsigned int count;
+db_search(db_addr_t addr, int size, db_expr_t value, db_expr_t mask,
+ unsigned int count)
{
while (count-- != 0) {
db_prev = addr;
Modified: trunk/sys/ddb/db_expr.c
===================================================================
--- trunk/sys/ddb/db_expr.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_expr.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -29,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_expr.c 195699 2009-07-14 22:48:30Z rwatson $");
#include <sys/param.h>
Modified: trunk/sys/ddb/db_input.c
===================================================================
--- trunk/sys/ddb/db_input.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_input.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -29,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_input.c 273265 2014-10-18 19:22:59Z pfg $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -253,7 +254,7 @@
db_putnchars(BACKUP, db_lc - db_lbuf_start);
db_putnchars(BLANK, db_le - db_lbuf_start);
db_putnchars(BACKUP, db_le - db_lbuf_start);
- db_le = index(db_lbuf_start, '\0');
+ db_le = strchr(db_lbuf_start, '\0');
if (db_le[-1] == '\r' || db_le[-1] == '\n')
*--db_le = '\0';
db_lc = db_le;
@@ -346,7 +347,7 @@
}
void
-db_check_interrupt()
+db_check_interrupt(void)
{
register int c;
Modified: trunk/sys/ddb/db_lex.c
===================================================================
--- trunk/sys/ddb/db_lex.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_lex.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -32,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_lex.c 273265 2014-10-18 19:22:59Z pfg $");
#include <sys/param.h>
#include <sys/libkern.h>
@@ -49,7 +50,7 @@
static void db_unread_char(int);
int
-db_read_line()
+db_read_line(void)
{
int i;
@@ -97,7 +98,7 @@
static int db_look_char = 0;
static int
-db_read_char()
+db_read_char(void)
{
int c;
@@ -148,7 +149,7 @@
db_expr_t db_radix = 16;
void
-db_flush_lex()
+db_flush_lex(void)
{
db_flush_line();
db_look_char = 0;
@@ -156,7 +157,7 @@
}
static int
-db_lex()
+db_lex(void)
{
int c;
Modified: trunk/sys/ddb/db_lex.h
===================================================================
--- trunk/sys/ddb/db_lex.h 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_lex.h 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -23,7 +24,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/ddb/db_lex.h 174914 2007-12-26 09:33:19Z rwatson $
*/
#ifndef _DDB_DB_LEX_H_
Modified: trunk/sys/ddb/db_main.c
===================================================================
--- trunk/sys/ddb/db_main.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_main.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -25,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_main.c 234196 2012-04-12 21:34:58Z jhb $");
#include <sys/param.h>
#include <sys/systm.h>
Modified: trunk/sys/ddb/db_output.c
===================================================================
--- trunk/sys/ddb/db_output.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_output.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -33,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_output.c 273265 2014-10-18 19:22:59Z pfg $");
#include "opt_ddb.h"
@@ -91,7 +92,7 @@
* Force pending whitespace.
*/
void
-db_force_whitespace()
+db_force_whitespace(void)
{
register int last_print, next_tab;
@@ -308,7 +309,7 @@
* Return output position
*/
int
-db_print_position()
+db_print_position(void)
{
return (db_output_position);
}
Modified: trunk/sys/ddb/db_output.h
===================================================================
--- trunk/sys/ddb/db_output.h 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_output.h 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -23,7 +24,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/ddb/db_output.h 273265 2014-10-18 19:22:59Z pfg $
*/
#ifndef _DDB_DB_OUTPUT_H_
@@ -30,7 +31,7 @@
#define _DDB_DB_OUTPUT_H_
/*
- * Author: David B. Golub, Carnegie Mellon University
+ * Author: David B. Golub, Carnegie Mellon University
* Date: 8/90
*/
Modified: trunk/sys/ddb/db_print.c
===================================================================
--- trunk/sys/ddb/db_print.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_print.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -25,7 +26,7 @@
*
*/
/*
- * Author: David B. Golub, Carnegie Mellon University
+ * Author: David B. Golub, Carnegie Mellon University
* Date: 7/90
*/
@@ -34,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_print.c 290731 2015-11-12 23:49:47Z jhb $");
#include <sys/param.h>
#include <sys/kdb.h>
@@ -56,7 +57,8 @@
for (regp = db_regs; regp < db_eregs; regp++) {
if (!db_read_variable(regp, &value))
continue;
- db_printf("%-12s%#10lr", regp->name, (unsigned long)value);
+ db_printf("%-12s%#*lr", regp->name,
+ (int)(sizeof(unsigned long) * 2 + 2), (unsigned long)value);
db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset);
if (name != NULL && offset <= (unsigned long)db_maxoff &&
offset != value) {
Modified: trunk/sys/ddb/db_ps.c
===================================================================
--- trunk/sys/ddb/db_ps.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_ps.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1993 The Regents of the University of California.
* All rights reserved.
@@ -28,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_ps.c 304905 2016-08-27 11:45:05Z kib $");
#include <sys/param.h>
#include <sys/cons.h>
@@ -155,7 +156,7 @@
else if (wflag)
state[0] = 'W';
else
- state[0] = '?';
+ state[0] = '?';
}
break;
case PRS_NEW:
@@ -181,7 +182,8 @@
strlcat(state, "V", sizeof(state));
if (p->p_flag & P_SYSTEM || p->p_lock > 0)
strlcat(state, "L", sizeof(state));
- if (p->p_session != NULL && SESS_LEADER(p))
+ if (p->p_pgrp != NULL && p->p_session != NULL &&
+ SESS_LEADER(p))
strlcat(state, "s", sizeof(state));
/* Cheated here and didn't compare pgid's. */
if (p->p_flag & P_CONTROLT)
@@ -211,7 +213,7 @@
p = LIST_NEXT(p, p_list);
if (p == NULL && np > 0)
p = LIST_FIRST(&zombproc);
- }
+ }
}
static void
@@ -370,8 +372,13 @@
db_printf(" lock: %s turnstile: %p\n", td->td_lockname,
td->td_blocked);
if (TD_ON_SLEEPQ(td))
- db_printf(" wmesg: %s wchan: %p\n", td->td_wmesg,
- td->td_wchan);
+ db_printf(
+ " wmesg: %s wchan: %p sleeptimo %lx. %jx (curr %lx. %jx)\n",
+ td->td_wmesg, td->td_wchan,
+ (long)sbttobt(td->td_sleeptimo).sec,
+ (uintmax_t)sbttobt(td->td_sleeptimo).frac,
+ (long)sbttobt(sbinuptime()).sec,
+ (uintmax_t)sbttobt(sbinuptime()).frac);
db_printf(" priority: %d\n", td->td_priority);
db_printf(" container lock: %s (%p)\n", lock->lo_name, lock);
}
Modified: trunk/sys/ddb/db_run.c
===================================================================
--- trunk/sys/ddb/db_run.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_run.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -33,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_run.c 273265 2014-10-18 19:22:59Z pfg $");
#include <sys/param.h>
#include <sys/kdb.h>
@@ -54,7 +55,7 @@
#define STEP_RETURN 2
#define STEP_CALLT 3
#define STEP_CONTINUE 4
-#define STEP_INVISIBLE 5
+#define STEP_INVISIBLE 5
#define STEP_COUNT 6
static boolean_t db_sstep_print;
@@ -78,8 +79,7 @@
#endif
boolean_t
-db_stop_at_pc(is_breakpoint)
- boolean_t *is_breakpoint;
+db_stop_at_pc(boolean_t *is_breakpoint)
{
register db_addr_t pc;
register db_breakpoint_t bkpt;
@@ -180,8 +180,7 @@
}
void
-db_restart_at_pc(watchpt)
- boolean_t watchpt;
+db_restart_at_pc(boolean_t watchpt)
{
register db_addr_t pc = PC_REGS();
@@ -328,11 +327,8 @@
/* trace and print until call/return */
/*ARGSUSED*/
void
-db_trace_until_call_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_trace_until_call_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
boolean_t print = FALSE;
@@ -350,11 +346,8 @@
/*ARGSUSED*/
void
-db_trace_until_matching_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_trace_until_matching_cmd(db_expr_t addr, boolean_t have_addr,
+ db_expr_t count, char *modif)
{
boolean_t print = FALSE;
@@ -374,11 +367,8 @@
/* continue */
/*ARGSUSED*/
void
-db_continue_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_continue_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
if (modif[0] == 'c')
db_run_mode = STEP_COUNT;
Modified: trunk/sys/ddb/db_script.c
===================================================================
--- trunk/sys/ddb/db_script.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_script.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2007 Robert N. M. Watson
* All rights reserved.
@@ -54,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_script.c 331301 2018-03-21 15:05:45Z avg $");
#include <sys/param.h>
#include <sys/kdb.h>
@@ -294,7 +295,7 @@
buffer = drd->drd_buffer;
strcpy(buffer, dsp->ds_script);
while ((command = strsep(&buffer, ";")) != NULL) {
- db_printf("db:%d:%s> %s\n", db_recursion, scriptname,
+ db_printf("db:%d:%s> %s\n", db_recursion, dsp->ds_scriptname,
command);
db_command_trim(&command);
prev_jb = kdb_jmpbuf(jb);
Modified: trunk/sys/ddb/db_sym.c
===================================================================
--- trunk/sys/ddb/db_sym.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_sym.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -29,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_sym.c 328000 2018-01-15 12:15:04Z avg $");
#include <sys/param.h>
#include <sys/pcpu.h>
@@ -81,8 +82,8 @@
return (1);
case DB_VAR_SET:
- if (*(int *)valuep < -1 && *(int *)valuep > mp_maxid) {
- db_printf("Invalid value: %d", *(int*)valuep);
+ if (*(int *)valuep < -1 || *(int *)valuep > mp_maxid) {
+ db_printf("Invalid value: %d\n", *(int*)valuep);
return (0);
}
db_cpu = *(int *)valuep;
@@ -170,11 +171,7 @@
* Add symbol table, with given name, to list of symbol tables.
*/
void
-db_add_symbol_table(start, end, name, ref)
- char *start;
- char *end;
- char *name;
- char *ref;
+db_add_symbol_table(char *start, char *end, char *name, char *ref)
{
if (db_nsymtab >= MAXNOSYMTABS) {
printf ("No slots left for %s symbol table", name);
@@ -195,9 +192,7 @@
* overwritten by each call... but in practice this seems okay.
*/
static char *
-db_qualify(sym, symtabname)
- c_db_sym_t sym;
- register char *symtabname;
+db_qualify(c_db_sym_t sym, char *symtabname)
{
const char *symname;
static char tmp[256];
@@ -209,10 +204,7 @@
boolean_t
-db_eqname(src, dst, c)
- const char *src;
- const char *dst;
- int c;
+db_eqname(const char *src, const char *dst, int c)
{
if (!strcmp(src, dst))
return (TRUE);
@@ -222,9 +214,7 @@
}
boolean_t
-db_value_of_name(name, valuep)
- const char *name;
- db_expr_t *valuep;
+db_value_of_name(const char *name, db_expr_t *valuep)
{
c_db_sym_t sym;
@@ -236,9 +226,7 @@
}
boolean_t
-db_value_of_name_pcpu(name, valuep)
- const char *name;
- db_expr_t *valuep;
+db_value_of_name_pcpu(const char *name, db_expr_t *valuep)
{
static char tmp[256];
db_expr_t value;
@@ -261,9 +249,7 @@
}
boolean_t
-db_value_of_name_vnet(name, valuep)
- const char *name;
- db_expr_t *valuep;
+db_value_of_name_vnet(const char *name, db_expr_t *valuep)
{
#ifdef VIMAGE
static char tmp[256];
@@ -296,8 +282,7 @@
* otherwise, all symbol tables will be searched.
*/
static c_db_sym_t
-db_lookup(symstr)
- const char *symstr;
+db_lookup(const char *symstr)
{
c_db_sym_t sp;
register int i;
@@ -354,8 +339,7 @@
* Used by db_symbol_values to decide whether to qualify a symbol.
*/
static boolean_t
-db_symbol_is_ambiguous(sym)
- c_db_sym_t sym;
+db_symbol_is_ambiguous(c_db_sym_t sym)
{
const char *sym_name;
register int i;
@@ -381,10 +365,7 @@
* and the difference between val and the symbol found.
*/
c_db_sym_t
-db_search_symbol( val, strategy, offp)
- register db_addr_t val;
- db_strategy_t strategy;
- db_expr_t *offp;
+db_search_symbol(db_addr_t val, db_strategy_t strategy, db_expr_t *offp)
{
register
unsigned int diff;
@@ -409,10 +390,7 @@
* Return name and value of a symbol
*/
void
-db_symbol_values(sym, namep, valuep)
- c_db_sym_t sym;
- const char **namep;
- db_expr_t *valuep;
+db_symbol_values(c_db_sym_t sym, const char **namep, db_expr_t *valuep)
{
db_expr_t value;
@@ -449,9 +427,7 @@
db_expr_t db_maxoff = 0x10000;
void
-db_printsym(off, strategy)
- db_expr_t off;
- db_strategy_t strategy;
+db_printsym(db_expr_t off, db_strategy_t strategy)
{
db_expr_t d;
char *filename;
@@ -486,20 +462,13 @@
}
static boolean_t
-db_line_at_pc( sym, filename, linenum, pc)
- c_db_sym_t sym;
- char **filename;
- int *linenum;
- db_expr_t pc;
+db_line_at_pc(c_db_sym_t sym, char **filename, int *linenum, db_expr_t pc)
{
return X_db_line_at_pc( db_last_symtab, sym, filename, linenum, pc);
}
int
-db_sym_numargs(sym, nargp, argnames)
- c_db_sym_t sym;
- int *nargp;
- char **argnames;
+db_sym_numargs(c_db_sym_t sym, int *nargp, char **argnames)
{
return X_db_sym_numargs(db_last_symtab, sym, nargp, argnames);
}
Modified: trunk/sys/ddb/db_sym.h
===================================================================
--- trunk/sys/ddb/db_sym.h 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_sym.h 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -23,7 +24,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/ddb/db_sym.h 273265 2014-10-18 19:22:59Z pfg $
*/
#ifndef _DDB_DB_SYM_H_
@@ -30,7 +31,7 @@
#define _DDB_DB_SYM_H_
/*
- * Author: Alessandro Forin, Carnegie Mellon University
+ * Author: Alessandro Forin, Carnegie Mellon University
* Date: 8/90
*/
@@ -63,8 +64,8 @@
typedef int db_strategy_t; /* search strategy */
#define DB_STGY_ANY 0 /* anything goes */
-#define DB_STGY_XTRN 1 /* only external symbols */
-#define DB_STGY_PROC 2 /* only procedures */
+#define DB_STGY_XTRN 1 /* only external symbols */
+#define DB_STGY_PROC 2 /* only procedures */
/*
* Functions exported by the symtable module
@@ -78,11 +79,11 @@
void db_symbol_values(c_db_sym_t, const char **, db_expr_t *);
/* return name and value of symbol */
-#define db_find_sym_and_offset(val,namep,offp) \
+#define db_find_sym_and_offset(val,namep,offp) \
db_symbol_values(db_search_symbol(val,DB_STGY_ANY,offp),namep,0)
/* find name&value given approx val */
-#define db_find_xtrn_sym_and_offset(val,namep,offp) \
+#define db_find_xtrn_sym_and_offset(val,namep,offp) \
db_symbol_values(db_search_symbol(val,DB_STGY_XTRN,offp),namep,0)
/* ditto, but no locals */
Modified: trunk/sys/ddb/db_textdump.c
===================================================================
--- trunk/sys/ddb/db_textdump.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_textdump.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2007 Robert N. M. Watson
* All rights reserved.
@@ -57,10 +58,12 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_textdump.c 273265 2014-10-18 19:22:59Z pfg $");
#include "opt_config.h"
+#include "opt_ddb.h"
+
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/kernel.h>
@@ -118,7 +121,11 @@
* Is a textdump scheduled? If so, the shutdown code will invoke our dumpsys
* routine instead of the machine-dependent kernel dump routine.
*/
-int textdump_pending;
+#ifdef TEXTDUMP_PREFERRED
+int textdump_pending = 1;
+#else
+int textdump_pending = 0;
+#endif
SYSCTL_INT(_debug_ddb_textdump, OID_AUTO, pending, CTLFLAG_RW,
&textdump_pending, 0,
"Perform textdump instead of regular kernel dump.");
@@ -201,6 +208,10 @@
{
struct ustar_header *uhp;
+#ifdef TEXTDUMP_VERBOSE
+ if (textdump_error == 0)
+ printf("textdump: creating '%s'.\n", filename);
+#endif
uhp = (struct ustar_header *)block_buffer;
bzero(uhp, sizeof(*uhp));
strlcpy(uhp->uh_filename, filename, sizeof(uhp->uh_filename));
@@ -237,6 +248,9 @@
return (ENOSPC);
textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset,
TEXTDUMP_BLOCKSIZE);
+ if (textdump_error)
+ printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset,
+ textdump_error);
return (textdump_error);
}
@@ -335,8 +349,8 @@
*/
total_len = 0;
offset = 0;
- msgbuf_peekbytes(msgbufp, NULL, 0, &seq);
- while ((len = msgbuf_peekbytes(msgbufp, buf, sizeof(buf), &seq)) > 0) {
+ msgbuf_peekbytes(msgbufp, NULL, 0, &seq);
+ while ((len = msgbuf_peekbytes(msgbufp, buf, sizeof(buf), &seq)) > 0) {
for (i = 0; i < len; i++) {
if (buf[i] == '\0')
continue;
@@ -349,7 +363,7 @@
total_len += offset;
offset = 0;
}
- }
+ }
total_len += offset; /* Without the zero-padding. */
if (offset != 0) {
bzero(textdump_block_buffer + offset,
@@ -430,7 +444,7 @@
* of data.
*/
if (di->mediasize < SIZEOF_METADATA + 2 * sizeof(kdh)) {
- printf("Insufficient space on dump partition.\n");
+ printf("Insufficient space on dump partition for minimal textdump.\n");
return;
}
textdump_error = 0;
@@ -480,9 +494,9 @@
if (textdump_error == 0)
(void)dump_write(di, NULL, 0, 0, 0);
if (textdump_error == ENOSPC)
- printf("Insufficient space on dump partition\n");
+ printf("Textdump: Insufficient space on dump partition\n");
else if (textdump_error != 0)
- printf("Error %d writing dump\n", textdump_error);
+ printf("Textdump: Error %d writing dump\n", textdump_error);
else
printf("Textdump complete.\n");
textdump_pending = 0;
@@ -499,7 +513,7 @@
db_textdump_usage(void)
{
- db_printf("textdump [unset|set|status]\n");
+ db_printf("textdump [unset|set|status|dump]\n");
}
void
@@ -528,6 +542,10 @@
} else if (strcmp(db_tok_string, "unset") == 0) {
textdump_pending = 0;
db_printf("textdump unset\n");
- } else
+ } else if (strcmp(db_tok_string, "dump") == 0) {
+ textdump_pending = 1;
+ doadump(TRUE);
+ } else {
db_textdump_usage();
+ }
}
Modified: trunk/sys/ddb/db_thread.c
===================================================================
--- trunk/sys/ddb/db_thread.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_thread.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2004 Marcel Moolenaar
* All rights reserved.
@@ -25,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_thread.c 228568 2011-12-16 11:42:50Z kib $");
#include <sys/param.h>
#include <sys/systm.h>
Modified: trunk/sys/ddb/db_variables.c
===================================================================
--- trunk/sys/ddb/db_variables.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_variables.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -29,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_variables.c 195699 2009-07-14 22:48:30Z rwatson $");
#include <sys/param.h>
#include <sys/systm.h>
Modified: trunk/sys/ddb/db_variables.h
===================================================================
--- trunk/sys/ddb/db_variables.h 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_variables.h 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -23,11 +24,11 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/ddb/db_variables.h 273265 2014-10-18 19:22:59Z pfg $
*/
/*
- * Author: David B. Golub, Carnegie Mellon University
+ * Author: David B. Golub, Carnegie Mellon University
* Date: 7/90
*/
@@ -44,8 +45,8 @@
db_expr_t *valuep; /* value of variable */
/* function to call when reading/writing */
db_varfcn_t *fcn;
-#define DB_VAR_GET 0
-#define DB_VAR_SET 1
+#define DB_VAR_GET 0
+#define DB_VAR_SET 1
};
#define FCN_NULL ((db_varfcn_t *)0)
Modified: trunk/sys/ddb/db_watch.c
===================================================================
--- trunk/sys/ddb/db_watch.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_watch.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -29,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_watch.c 273265 2014-10-18 19:22:59Z pfg $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -67,7 +68,7 @@
vm_size_t size);
static db_watchpoint_t
-db_watchpoint_alloc()
+db_watchpoint_alloc(void)
{
register db_watchpoint_t watch;
@@ -86,8 +87,7 @@
}
static void
-db_watchpoint_free(watch)
- register db_watchpoint_t watch;
+db_watchpoint_free(db_watchpoint_t watch)
{
watch->link = db_free_watchpoints;
db_free_watchpoints = watch;
@@ -94,10 +94,7 @@
}
static void
-db_set_watchpoint(map, addr, size)
- vm_map_t map;
- db_addr_t addr;
- vm_size_t size;
+db_set_watchpoint(vm_map_t map, db_addr_t addr, vm_size_t size)
{
register db_watchpoint_t watch;
@@ -137,9 +134,7 @@
}
static void
-db_delete_watchpoint(map, addr)
- vm_map_t map;
- db_addr_t addr;
+db_delete_watchpoint(vm_map_t map, db_addr_t addr)
{
register db_watchpoint_t watch;
register db_watchpoint_t *prev;
@@ -159,7 +154,7 @@
}
static void
-db_list_watchpoints()
+db_list_watchpoints(void)
{
register db_watchpoint_t watch;
@@ -189,11 +184,8 @@
/* Delete watchpoint */
/*ARGSUSED*/
void
-db_deletewatch_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_deletewatch_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
db_delete_watchpoint(db_map_addr(addr), addr);
}
@@ -201,11 +193,8 @@
/* Set watchpoint */
/*ARGSUSED*/
void
-db_watchpoint_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_watchpoint_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
vm_size_t size;
db_expr_t value;
@@ -230,7 +219,7 @@
}
void
-db_set_watchpoints()
+db_set_watchpoints(void)
{
register db_watchpoint_t watch;
@@ -248,7 +237,7 @@
}
void
-db_clear_watchpoints()
+db_clear_watchpoints(void)
{
db_watchpoints_inserted = FALSE;
}
@@ -255,10 +244,7 @@
#ifdef notused
static boolean_t
-db_find_watchpoint(map, addr, regs)
- vm_map_t map;
- db_addr_t addr;
- db_regs_t *regs;
+db_find_watchpoint(vm_map_t map, db_addr_t addr, db_regs_t regs)
{
register db_watchpoint_t watch;
db_watchpoint_t found = 0;
@@ -295,16 +281,13 @@
/* Delete hardware watchpoint */
/*ARGSUSED*/
void
-db_deletehwatch_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_deletehwatch_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
int rc;
- if (count < 0)
- count = 4;
+ if (count < 0)
+ count = 4;
rc = db_md_clr_watchpoint(addr, count);
if (rc < 0)
@@ -314,16 +297,13 @@
/* Set hardware watchpoint */
/*ARGSUSED*/
void
-db_hwatchpoint_cmd(addr, have_addr, count, modif)
- db_expr_t addr;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_hwatchpoint_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
+ char *modif)
{
int rc;
- if (count < 0)
- count = 4;
+ if (count < 0)
+ count = 4;
rc = db_md_set_watchpoint(addr, count);
if (rc < 0)
Modified: trunk/sys/ddb/db_watch.h
===================================================================
--- trunk/sys/ddb/db_watch.h 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_watch.h 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -23,11 +24,11 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/ddb/db_watch.h 273265 2014-10-18 19:22:59Z pfg $
*/
/*
- * Author: David B. Golub, Carnegie Mellon University
+ * Author: David B. Golub, Carnegie Mellon University
* Date: 10/90
*/
Modified: trunk/sys/ddb/db_write_cmd.c
===================================================================
--- trunk/sys/ddb/db_write_cmd.c 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/db_write_cmd.c 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -29,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/ddb/db_write_cmd.c 273265 2014-10-18 19:22:59Z pfg $");
#include <sys/param.h>
@@ -43,11 +44,8 @@
*/
/*ARGSUSED*/
void
-db_write_cmd(address, have_addr, count, modif)
- db_expr_t address;
- boolean_t have_addr;
- db_expr_t count;
- char * modif;
+db_write_cmd(db_expr_t address, boolean_t have_addr, db_expr_t count,
+ char * modif)
{
register
db_addr_t addr;
Modified: trunk/sys/ddb/ddb.h
===================================================================
--- trunk/sys/ddb/ddb.h 2018-05-28 00:27:43 UTC (rev 10128)
+++ trunk/sys/ddb/ddb.h 2018-05-28 00:28:05 UTC (rev 10129)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1993, Garrett A. Wollman.
* Copyright (c) 1993, University of Vermont and State Agricultural College.
@@ -27,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sys/ddb/ddb.h 264210 2014-04-07 01:49:30Z pfg $
*/
/*
@@ -118,7 +119,7 @@
* in modules in which case they will be available only when
* the module is loaded.
*/
-#define _DB_SET(_suffix, _name, _func, list, _flag, _more) \
+#define _DB_SET(_suffix, _name, _func, list, _flag, _more) \
static struct command __CONCAT(_name,_suffix) = { \
.name = __STRING(_name), \
.fcn = _func, \
@@ -145,7 +146,7 @@
* This macro is mostly used to define commands placed in one of
* the ddb command tables; see DB_COMMAND, etc. below.
*/
-#define _DB_FUNC(_suffix, _name, _func, list, _flag, _more) \
+#define _DB_FUNC(_suffix, _name, _func, list, _flag, _more) \
static db_cmdfcn_t _func; \
_DB_SET(_suffix, _name, _func, list, _flag, _more); \
static void \
@@ -152,20 +153,20 @@
_func(db_expr_t addr, boolean_t have_addr, db_expr_t count, char *modif)
/* common idom provided for backwards compatibility */
-#define DB_FUNC(_name, _func, list, _flag, _more) \
+#define DB_FUNC(_name, _func, list, _flag, _more) \
_DB_FUNC(_cmd, _name, _func, list, _flag, _more)
-#define DB_COMMAND(cmd_name, func_name) \
+#define DB_COMMAND(cmd_name, func_name) \
_DB_FUNC(_cmd, cmd_name, func_name, db_cmd_table, 0, NULL)
-#define DB_ALIAS(alias_name, func_name) \
+#define DB_ALIAS(alias_name, func_name) \
_DB_SET(_cmd, alias_name, func_name, db_cmd_table, 0, NULL)
-#define DB_SHOW_COMMAND(cmd_name, func_name) \
+#define DB_SHOW_COMMAND(cmd_name, func_name) \
_DB_FUNC(_show, cmd_name, func_name, db_show_table, 0, NULL)
-#define DB_SHOW_ALIAS(alias_name, func_name) \
+#define DB_SHOW_ALIAS(alias_name, func_name) \
_DB_SET(_show, alias_name, func_name, db_show_table, 0, NULL)
-#define DB_SHOW_ALL_COMMAND(cmd_name, func_name) \
+#define DB_SHOW_ALL_COMMAND(cmd_name, func_name) \
_DB_FUNC(_show_all, cmd_name, func_name, db_show_all_table, 0, NULL)
-#define DB_SHOW_ALL_ALIAS(alias_name, func_name) \
+#define DB_SHOW_ALL_ALIAS(alias_name, func_name) \
_DB_SET(_show_all, alias_name, func_name, db_show_all_table, 0, NULL)
extern db_expr_t db_maxoff;
More information about the Midnightbsd-cvs
mailing list