mirror of
https://github.com/acpica/acpica/
synced 2025-01-15 05:49:18 +03:00
Debugger: Add missing method args for Execute/Debug command.
Always setup all arguments required by the method, even if the command line specifies no arguments, or insufficient arguments. Use "default" values for the missing arguments. Also fixes a bug where only 6 method arguments were supported by these commands instead of the maximum 7 arguments.
This commit is contained in:
parent
16c9bbd6a3
commit
b7ee21f688
@ -211,25 +211,31 @@ AcpiDbExecuteMethod (
|
||||
{
|
||||
/* Are there arguments to the method? */
|
||||
|
||||
i = 0;
|
||||
if (Info->Args && Info->Args[0])
|
||||
{
|
||||
for (i = 0; Info->Args[i] &&
|
||||
/* Get arguments passed on the command line */
|
||||
|
||||
for (; Info->Args[i] &&
|
||||
(i < ACPI_METHOD_NUM_ARGS) &&
|
||||
(i < ObjInfo->ParamCount);
|
||||
i++)
|
||||
{
|
||||
Params[i].Type = ACPI_TYPE_INTEGER;
|
||||
/* Only integer arguments supported at this time */
|
||||
|
||||
Params[i].Type = ACPI_TYPE_INTEGER;
|
||||
Params[i].Integer.Value = ACPI_STRTOUL (Info->Args[i], NULL, 16);
|
||||
}
|
||||
|
||||
ParamObjects.Pointer = Params;
|
||||
ParamObjects.Count = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup default parameters */
|
||||
|
||||
for (i = 0; i < ObjInfo->ParamCount; i++)
|
||||
/* Create additional "default" parameters as needed */
|
||||
|
||||
if (i < ObjInfo->ParamCount)
|
||||
{
|
||||
AcpiOsPrintf ("Adding %u arguments containing default values\n",
|
||||
ObjInfo->ParamCount - i);
|
||||
|
||||
for (; i < ObjInfo->ParamCount; i++)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
@ -253,10 +259,10 @@ AcpiDbExecuteMethod (
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ParamObjects.Pointer = Params;
|
||||
ParamObjects.Count = ObjInfo->ParamCount;
|
||||
}
|
||||
|
||||
ParamObjects.Count = ObjInfo->ParamCount;
|
||||
ParamObjects.Pointer = Params;
|
||||
}
|
||||
|
||||
ACPI_FREE (ObjInfo);
|
||||
|
@ -272,7 +272,7 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
|
||||
#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 2 /* Max command line arguments */
|
||||
|
||||
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
|
||||
#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
|
||||
|
Loading…
Reference in New Issue
Block a user