Renamed debugger mutexes

date	2000.05.16.22.05.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 16:23:48 +00:00
parent eb13f4d018
commit d3e2cc0477
2 changed files with 62 additions and 13 deletions

View File

@ -200,6 +200,7 @@ enum AmlDebuggerCommands
CMD_STOP,
CMD_TABLES,
CMD_TERMINATE,
CMD_THREADS,
CMD_TREE,
CMD_UNLOAD
};
@ -249,6 +250,7 @@ COMMAND_INFO Commands[] =
"STOP", 0,
"TABLES", 0,
"TERMINATE", 0,
"THREADS", 3,
"TREE", 0,
"UNLOAD", 0,
NULL, 0
@ -293,6 +295,7 @@ DbDisplayHelp (void)
OsdPrintf ("Stats [Memory|Misc|Objects|Tables] Display namespace and memory statistics\n");
OsdPrintf ("Tables Display info about loaded ACPI tables\n");
OsdPrintf ("Terminate Delete namespace and all internal objects\n");
OsdPrintf ("Thread <Threads><Loops><NamePath> Spawn threads to execute method(s)\n");
OsdPrintf ("Unload Unload an ACPI table\n");
OsdPrintf ("! <CommandNumber> Execute command from history buffer\n");
OsdPrintf ("!! Execute last command again\n");
@ -731,6 +734,10 @@ DbCommandDispatch (
// AcpiInitialize (NULL);
break;
case CMD_THREADS:
DbCreateExecutionThreads (Args[1], Args[2], Args[3]);
break;
case CMD_TREE:
DbDisplayCallingTree ();
break;
@ -798,9 +805,9 @@ DbExecuteThread (
Gbl_MethodExecuting = FALSE;
Gbl_StepToNextCall = FALSE;
CmAcquireMutex (MTX_DEBUGGER);
CmAcquireMutex (MTX_DEBUG_CMD_READY);
Status = DbCommandDispatch (LineBuf, NULL, NULL);
CmReleaseMutex (MTX_DEBUG_COMMAND);
CmReleaseMutex (MTX_DEBUG_CMD_COMPLETE);
}
}
@ -883,10 +890,13 @@ DbUserCommands (
if (Gbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED)
{
/* Signal the debug thread that we have a command to execute */
/*
* Signal the debug thread that we have a command to execute,
* and wait for the command to complete.
*/
CmReleaseMutex (MTX_DEBUGGER);
CmAcquireMutex (MTX_DEBUG_COMMAND);
CmReleaseMutex (MTX_DEBUG_CMD_READY);
CmAcquireMutex (MTX_DEBUG_CMD_COMPLETE);
}
else

View File

@ -196,9 +196,6 @@ DbSingleStep (
case OPTYPE_NAMED_OBJECT:
switch (Op->Opcode)
{
/*
case AML_MethodOp:
*/
case AML_NAMEPATH_OP:
return (AE_OK);
break;
@ -298,8 +295,38 @@ DbSingleStep (
Status = AE_CTRL_TRUE;
while (Status == AE_CTRL_TRUE)
{
CmReleaseMutex (MTX_DEBUG_COMMAND);
CmAcquireMutex (MTX_DEBUGGER);
if (Gbl_DebuggerConfiguration == DEBUGGER_MULTI_THREADED)
{
/* Handshake with the front-end that gets user command lines */
CmReleaseMutex (MTX_DEBUG_CMD_COMPLETE);
CmAcquireMutex (MTX_DEBUG_CMD_READY);
}
else
{
/* Single threaded, we must get a command line ourselves */
/* Force output to console until a command is entered */
DbSetOutputDestination (DB_CONSOLE_OUTPUT);
/* Different prompt if method is executing */
if (!Gbl_MethodExecuting)
{
OsdPrintf ("%1c ", DB_COMMAND_PROMPT);
}
else
{
OsdPrintf ("%1c ", DB_EXECUTE_PROMPT);
}
/* Get the user input line */
OsdGetLine (LineBuf);
}
Status = DbCommandDispatch (LineBuf, WalkState, Op);
}
@ -333,14 +360,26 @@ DbInitialize (void)
Buffer = OsdAllocate (BUFFER_SIZE);
// setvbuf (stdin, NULL, _IONBF, 0);
/* Initial scope is the root */
ScopeBuf [0] = '\\';
ScopeBuf [1] = 0;
/*
* If configured for multi-thread support, the debug executor runs in
* a separate thread so that the front end can be in another address
* space, environment, or even another machine.
*/
if (Gbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED)
{
CmAcquireMutex (MTX_DEBUG_COMMAND);
CmAcquireMutex (MTX_DEBUGGER);
/* These were created with one unit, grab it */
CmAcquireMutex (MTX_DEBUG_CMD_COMPLETE);
CmAcquireMutex (MTX_DEBUG_CMD_READY);
/* Create the debug execution thread to execute commands */
OsdQueueForExecution (0, DbExecuteThread, NULL);
}