Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 May 2004 18:30:04 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 52052 for review
Message-ID:  <200405020130.i421U4QZ083887@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=52052

Change 52052 by marcel@marcel_nfs on 2004/05/01 18:29:05

	Add commands to set and show threads. Needs fleshing out.
	While here, cleanup a lot of unused code.

Affected files ...

.. //depot/projects/gdb/sys/conf/files#21 edit
.. //depot/projects/gdb/sys/ddb/db_command.c#3 edit
.. //depot/projects/gdb/sys/ddb/db_ps.c#4 edit
.. //depot/projects/gdb/sys/ddb/db_thread.c#1 add
.. //depot/projects/gdb/sys/ddb/ddb.h#5 edit

Differences ...

==== //depot/projects/gdb/sys/conf/files#21 (text+ko) ====

@@ -237,6 +237,7 @@
 ddb/db_ps.c			optional	ddb
 ddb/db_run.c			optional	ddb
 ddb/db_sym.c			optional	ddb
+ddb/db_thread.c			optional	ddb
 ddb/db_variables.c		optional	ddb
 ddb/db_watch.c			optional	ddb
 ddb/db_write_cmd.c		optional	ddb

==== //depot/projects/gdb/sys/ddb/db_command.c#3 (text+ko) ====

@@ -67,7 +67,6 @@
 SET_DECLARE(db_show_cmd_set, struct command);
 
 static db_cmdfcn_t	db_fncall;
-static db_cmdfcn_t	db_gdb;
 static db_cmdfcn_t	db_kill;
 static db_cmdfcn_t	db_reset;
 static db_cmdfcn_t	db_watchdog;
@@ -375,9 +374,6 @@
  */
 
 static struct command db_show_all_cmds[] = {
-#if 0
-	{ "threads",	db_show_all_threads,	0,	0 },
-#endif
 	{ "procs",	db_ps,			0,	0 },
 	{ (char *)0 }
 };
@@ -386,10 +382,7 @@
 	{ "all",	0,			0,	db_show_all_cmds },
 	{ "registers",	db_show_regs,		0,	0 },
 	{ "breaks",	db_listbreak_cmd, 	0,	0 },
-	{ "thread",	db_show_one_thread,	0,	0 },
-#if 0
-	{ "port",	ipc_port_print,		0,	0 },
-#endif
+	{ "threads",	db_show_threads,	0,	0 },
 	{ (char *)0, }
 };
 
@@ -421,29 +414,15 @@
 	{ "call",	db_fncall,		CS_OWN,	0 },
 	{ "show",	0,			0,	db_show_cmds },
 	{ "ps",		db_ps,			0,	0 },
-	{ "gdb",	db_gdb,			0,	0 },
 	{ "reset",	db_reset,		0,	0 },
 	{ "kill",	db_kill,		CS_OWN,	0 },
 	{ "watchdog",	db_watchdog,		0,	0 },
+	{ "thread",	db_set_thread,		0,	0 },
 	{ (char *)0, }
 };
 
 static struct command	*db_last_command = 0;
 
-#if 0
-void
-db_help_cmd()
-{
-	struct command *cmd = db_command_table;
-
-	while (cmd->name != 0) {
-	    db_printf("%-12s", cmd->name);
-	    db_end_line();
-	    cmd++;
-	}
-}
-#endif
-
 /*
  * At least one non-optional command must be implemented using
  * DB_COMMAND() so that db_cmd_set gets created.  Here is one.
@@ -553,32 +532,6 @@
 	db_printf("%#lr\n", (long)retval);
 }
 
-/* Enter GDB remote protocol debugger on the next trap. */
-
-void	  *gdb_arg = NULL;
-cn_getc_t *gdb_getc;
-cn_putc_t *gdb_putc;
-
-static void
-db_gdb (dummy1, dummy2, dummy3, dummy4)
-	db_expr_t	dummy1;
-	boolean_t	dummy2;
-	db_expr_t	dummy3;
-	char *		dummy4;
-{
-
-	if (gdb_arg == NULL) {
-		db_printf("No gdb port enabled. Set flag 0x80 on desired port\n");
-		db_printf("in your configuration file (currently sio only).\n");
-		return;
-	}
-	boothowto ^= RB_GDB;
-
-	db_printf("Next trap will enter %s\n",
-		   boothowto & RB_GDB ? "GDB remote protocol mode"
-				      : "DDB debugger");
-}
-
 static void
 db_kill(dummy1, dummy2, dummy3, dummy4)
 	db_expr_t	dummy1;

==== //depot/projects/gdb/sys/ddb/db_ps.c#4 (text+ko) ====

@@ -166,29 +166,3 @@
 	} else
 		db_printf(" %s\n", p->p_comm);
 }
-
-
-#define INKERNEL(va)    (((vm_offset_t)(va)) >= USRSTACK)
-void
-db_show_one_thread(db_expr_t addr, boolean_t have_addr,
-		db_expr_t count, char *modif)
-{
-	struct proc *p;
-	struct thread *td;
-
-	if (!have_addr)
-		td = curthread;
-	else if (!INKERNEL(addr)) {
-		printf("bad thread address");
-		return;
-	} else
-		td = (struct thread *)addr;
-	/* quick sanity check */
-	if ((p = td->td_proc) != td->td_ksegrp->kg_proc)
-		return;
-	printf("Proc %p ",p);
-	dumpthread(p, td);
-#ifdef	__i386__
-	db_stack_thread((db_expr_t)td, 1, count, modif);
-#endif
-}

==== //depot/projects/gdb/sys/ddb/ddb.h#5 (text+ko) ====

@@ -69,9 +69,7 @@
 	db_expr_t count;					\
 	char *modif;
 
-extern char *esym;
 extern db_expr_t db_maxoff;
-extern int db_active;
 extern int db_indent;
 extern int db_inst_count;
 extern int db_load_count;
@@ -112,8 +110,6 @@
 void		db_stack_thread(db_expr_t addr, boolean_t have_addr,
 				db_expr_t count, char *modif);
 
-void		_db_init(void);
-
 db_cmdfcn_t	db_breakpoint_cmd;
 db_cmdfcn_t	db_continue_cmd;
 db_cmdfcn_t	db_delete_cmd;
@@ -126,21 +122,15 @@
 db_cmdfcn_t	db_ps;
 db_cmdfcn_t	db_search_cmd;
 db_cmdfcn_t	db_set_cmd;
+db_cmdfcn_t	db_set_thread;
 db_cmdfcn_t	db_show_regs;
+db_cmdfcn_t	db_show_threads;
 db_cmdfcn_t	db_single_step_cmd;
 db_cmdfcn_t	db_stack_trace_cmd;
 db_cmdfcn_t	db_trace_until_call_cmd;
 db_cmdfcn_t	db_trace_until_matching_cmd;
 db_cmdfcn_t	db_watchpoint_cmd;
 db_cmdfcn_t	db_write_cmd;
-db_cmdfcn_t	db_show_one_thread;
-
-#if 0
-db_cmdfcn_t	db_help_cmd;
-db_cmdfcn_t	db_show_all_threads;
-db_cmdfcn_t	ipc_port_print;
-db_cmdfcn_t	vm_page_print;
-#endif
 
 db_page_calloutfcn_t db_simple_pager;
 
@@ -161,14 +151,4 @@
 	struct command *more;	/* another level of command */
 };
 
-/* XXX: UGLY hack */
-#ifdef CN_DEAD
-/*
- * Routines to support GDB on an sio port.
- */
-extern void	 *gdb_arg;
-extern cn_getc_t *gdb_getc;
-extern cn_putc_t *gdb_putc;
-#endif
-
 #endif /* !_DDB_DDB_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405020130.i421U4QZ083887>