Deleted Added
sdiff udiff text old ( 218590 ) new ( 222544 )
full compact
1/*******************************************************************************
2 *
3 * Module Name: dbinput - user front-end to the AML debugger
4 *
5 ******************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2011, Intel Corp.

--- 40 unchanged lines hidden (view full) ---

49
50#ifdef ACPI_DEBUGGER
51
52#define _COMPONENT ACPI_CA_DEBUGGER
53 ACPI_MODULE_NAME ("dbinput")
54
55/* Local prototypes */
56
57static UINT32
58AcpiDbGetLine (
59 char *InputBuffer);
60
61static UINT32
62AcpiDbMatchCommand (
63 char *UserCommand);
64

--- 210 unchanged lines hidden (view full) ---

275 AcpiOsPrintf (" Type <Object> Display object type\n");
276
277 AcpiOsPrintf ("\nControl Method Execution Commands:\n");
278 AcpiOsPrintf (" Arguments (or Args) Display method arguments\n");
279 AcpiOsPrintf (" Breakpoint <AmlOffset> Set an AML execution breakpoint\n");
280 AcpiOsPrintf (" Call Run to next control method invocation\n");
281 AcpiOsPrintf (" Debug <Namepath> [Arguments] Single Step a control method\n");
282 AcpiOsPrintf (" Execute <Namepath> [Arguments] Execute control method\n");
283 AcpiOsPrintf (" Hex Integer Integer method argument\n");
284 AcpiOsPrintf (" \"Ascii String\" String method argument\n");
285 AcpiOsPrintf (" (Byte List) Buffer method argument\n");
286 AcpiOsPrintf (" [Package Element List] Package method argument\n");
287 AcpiOsPrintf (" Go Allow method to run to completion\n");
288 AcpiOsPrintf (" Information Display info about the current method\n");
289 AcpiOsPrintf (" Into Step into (not over) a method call\n");
290 AcpiOsPrintf (" List [# of Aml Opcodes] Display method ASL statements\n");
291 AcpiOsPrintf (" Locals Display method local variables\n");
292 AcpiOsPrintf (" Results Display method result stack\n");
293 AcpiOsPrintf (" Set <A|L> <#> <Value> Set method data (Arguments/Locals)\n");
294 AcpiOsPrintf (" Stop Terminate control method\n");

--- 17 unchanged lines hidden (view full) ---

312 * Next - Return value, end of next token
313 *
314 * RETURN: Pointer to the start of the next token.
315 *
316 * DESCRIPTION: Command line parsing. Get the next token on the command line
317 *
318 ******************************************************************************/
319
320char *
321AcpiDbGetNextToken (
322 char *String,
323 char **Next,
324 ACPI_OBJECT_TYPE *ReturnType)
325{
326 char *Start;
327 UINT32 Depth;
328 ACPI_OBJECT_TYPE Type = ACPI_TYPE_INTEGER;
329
330
331 /* At end of buffer? */
332
333 if (!String || !(*String))
334 {
335 return (NULL);
336 }
337
338 /* Remove any spaces at the beginning */
339
340 if (*String == ' ')
341 {
342 while (*String && (*String == ' '))
343 {
344 String++;
345 }
346
347 if (!(*String))
348 {
349 return (NULL);
350 }
351 }
352
353 switch (*String)
354 {
355 case '"':
356
357 /* This is a quoted string, scan until closing quote */
358
359 String++;
360 Start = String;
361 Type = ACPI_TYPE_STRING;
362
363 /* Find end of string */
364
365 while (*String && (*String != '"'))
366 {
367 String++;
368 }
369 break;
370
371 case '(':
372
373 /* This is the start of a buffer, scan until closing paren */
374
375 String++;
376 Start = String;
377 Type = ACPI_TYPE_BUFFER;
378
379 /* Find end of buffer */
380
381 while (*String && (*String != ')'))
382 {
383 String++;
384 }
385 break;
386
387 case '[':
388
389 /* This is the start of a package, scan until closing bracket */
390
391 String++;
392 Depth = 1;
393 Start = String;
394 Type = ACPI_TYPE_PACKAGE;
395
396 /* Find end of package (closing bracket) */
397
398 while (*String)
399 {
400 /* Handle String package elements */
401
402 if (*String == '"')
403 {
404 /* Find end of string */
405
406 String++;
407 while (*String && (*String != '"'))
408 {
409 String++;
410 }
411 if (!(*String))
412 {
413 break;
414 }
415 }
416 else if (*String == '[')
417 {
418 Depth++; /* A nested package declaration */
419 }
420 else if (*String == ']')
421 {
422 Depth--;
423 if (Depth == 0) /* Found final package closing bracket */
424 {
425 break;
426 }
427 }
428
429 String++;
430 }
431 break;
432
433 default:
434
435 Start = String;
436
437 /* Find end of token */
438
439 while (*String && (*String != ' '))
440 {
441 String++;
442 }
443 break;
444 }
445
446 if (!(*String))
447 {
448 *Next = NULL;
449 }
450 else
451 {
452 *String = 0;
453 *Next = String + 1;
454 }
455
456 *ReturnType = Type;
457 return (Start);
458}
459
460
461/*******************************************************************************
462 *
463 * FUNCTION: AcpiDbGetLine
464 *

--- 16 unchanged lines hidden (view full) ---

481 char *This;
482
483
484 ACPI_STRCPY (AcpiGbl_DbParsedBuf, InputBuffer);
485
486 This = AcpiGbl_DbParsedBuf;
487 for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
488 {
489 AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next,
490 &AcpiGbl_DbArgTypes[i]);
491 if (!AcpiGbl_DbArgs[i])
492 {
493 break;
494 }
495
496 This = Next;
497 }
498

--- 142 unchanged lines hidden (view full) ---

641 Status = AE_OK;
642 break;
643
644 case CMD_CLOSE:
645 AcpiDbCloseDebugFile ();
646 break;
647
648 case CMD_DEBUG:
649 AcpiDbExecute (AcpiGbl_DbArgs[1],
650 &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_SINGLE_STEP);
651 break;
652
653 case CMD_DISASSEMBLE:
654 (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]);
655 break;
656
657 case CMD_DUMP:
658 AcpiDbDecodeAndDisplayObject (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);

--- 9 unchanged lines hidden (view full) ---

668 break;
669
670 case CMD_EVENT:
671 AcpiOsPrintf ("Event command not implemented\n");
672 break;
673
674 case CMD_EXECUTE:
675 AcpiDbExecute (AcpiGbl_DbArgs[1],
676 &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_NO_SINGLE_STEP);
677 break;
678
679 case CMD_FIND:
680 Status = AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]);
681 break;
682
683 case CMD_GO:
684 AcpiGbl_CmSingleStep = FALSE;

--- 343 unchanged lines hidden (view full) ---

1028 }
1029 else
1030 {
1031 AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT);
1032 }
1033
1034 /* Get the user input line */
1035
1036 Status = AcpiOsGetLine (AcpiGbl_DbLineBuf,
1037 ACPI_DB_LINE_BUFFER_SIZE, NULL);
1038 if (ACPI_FAILURE (Status))
1039 {
1040 ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));
1041 return (Status);
1042 }
1043
1044 /* Check for single or multithreaded debug */
1045
1046 if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED)
1047 {
1048 /*
1049 * Signal the debug thread that we have a command to execute,
1050 * and wait for the command to complete.

--- 31 unchanged lines hidden ---