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:
Robert Moore 2011-05-05 10:24:56 -07:00
parent 16c9bbd6a3
commit b7ee21f688
2 changed files with 19 additions and 13 deletions

View File

@ -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);

View File

@ -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 '%'