dbinput.c (218590) | dbinput.c (222544) |
---|---|
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 | 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 char * 58AcpiDbGetNextToken ( 59 char *String, 60 char **Next); 61 | |
62static UINT32 63AcpiDbGetLine ( 64 char *InputBuffer); 65 66static UINT32 67AcpiDbMatchCommand ( 68 char *UserCommand); 69 --- 210 unchanged lines hidden (view full) --- 280 AcpiOsPrintf (" Type <Object> Display object type\n"); 281 282 AcpiOsPrintf ("\nControl Method Execution Commands:\n"); 283 AcpiOsPrintf (" Arguments (or Args) Display method arguments\n"); 284 AcpiOsPrintf (" Breakpoint <AmlOffset> Set an AML execution breakpoint\n"); 285 AcpiOsPrintf (" Call Run to next control method invocation\n"); 286 AcpiOsPrintf (" Debug <Namepath> [Arguments] Single Step a control method\n"); 287 AcpiOsPrintf (" Execute <Namepath> [Arguments] Execute control method\n"); | 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"); |
|
288 AcpiOsPrintf (" Go Allow method to run to completion\n"); 289 AcpiOsPrintf (" Information Display info about the current method\n"); 290 AcpiOsPrintf (" Into Step into (not over) a method call\n"); 291 AcpiOsPrintf (" List [# of Aml Opcodes] Display method ASL statements\n"); 292 AcpiOsPrintf (" Locals Display method local variables\n"); 293 AcpiOsPrintf (" Results Display method result stack\n"); 294 AcpiOsPrintf (" Set <A|L> <#> <Value> Set method data (Arguments/Locals)\n"); 295 AcpiOsPrintf (" Stop Terminate control method\n"); --- 17 unchanged lines hidden (view full) --- 313 * Next - Return value, end of next token 314 * 315 * RETURN: Pointer to the start of the next token. 316 * 317 * DESCRIPTION: Command line parsing. Get the next token on the command line 318 * 319 ******************************************************************************/ 320 | 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 |
321static char * | 320char * |
322AcpiDbGetNextToken ( 323 char *String, | 321AcpiDbGetNextToken ( 322 char *String, |
324 char **Next) | 323 char **Next, 324 ACPI_OBJECT_TYPE *ReturnType) |
325{ 326 char *Start; | 325{ 326 char *Start; |
327 UINT32 Depth; 328 ACPI_OBJECT_TYPE Type = ACPI_TYPE_INTEGER; |
|
327 328 329 /* At end of buffer? */ 330 331 if (!String || !(*String)) 332 { 333 return (NULL); 334 } 335 | 329 330 331 /* At end of buffer? */ 332 333 if (!String || !(*String)) 334 { 335 return (NULL); 336 } 337 |
336 /* Get rid of any spaces at the beginning */ | 338 /* Remove any spaces at the beginning */ |
337 338 if (*String == ' ') 339 { 340 while (*String && (*String == ' ')) 341 { 342 String++; 343 } 344 345 if (!(*String)) 346 { 347 return (NULL); 348 } 349 } 350 | 339 340 if (*String == ' ') 341 { 342 while (*String && (*String == ' ')) 343 { 344 String++; 345 } 346 347 if (!(*String)) 348 { 349 return (NULL); 350 } 351 } 352 |
351 if (*String == '"') | 353 switch (*String) |
352 { | 354 { |
355 case '"': 356 |
|
353 /* This is a quoted string, scan until closing quote */ 354 355 String++; 356 Start = String; | 357 /* This is a quoted string, scan until closing quote */ 358 359 String++; 360 Start = String; |
361 Type = ACPI_TYPE_STRING; |
|
357 | 362 |
358 /* Find end of token */ | 363 /* Find end of string */ |
359 360 while (*String && (*String != '"')) 361 { 362 String++; 363 } | 364 365 while (*String && (*String != '"')) 366 { 367 String++; 368 } |
364 } 365 else 366 { | 369 break; 370 371 case '(': 372 373 /* This is the start of a buffer, scan until closing paren */ 374 375 String++; |
367 Start = String; | 376 Start = String; |
377 Type = ACPI_TYPE_BUFFER; |
|
368 | 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 |
|
369 /* Find end of token */ 370 371 while (*String && (*String != ' ')) 372 { 373 String++; 374 } | 437 /* Find end of token */ 438 439 while (*String && (*String != ' ')) 440 { 441 String++; 442 } |
443 break; |
|
375 } 376 377 if (!(*String)) 378 { 379 *Next = NULL; 380 } 381 else 382 { 383 *String = 0; 384 *Next = String + 1; 385 } 386 | 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; |
|
387 return (Start); 388} 389 390 391/******************************************************************************* 392 * 393 * FUNCTION: AcpiDbGetLine 394 * --- 16 unchanged lines hidden (view full) --- 411 char *This; 412 413 414 ACPI_STRCPY (AcpiGbl_DbParsedBuf, InputBuffer); 415 416 This = AcpiGbl_DbParsedBuf; 417 for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++) 418 { | 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 { |
419 AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next); | 489 AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next, 490 &AcpiGbl_DbArgTypes[i]); |
420 if (!AcpiGbl_DbArgs[i]) 421 { 422 break; 423 } 424 425 This = Next; 426 } 427 --- 142 unchanged lines hidden (view full) --- 570 Status = AE_OK; 571 break; 572 573 case CMD_CLOSE: 574 AcpiDbCloseDebugFile (); 575 break; 576 577 case CMD_DEBUG: | 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: |
578 AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], EX_SINGLE_STEP); | 649 AcpiDbExecute (AcpiGbl_DbArgs[1], 650 &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_SINGLE_STEP); |
579 break; 580 581 case CMD_DISASSEMBLE: 582 (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]); 583 break; 584 585 case CMD_DUMP: 586 AcpiDbDecodeAndDisplayObject (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); --- 9 unchanged lines hidden (view full) --- 596 break; 597 598 case CMD_EVENT: 599 AcpiOsPrintf ("Event command not implemented\n"); 600 break; 601 602 case CMD_EXECUTE: 603 AcpiDbExecute (AcpiGbl_DbArgs[1], | 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], |
604 &AcpiGbl_DbArgs[2], EX_NO_SINGLE_STEP); | 676 &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_NO_SINGLE_STEP); |
605 break; 606 607 case CMD_FIND: 608 Status = AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]); 609 break; 610 611 case CMD_GO: 612 AcpiGbl_CmSingleStep = FALSE; --- 343 unchanged lines hidden (view full) --- 956 } 957 else 958 { 959 AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT); 960 } 961 962 /* Get the user input line */ 963 | 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 |
964 (void) AcpiOsGetLine (AcpiGbl_DbLineBuf); | 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 } |
965 966 /* Check for single or multithreaded debug */ 967 968 if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED) 969 { 970 /* 971 * Signal the debug thread that we have a command to execute, 972 * and wait for the command to complete. --- 31 unchanged lines hidden --- | 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 --- |