mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Create a C wrapper around the Forth key word to be used in the debugger instead of calling availchar()/getchar(). Using this
wrapper means that the debugger now works correctly under PPC. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@822 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Mark Cave-Ayland
parent
3330f2e126
commit
fc58e30c96
@@ -446,6 +446,27 @@ int printf_console( const char *fmt, ... )
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
int getchar_console( void )
|
||||||
|
{
|
||||||
|
cell tmp;
|
||||||
|
|
||||||
|
/* Push to the Forth interpreter for console output */
|
||||||
|
tmp = rstackcnt;
|
||||||
|
|
||||||
|
trampoline[1] = findword("key");
|
||||||
|
|
||||||
|
PUSHR(PC);
|
||||||
|
PC = pointer2cell(trampoline);
|
||||||
|
|
||||||
|
while (rstackcnt > tmp) {
|
||||||
|
dbg_interp_printk("getchar_console: NEXT\n");
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
return POP();
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
display_dbg_dstack ( void )
|
display_dbg_dstack ( void )
|
||||||
{
|
{
|
||||||
@@ -567,8 +588,7 @@ do_source_dbg( struct debug_xt *debug_xt_item )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* Otherwise in step mode, prompt for a keypress */
|
/* Otherwise in step mode, prompt for a keypress */
|
||||||
while (!availchar());
|
k = getchar_console();
|
||||||
k = getchar();
|
|
||||||
|
|
||||||
/* Only proceed if done is true */
|
/* Only proceed if done is true */
|
||||||
while (!done)
|
while (!done)
|
||||||
@@ -601,8 +621,7 @@ do_source_dbg( struct debug_xt *debug_xt_item )
|
|||||||
/* Down - mark current word for debug and step into it */
|
/* Down - mark current word for debug and step into it */
|
||||||
done = add_debug_xt(read_ucell(cell2pointer(PC)));
|
done = add_debug_xt(read_ucell(cell2pointer(PC)));
|
||||||
if (!done) {
|
if (!done) {
|
||||||
while (!availchar());
|
k = getchar_console();
|
||||||
k = getchar();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -618,8 +637,7 @@ do_source_dbg( struct debug_xt *debug_xt_item )
|
|||||||
/* Display rstack */
|
/* Display rstack */
|
||||||
display_dbg_rstack();
|
display_dbg_rstack();
|
||||||
done = 0;
|
done = 0;
|
||||||
while (!availchar());
|
k = getchar_console();
|
||||||
k = getchar();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
@@ -636,8 +654,7 @@ do_source_dbg( struct debug_xt *debug_xt_item )
|
|||||||
default:
|
default:
|
||||||
/* Display debug banner */
|
/* Display debug banner */
|
||||||
printf_console(DEBUG_BANNER);
|
printf_console(DEBUG_BANNER);
|
||||||
while (!availchar());
|
k = getchar_console();
|
||||||
k = getchar();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user