dbmethod.c (284583) | dbmethod.c (285797) |
---|---|
1/******************************************************************************* 2 * 3 * Module Name: dbmethod - Debug commands for control methods 4 * 5 ******************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2015, Intel Corp. --- 32 unchanged lines hidden (view full) --- 41 * POSSIBILITY OF SUCH DAMAGES. 42 */ 43 44#include <contrib/dev/acpica/include/acpi.h> 45#include <contrib/dev/acpica/include/accommon.h> 46#include <contrib/dev/acpica/include/acdispat.h> 47#include <contrib/dev/acpica/include/acnamesp.h> 48#include <contrib/dev/acpica/include/acdebug.h> | 1/******************************************************************************* 2 * 3 * Module Name: dbmethod - Debug commands for control methods 4 * 5 ******************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2015, Intel Corp. --- 32 unchanged lines hidden (view full) --- 41 * POSSIBILITY OF SUCH DAMAGES. 42 */ 43 44#include <contrib/dev/acpica/include/acpi.h> 45#include <contrib/dev/acpica/include/accommon.h> 46#include <contrib/dev/acpica/include/acdispat.h> 47#include <contrib/dev/acpica/include/acnamesp.h> 48#include <contrib/dev/acpica/include/acdebug.h> |
49#ifdef ACPI_DISASSEMBLER |
|
49#include <contrib/dev/acpica/include/acdisasm.h> | 50#include <contrib/dev/acpica/include/acdisasm.h> |
51#endif |
|
50#include <contrib/dev/acpica/include/acparser.h> 51#include <contrib/dev/acpica/include/acpredef.h> 52 53 54#ifdef ACPI_DEBUGGER 55 56#define _COMPONENT ACPI_CA_DEBUGGER 57 ACPI_MODULE_NAME ("dbmethod") --- 16 unchanged lines hidden (view full) --- 74 75void 76AcpiDbSetMethodBreakpoint ( 77 char *Location, 78 ACPI_WALK_STATE *WalkState, 79 ACPI_PARSE_OBJECT *Op) 80{ 81 UINT32 Address; | 52#include <contrib/dev/acpica/include/acparser.h> 53#include <contrib/dev/acpica/include/acpredef.h> 54 55 56#ifdef ACPI_DEBUGGER 57 58#define _COMPONENT ACPI_CA_DEBUGGER 59 ACPI_MODULE_NAME ("dbmethod") --- 16 unchanged lines hidden (view full) --- 76 77void 78AcpiDbSetMethodBreakpoint ( 79 char *Location, 80 ACPI_WALK_STATE *WalkState, 81 ACPI_PARSE_OBJECT *Op) 82{ 83 UINT32 Address; |
84 UINT32 AmlOffset; |
|
82 83 84 if (!Op) 85 { 86 AcpiOsPrintf ("There is no method currently executing\n"); 87 return; 88 } 89 90 /* Get and verify the breakpoint address */ 91 92 Address = strtoul (Location, NULL, 16); | 85 86 87 if (!Op) 88 { 89 AcpiOsPrintf ("There is no method currently executing\n"); 90 return; 91 } 92 93 /* Get and verify the breakpoint address */ 94 95 Address = strtoul (Location, NULL, 16); |
93 if (Address <= Op->Common.AmlOffset) | 96 AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml, 97 WalkState->ParserState.AmlStart); 98 if (Address <= AmlOffset) |
94 { 95 AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n", | 99 { 100 AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n", |
96 Address, Op->Common.AmlOffset); | 101 Address, AmlOffset); |
97 } 98 99 /* Save breakpoint in current walk */ 100 101 WalkState->UserBreakpoint = Address; 102 AcpiOsPrintf ("Breakpoint set at AML offset %X\n", Address); 103} 104 --- 128 unchanged lines hidden (view full) --- 233 if (ACPI_FAILURE (Status)) 234 { 235 goto Cleanup; 236 } 237 238 ObjDesc = WalkState->Arguments[Index].Object; 239 240 AcpiOsPrintf ("Arg%u: ", Index); | 102 } 103 104 /* Save breakpoint in current walk */ 105 106 WalkState->UserBreakpoint = Address; 107 AcpiOsPrintf ("Breakpoint set at AML offset %X\n", Address); 108} 109 --- 128 unchanged lines hidden (view full) --- 238 if (ACPI_FAILURE (Status)) 239 { 240 goto Cleanup; 241 } 242 243 ObjDesc = WalkState->Arguments[Index].Object; 244 245 AcpiOsPrintf ("Arg%u: ", Index); |
241 AcpiDmDisplayInternalObject (ObjDesc, WalkState); | 246 AcpiDbDisplayInternalObject (ObjDesc, WalkState); |
242 break; 243 244 case 'L': 245 246 /* Set a method local */ 247 248 if (Index > ACPI_METHOD_MAX_LOCAL) 249 { --- 6 unchanged lines hidden (view full) --- 256 if (ACPI_FAILURE (Status)) 257 { 258 goto Cleanup; 259 } 260 261 ObjDesc = WalkState->LocalVariables[Index].Object; 262 263 AcpiOsPrintf ("Local%u: ", Index); | 247 break; 248 249 case 'L': 250 251 /* Set a method local */ 252 253 if (Index > ACPI_METHOD_MAX_LOCAL) 254 { --- 6 unchanged lines hidden (view full) --- 261 if (ACPI_FAILURE (Status)) 262 { 263 goto Cleanup; 264 } 265 266 ObjDesc = WalkState->LocalVariables[Index].Object; 267 268 AcpiOsPrintf ("Local%u: ", Index); |
264 AcpiDmDisplayInternalObject (ObjDesc, WalkState); | 269 AcpiDbDisplayInternalObject (ObjDesc, WalkState); |
265 break; 266 267 default: 268 269 break; 270 } 271 272Cleanup: --- 74 unchanged lines hidden (view full) --- 347 { 348 ACPI_ERROR ((AE_INFO, "%s (%s): Object must be a control method", 349 Name, AcpiUtGetTypeName (Method->Type))); 350 return (AE_BAD_PARAMETER); 351 } 352 353 ObjDesc = Method->Object; 354 | 270 break; 271 272 default: 273 274 break; 275 } 276 277Cleanup: --- 74 unchanged lines hidden (view full) --- 352 { 353 ACPI_ERROR ((AE_INFO, "%s (%s): Object must be a control method", 354 Name, AcpiUtGetTypeName (Method->Type))); 355 return (AE_BAD_PARAMETER); 356 } 357 358 ObjDesc = Method->Object; 359 |
355 Op = AcpiPsCreateScopeOp (); | 360 Op = AcpiPsCreateScopeOp (ObjDesc->Method.AmlStart); |
356 if (!Op) 357 { 358 return (AE_NO_MEMORY); 359 } 360 361 /* Create and initialize a new walk state */ 362 363 WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL); --- 23 unchanged lines hidden (view full) --- 387 } 388 389 /* Parse the entire method AML including deferred operators */ 390 391 WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE; 392 WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; 393 394 Status = AcpiPsParseAml (WalkState); | 361 if (!Op) 362 { 363 return (AE_NO_MEMORY); 364 } 365 366 /* Create and initialize a new walk state */ 367 368 WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL); --- 23 unchanged lines hidden (view full) --- 392 } 393 394 /* Parse the entire method AML including deferred operators */ 395 396 WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE; 397 WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; 398 399 Status = AcpiPsParseAml (WalkState); |
400 401#ifdef ACPI_DISASSEMBER |
|
395 (void) AcpiDmParseDeferredOps (Op); 396 397 /* Now we can disassemble the method */ 398 399 AcpiGbl_DbOpt_Verbose = FALSE; | 402 (void) AcpiDmParseDeferredOps (Op); 403 404 /* Now we can disassemble the method */ 405 406 AcpiGbl_DbOpt_Verbose = FALSE; |
400#ifdef ACPI_DISASSEMBLER | |
401 AcpiDmDisassemble (NULL, Op, 0); | 407 AcpiDmDisassemble (NULL, Op, 0); |
402#endif | |
403 AcpiGbl_DbOpt_Verbose = TRUE; | 408 AcpiGbl_DbOpt_Verbose = TRUE; |
409#endif |
|
404 405 AcpiPsDeleteParseTree (Op); 406 407 /* Method cleanup */ 408 409 AcpiNsDeleteNamespaceSubtree (Method); 410 AcpiNsDeleteNamespaceByOwner (ObjDesc->Method.OwnerId); 411 AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId); 412 return (AE_OK); 413} 414 415#endif /* ACPI_DEBUGGER */ | 410 411 AcpiPsDeleteParseTree (Op); 412 413 /* Method cleanup */ 414 415 AcpiNsDeleteNamespaceSubtree (Method); 416 AcpiNsDeleteNamespaceByOwner (ObjDesc->Method.OwnerId); 417 AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId); 418 return (AE_OK); 419} 420 421#endif /* ACPI_DEBUGGER */ |