dbinput.c (92388) | dbinput.c (99679) |
---|---|
1/******************************************************************************* 2 * 3 * Module Name: dbinput - user front-end to the AML debugger | 1/******************************************************************************* 2 * 3 * Module Name: dbinput - user front-end to the AML debugger |
4 * $Revision: 81 $ | 4 * $Revision: 86 $ |
5 * 6 ******************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. --- 98 unchanged lines hidden (view full) --- 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117 118#include "acpi.h" | 5 * 6 ******************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. --- 98 unchanged lines hidden (view full) --- 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117 118#include "acpi.h" |
119#include "acparser.h" 120#include "actables.h" 121#include "acnamesp.h" 122#include "acinterp.h" | |
123#include "acdebug.h" 124 125 126#ifdef ENABLE_DEBUGGER 127 128#define _COMPONENT ACPI_DEBUGGER 129 ACPI_MODULE_NAME ("dbinput") 130 --- 22 unchanged lines hidden (view full) --- 153 CMD_FIND, 154 CMD_GO, 155 CMD_HELP, 156 CMD_HELP2, 157 CMD_HISTORY, 158 CMD_HISTORY_EXE, 159 CMD_HISTORY_LAST, 160 CMD_INFORMATION, | 119#include "acdebug.h" 120 121 122#ifdef ENABLE_DEBUGGER 123 124#define _COMPONENT ACPI_DEBUGGER 125 ACPI_MODULE_NAME ("dbinput") 126 --- 22 unchanged lines hidden (view full) --- 149 CMD_FIND, 150 CMD_GO, 151 CMD_HELP, 152 CMD_HELP2, 153 CMD_HISTORY, 154 CMD_HISTORY_EXE, 155 CMD_HISTORY_LAST, 156 CMD_INFORMATION, |
157 CMD_INTEGRITY, |
|
161 CMD_INTO, 162 CMD_LEVEL, 163 CMD_LIST, 164 CMD_LOAD, 165 CMD_LOCALS, 166 CMD_LOCKS, 167 CMD_METHODS, 168 CMD_NAMESPACE, --- 14 unchanged lines hidden (view full) --- 183 CMD_THREADS, 184 CMD_TREE, 185 CMD_UNLOAD 186}; 187 188#define CMD_FIRST_VALID 2 189 190 | 158 CMD_INTO, 159 CMD_LEVEL, 160 CMD_LIST, 161 CMD_LOAD, 162 CMD_LOCALS, 163 CMD_LOCKS, 164 CMD_METHODS, 165 CMD_NAMESPACE, --- 14 unchanged lines hidden (view full) --- 180 CMD_THREADS, 181 CMD_TREE, 182 CMD_UNLOAD 183}; 184 185#define CMD_FIRST_VALID 2 186 187 |
191const COMMAND_INFO AcpiGbl_DbCommands[] = | 188static const COMMAND_INFO AcpiGbl_DbCommands[] = |
192{ 193 {"<NOT FOUND>", 0}, 194 {"<NULL>", 0}, 195 {"ALLOCATIONS", 0}, 196 {"ARGS", 0}, 197 {"ARGUMENTS", 0}, 198 {"BREAKPOINT", 1}, 199 {"CALL", 0}, --- 7 unchanged lines hidden (view full) --- 207 {"FIND", 1}, 208 {"GO", 0}, 209 {"HELP", 0}, 210 {"?", 0}, 211 {"HISTORY", 0}, 212 {"!", 1}, 213 {"!!", 0}, 214 {"INFORMATION", 0}, | 189{ 190 {"<NOT FOUND>", 0}, 191 {"<NULL>", 0}, 192 {"ALLOCATIONS", 0}, 193 {"ARGS", 0}, 194 {"ARGUMENTS", 0}, 195 {"BREAKPOINT", 1}, 196 {"CALL", 0}, --- 7 unchanged lines hidden (view full) --- 204 {"FIND", 1}, 205 {"GO", 0}, 206 {"HELP", 0}, 207 {"?", 0}, 208 {"HISTORY", 0}, 209 {"!", 1}, 210 {"!!", 0}, 211 {"INFORMATION", 0}, |
212 {"INTEGRITY", 0}, |
|
215 {"INTO", 0}, 216 {"LEVEL", 0}, 217 {"LIST", 0}, 218 {"LOAD", 1}, 219 {"LOCALS", 0}, 220 {"LOCKS", 0}, 221 {"METHODS", 0}, 222 {"NAMESPACE", 0}, --- 115 unchanged lines hidden (view full) --- 338 case 'F': 339 AcpiOsPrintf ("\nFile I/O Commands\n\n"); 340 AcpiOsPrintf ("Close Close debug output file\n"); 341 AcpiOsPrintf ("Open <Output Filename> Open a file for debug output\n"); 342 AcpiOsPrintf ("Load <Input Filename> Load ACPI table from a file\n"); 343 return; 344 345 default: | 213 {"INTO", 0}, 214 {"LEVEL", 0}, 215 {"LIST", 0}, 216 {"LOAD", 1}, 217 {"LOCALS", 0}, 218 {"LOCKS", 0}, 219 {"METHODS", 0}, 220 {"NAMESPACE", 0}, --- 115 unchanged lines hidden (view full) --- 336 case 'F': 337 AcpiOsPrintf ("\nFile I/O Commands\n\n"); 338 AcpiOsPrintf ("Close Close debug output file\n"); 339 AcpiOsPrintf ("Open <Output Filename> Open a file for debug output\n"); 340 AcpiOsPrintf ("Load <Input Filename> Load ACPI table from a file\n"); 341 return; 342 343 default: |
346 AcpiOsPrintf ("Unrecognized Command Class: %x\n", HelpType); | 344 AcpiOsPrintf ("Unrecognized Command Class: %X\n", HelpType); |
347 return; 348 } 349} 350 351 352/******************************************************************************* 353 * 354 * FUNCTION: AcpiDbGetNextToken --- 258 unchanged lines hidden (view full) --- 613 AcpiOsPrintf ("Event command not implemented\n"); 614 break; 615 616 case CMD_EXECUTE: 617 AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], EX_NO_SINGLE_STEP); 618 break; 619 620 case CMD_FIND: | 345 return; 346 } 347} 348 349 350/******************************************************************************* 351 * 352 * FUNCTION: AcpiDbGetNextToken --- 258 unchanged lines hidden (view full) --- 611 AcpiOsPrintf ("Event command not implemented\n"); 612 break; 613 614 case CMD_EXECUTE: 615 AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], EX_NO_SINGLE_STEP); 616 break; 617 618 case CMD_FIND: |
621 AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]); | 619 Status = AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]); |
622 break; 623 624 case CMD_GO: 625 AcpiGbl_CmSingleStep = FALSE; 626 return (AE_OK); 627 628 case CMD_HELP: 629 case CMD_HELP2: --- 31 unchanged lines hidden (view full) --- 661 Status = AE_CTRL_TRUE; 662 } 663 return (Status); 664 665 case CMD_INFORMATION: 666 AcpiDbDisplayMethodInfo (Op); 667 break; 668 | 620 break; 621 622 case CMD_GO: 623 AcpiGbl_CmSingleStep = FALSE; 624 return (AE_OK); 625 626 case CMD_HELP: 627 case CMD_HELP2: --- 31 unchanged lines hidden (view full) --- 659 Status = AE_CTRL_TRUE; 660 } 661 return (Status); 662 663 case CMD_INFORMATION: 664 AcpiDbDisplayMethodInfo (Op); 665 break; 666 |
667 case CMD_INTEGRITY: 668 AcpiDbCheckIntegrity (); 669 break; 670 |
|
669 case CMD_INTO: 670 if (Op) 671 { 672 AcpiGbl_CmSingleStep = TRUE; 673 return (AE_OK); 674 } 675 break; 676 --- 33 unchanged lines hidden (view full) --- 710 AcpiDbDisplayLocks (); 711 break; 712 713 case CMD_LOCALS: 714 AcpiDbDisplayLocals (); 715 break; 716 717 case CMD_METHODS: | 671 case CMD_INTO: 672 if (Op) 673 { 674 AcpiGbl_CmSingleStep = TRUE; 675 return (AE_OK); 676 } 677 break; 678 --- 33 unchanged lines hidden (view full) --- 712 AcpiDbDisplayLocks (); 713 break; 714 715 case CMD_LOCALS: 716 AcpiDbDisplayLocals (); 717 break; 718 719 case CMD_METHODS: |
718 AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]); | 720 Status = AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]); |
719 break; 720 721 case CMD_NAMESPACE: 722 AcpiDbDumpNamespace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); 723 break; 724 725 case CMD_NOTIFY: 726 Temp = ACPI_STRTOUL (AcpiGbl_DbArgs[2], NULL, 0); 727 AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp); 728 break; 729 730 case CMD_OBJECT: | 721 break; 722 723 case CMD_NAMESPACE: 724 AcpiDbDumpNamespace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); 725 break; 726 727 case CMD_NOTIFY: 728 Temp = ACPI_STRTOUL (AcpiGbl_DbArgs[2], NULL, 0); 729 AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp); 730 break; 731 732 case CMD_OBJECT: |
731 AcpiDbDisplayObjects (ACPI_STRUPR (AcpiGbl_DbArgs[1]), AcpiGbl_DbArgs[2]); | 733 ACPI_STRUPR (AcpiGbl_DbArgs[1]); 734 Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); |
732 break; 733 734 case CMD_OPEN: 735 AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]); 736 break; 737 738 case CMD_OWNER: 739 AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); --- 15 unchanged lines hidden (view full) --- 755 AcpiDbDisplayResults (); 756 break; 757 758 case CMD_SET: 759 AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]); 760 break; 761 762 case CMD_STATS: | 735 break; 736 737 case CMD_OPEN: 738 AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]); 739 break; 740 741 case CMD_OWNER: 742 AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); --- 15 unchanged lines hidden (view full) --- 758 AcpiDbDisplayResults (); 759 break; 760 761 case CMD_SET: 762 AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]); 763 break; 764 765 case CMD_STATS: |
763 AcpiDbDisplayStatistics (AcpiGbl_DbArgs[1]); | 766 Status = AcpiDbDisplayStatistics (AcpiGbl_DbArgs[1]); |
764 break; 765 766 case CMD_STOP: | 767 break; 768 769 case CMD_STOP: |
767 return (AE_AML_ERROR); | 770 return (AE_NOT_IMPLEMENTED); |
768 769 case CMD_TABLES: 770 AcpiDbDisplayTableInfo (AcpiGbl_DbArgs[1]); 771 break; 772 773 case CMD_TERMINATE: 774 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); 775 AcpiUtSubsystemShutdown (); --- 33 unchanged lines hidden (view full) --- 809 /* AcpiUtSubsystemShutdown (); */ 810 AcpiDbCloseDebugFile (); 811 812 AcpiGbl_DbTerminateThreads = TRUE; 813 814 return (AE_CTRL_TERMINATE); 815 816 case CMD_NOT_FOUND: | 771 772 case CMD_TABLES: 773 AcpiDbDisplayTableInfo (AcpiGbl_DbArgs[1]); 774 break; 775 776 case CMD_TERMINATE: 777 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); 778 AcpiUtSubsystemShutdown (); --- 33 unchanged lines hidden (view full) --- 812 /* AcpiUtSubsystemShutdown (); */ 813 AcpiDbCloseDebugFile (); 814 815 AcpiGbl_DbTerminateThreads = TRUE; 816 817 return (AE_CTRL_TERMINATE); 818 819 case CMD_NOT_FOUND: |
820 default: |
|
817 AcpiOsPrintf ("Unknown Command\n"); 818 return (AE_CTRL_TRUE); 819 } 820 821 822 /* Add all commands that come here to the history buffer */ 823 824 AcpiDbAddToHistory (InputBuffer); --- 56 unchanged lines hidden (view full) --- 881 * simply dispatches it. 882 * 883 ******************************************************************************/ 884 885void 886AcpiDbSingleThread ( 887 void) 888{ | 821 AcpiOsPrintf ("Unknown Command\n"); 822 return (AE_CTRL_TRUE); 823 } 824 825 826 /* Add all commands that come here to the history buffer */ 827 828 AcpiDbAddToHistory (InputBuffer); --- 56 unchanged lines hidden (view full) --- 885 * simply dispatches it. 886 * 887 ******************************************************************************/ 888 889void 890AcpiDbSingleThread ( 891 void) 892{ |
889 ACPI_STATUS Status; | |
890 | 893 |
891 | |
892 AcpiGbl_MethodExecuting = FALSE; 893 AcpiGbl_StepToNextCall = FALSE; 894 | 894 AcpiGbl_MethodExecuting = FALSE; 895 AcpiGbl_StepToNextCall = FALSE; 896 |
895 Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); | 897 (void) AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); |
896} 897 898 899/******************************************************************************* 900 * 901 * FUNCTION: AcpiDbUserCommands 902 * 903 * PARAMETERS: Prompt - User prompt (depends on mode) --- 30 unchanged lines hidden (view full) --- 934 } 935 else 936 { 937 AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT); 938 } 939 940 /* Get the user input line */ 941 | 898} 899 900 901/******************************************************************************* 902 * 903 * FUNCTION: AcpiDbUserCommands 904 * 905 * PARAMETERS: Prompt - User prompt (depends on mode) --- 30 unchanged lines hidden (view full) --- 936 } 937 else 938 { 939 AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT); 940 } 941 942 /* Get the user input line */ 943 |
942 AcpiOsGetLine (AcpiGbl_DbLineBuf); | 944 (void) AcpiOsGetLine (AcpiGbl_DbLineBuf); |
943 | 945 |
944 | |
945 /* Check for single or multithreaded debug */ 946 947 if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED) 948 { 949 /* 950 * Signal the debug thread that we have a command to execute, 951 * and wait for the command to complete. 952 */ --- 16 unchanged lines hidden (view full) --- 969 AcpiDbSingleThread (); 970 } 971 } 972 973 /* 974 * Only this thread (the original thread) should actually terminate the subsystem, 975 * because all the semaphores are deleted during termination 976 */ | 946 /* Check for single or multithreaded debug */ 947 948 if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED) 949 { 950 /* 951 * Signal the debug thread that we have a command to execute, 952 * and wait for the command to complete. 953 */ --- 16 unchanged lines hidden (view full) --- 970 AcpiDbSingleThread (); 971 } 972 } 973 974 /* 975 * Only this thread (the original thread) should actually terminate the subsystem, 976 * because all the semaphores are deleted during termination 977 */ |
977 AcpiTerminate (); | 978 Status = AcpiTerminate (); |
978 return (Status); 979} 980 981 982#endif /* ENABLE_DEBUGGER */ 983 | 979 return (Status); 980} 981 982 983#endif /* ENABLE_DEBUGGER */ 984 |