Ejemplo n.º 1
0
/* This function is called from machine trap code. */
void
db_command_loop(void)
{
	label_t	db_jmpbuf;
	label_t	*savejmp;

	/*
	 * Initialize 'prev' and 'next' to dot.
	 */
	db_prev = db_dot;
	db_next = db_dot;

	db_cmd_loop_done = false;

	/* Init default command tables add machine, base,
	   show command tables to the list */
	db_init_commands();

	/* save context for return from ddb */
	savejmp = db_recover;
	db_recover = &db_jmpbuf;
	(void) setjmp(&db_jmpbuf);

	/*
	 * Execute default ddb start commands only if this is the
	 * first entry into DDB, in case the start commands fault
	 * and we recurse into here.
	 */
	if (!savejmp)
		db_execute_commandlist(db_cmd_on_enter);

	(void) setjmp(&db_jmpbuf);
	while (!db_cmd_loop_done) {
		if (db_print_position() != 0)
			db_printf("\n");
		db_output_line = 0;
		(void) db_read_line();
		db_command(&db_last_command);
	}

	db_recover = savejmp;
}
Ejemplo n.º 2
0
void
db_command_loop(void)
{
	/*
	 * Initialize 'prev' and 'next' to dot.
	 */
	db_prev = db_dot;
	db_next = db_dot;

	db_cmd_loop_done = 0;
	while (!db_cmd_loop_done) {

	    setjmp(db_jmpbuf);
	    if (db_print_position() != 0)
		db_printf("\n");

	    db_printf("db> ");
	    db_read_line();

	    db_command(&db_last_command, db_command_table,
		    SET_BEGIN(db_cmd_set), SET_LIMIT(db_cmd_set));
	}
}
Ejemplo n.º 3
0
void
db_command_loop(void)
{
	label_t		db_jmpbuf;
	label_t		*savejmp;
	extern int	db_output_line;

	/*
	 * Initialize 'prev' and 'next' to dot.
	 */
	db_prev = db_dot;
	db_next = db_dot;

	db_cmd_loop_done = 0;

	savejmp = db_recover;
	db_recover = &db_jmpbuf;
	(void) setjmp(&db_jmpbuf);

	while (!db_cmd_loop_done) {

		if (db_print_position() != 0)
			db_printf("\n");
		db_output_line = 0;

#ifdef MULTIPROCESSOR
		db_printf("ddb{%d}> ", CPU_INFO_UNIT(curcpu()));
#else
		db_printf("ddb> ");
#endif
		(void) db_read_line();

		db_command(&db_last_command, db_command_table);
	}

	db_recover = savejmp;
}