📄 dbxface.c
字号:
break; } /* * Under certain debug conditions, display this opcode and its operands */ if ((AcpiGbl_DbOutputToFile) || (AcpiGbl_CmSingleStep) || (AcpiDbgLevel & ACPI_LV_PARSE)) { if ((AcpiGbl_DbOutputToFile) || (AcpiDbgLevel & ACPI_LV_PARSE)) { AcpiOsPrintf ("\n[AmlDebug] Next AML Opcode to execute:\n"); } /* * Display this op (and only this op - zero out the NEXT field * temporarily, and disable parser trace output for the duration of * the display because we don't want the extraneous debug output) */ OriginalDebugLevel = AcpiDbgLevel; AcpiDbgLevel &= ~(ACPI_LV_PARSE | ACPI_LV_FUNCTIONS); Next = Op->Common.Next; Op->Common.Next = NULL; DisplayOp = Op; ParentOp = Op->Common.Parent; if (ParentOp) { if ((WalkState->ControlState) && (WalkState->ControlState->Common.State == ACPI_CONTROL_PREDICATE_EXECUTING)) { /* * We are executing the predicate of an IF or WHILE statement * Search upwards for the containing IF or WHILE so that the * entire predicate can be displayed. */ while (ParentOp) { if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) { DisplayOp = ParentOp; break; } ParentOp = ParentOp->Common.Parent; } } else { while (ParentOp) { if ((ParentOp->Common.AmlOpcode == AML_IF_OP) || (ParentOp->Common.AmlOpcode == AML_ELSE_OP) || (ParentOp->Common.AmlOpcode == AML_SCOPE_OP) || (ParentOp->Common.AmlOpcode == AML_METHOD_OP) || (ParentOp->Common.AmlOpcode == AML_WHILE_OP)) { break; } DisplayOp = ParentOp; ParentOp = ParentOp->Common.Parent; } } } /* Now we can display it */ AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX); if ((Op->Common.AmlOpcode == AML_IF_OP) || (Op->Common.AmlOpcode == AML_WHILE_OP)) { if (WalkState->ControlState->Common.Value) { AcpiOsPrintf ("Predicate = [True], IF block was executed\n"); } else { AcpiOsPrintf ("Predicate = [False], Skipping IF block\n"); } } else if (Op->Common.AmlOpcode == AML_ELSE_OP) { AcpiOsPrintf ("Predicate = [False], ELSE block was executed\n"); } /* Restore everything */ Op->Common.Next = Next; AcpiOsPrintf ("\n"); if ((AcpiGbl_DbOutputToFile) || (AcpiDbgLevel & ACPI_LV_PARSE)) { AcpiOsPrintf ("\n"); } AcpiDbgLevel = OriginalDebugLevel; } /* If we are not single stepping, just continue executing the method */ if (!AcpiGbl_CmSingleStep) { return (AE_OK); } /* * If we are executing a step-to-call command, * Check if this is a method call. */ if (AcpiGbl_StepToNextCall) { if (Op->Common.AmlOpcode != AML_INT_METHODCALL_OP) { /* Not a method call, just keep executing */ return (AE_OK); } /* Found a method call, stop executing */ AcpiGbl_StepToNextCall = FALSE; } /* * If the next opcode is a method call, we will "step over" it * by default. */ if (Op->Common.AmlOpcode == AML_INT_METHODCALL_OP) { /* Force no more single stepping while executing called method */ AcpiGbl_CmSingleStep = FALSE; /* * Set the breakpoint on/before the call, it will stop execution * as soon as we return */ WalkState->MethodBreakpoint = 1; /* Must be non-zero! */ } Status = AcpiDbStartCommand (WalkState, Op); /* User commands complete, continue execution of the interrupted method */ return (Status);}/******************************************************************************* * * FUNCTION: AcpiDbInitialize * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Init and start debugger * ******************************************************************************/ACPI_STATUSAcpiDbInitialize ( void){ ACPI_STATUS Status; /* Init globals */ AcpiGbl_DbBuffer = NULL; AcpiGbl_DbFilename = NULL; AcpiGbl_DbOutputToFile = FALSE; AcpiGbl_DbDebugLevel = ACPI_LV_VERBOSITY2; AcpiGbl_DbConsoleDebugLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES; AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT; AcpiGbl_DbOpt_tables = FALSE; AcpiGbl_DbOpt_disasm = FALSE; AcpiGbl_DbOpt_stats = FALSE; AcpiGbl_DbOpt_verbose = TRUE; AcpiGbl_DbOpt_ini_methods = TRUE; AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE); if (!AcpiGbl_DbBuffer) { return (AE_NO_MEMORY); } ACPI_MEMSET (AcpiGbl_DbBuffer, 0, ACPI_DEBUG_BUFFER_SIZE); /* Initial scope is the root */ AcpiGbl_DbScopeBuf [0] = '\\'; AcpiGbl_DbScopeBuf [1] = 0; AcpiGbl_DbScopeNode = AcpiGbl_RootNode; /* * 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 (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED) { /* These were created with one unit, grab it */ Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get debugger mutex\n"); return (Status); } Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get debugger mutex\n"); return (Status); } /* Create the debug execution thread to execute commands */ Status = AcpiOsExecute (OSL_DEBUGGER_THREAD, AcpiDbExecuteThread, NULL); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not start debugger thread\n"); return (Status); } } if (!AcpiGbl_DbOpt_verbose) { AcpiGbl_DbOpt_disasm = TRUE; AcpiGbl_DbOpt_stats = FALSE; } return (AE_OK);}/******************************************************************************* * * FUNCTION: AcpiDbTerminate * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Stop debugger * ******************************************************************************/voidAcpiDbTerminate ( void){ if (AcpiGbl_DbTablePtr) { AcpiOsFree (AcpiGbl_DbTablePtr); } if (AcpiGbl_DbBuffer) { AcpiOsFree (AcpiGbl_DbBuffer); }}#ifdef ACPI_OBSOLETE_FUNCTIONS/******************************************************************************* * * FUNCTION: AcpiDbMethodEnd * * PARAMETERS: WalkState - Current walk * * RETURN: Status * * DESCRIPTION: Called at method termination * ******************************************************************************/voidAcpiDbMethodEnd ( ACPI_WALK_STATE *WalkState){ if (!AcpiGbl_CmSingleStep) { return; } AcpiOsPrintf ("<Method Terminating>\n"); AcpiDbStartCommand (WalkState, NULL);}#endif#endif /* ACPI_DEBUGGER */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -