123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- /*++
- Copyright (c) 2012 Minoca Corp. All Rights Reserved
- Module Name:
- kexts.c
- Abstract:
- This module implements kernel debugger extensions.
- Author:
- Evan Green 10-Sep-2012
- Environment:
- Debug Client
- --*/
- //
- // ------------------------------------------------------------------- Includes
- //
- #include <minoca/lib/types.h>
- #include <minoca/lib/status.h>
- #include <minoca/lib/rtl.h>
- #include <minoca/debug/dbgext.h>
- #include "memory.h"
- #include "objects.h"
- #include "threads.h"
- #include "acpiext.h"
- #include "reslist.h"
- #include <assert.h>
- #include <errno.h>
- #include <stdio.h>
- //
- // ---------------------------------------------------------------- Definitions
- //
- //
- // ------------------------------------------------------ Data Type Definitions
- //
- //
- // ----------------------------------------------- Internal Function Prototypes
- //
- //
- // -------------------------------------------------------------------- Globals
- //
- //
- // ------------------------------------------------------------------ Functions
- //
- INT
- ExtensionMain (
- PDEBUGGER_CONTEXT Context,
- ULONG ExtensionApiVersion,
- PVOID Token
- )
- /*++
- Routine Description:
- This routine defines the extension's main routine. This routine will get
- called when the extension is loaded. It is responsible for registering the
- debugger extensions it supports.
- Arguments:
- Context - Supplies the application instance context. This must be passed
- into the registration routines.
- ExtensionApiVersion - Supplies the revision of the debugger extension API.
- Token - Supplies a token that uniquely idenfies the extension. This is used
- when registering extensions.
- Return Value:
- 0 on success.
- Returns an error code on failure. The extension will be unloaded if it
- returns non-zero.
- --*/
- {
- PSTR Extension;
- PSTR OneLineDescription;
- INT Status;
- INT TotalStatus;
- TotalStatus = 0;
- Extension = "mdl";
- OneLineDescription = "Print the contents of a Memory Descriptor List.";
- Status = DbgRegisterExtension(Context,
- Token,
- Extension,
- OneLineDescription,
- ExtMdl);
- if (Status != 0) {
- DbgOut("Error: Unable to register %s.\n", Extension);
- TotalStatus = Status;
- }
- Extension = "object";
- OneLineDescription = "Print the contents of a kernel Object.";
- Status = DbgRegisterExtension(Context,
- Token,
- Extension,
- OneLineDescription,
- ExtObject);
- if (Status != 0) {
- DbgOut("Error: Unable to register %s.\n", Extension);
- TotalStatus = Status;
- }
- Extension = "thread";
- OneLineDescription = "Prints the contents of a thread object.";
- Status = DbgRegisterExtension(Context,
- Token,
- Extension,
- OneLineDescription,
- ExtThread);
- if (Status != 0) {
- DbgOut("Error: Unable to register %s.\n", Extension);
- TotalStatus = Status;
- }
- Extension = "acpi";
- OneLineDescription = "Provides help debugging ACPI issues.";
- Status = DbgRegisterExtension(Context,
- Token,
- Extension,
- OneLineDescription,
- ExtAcpi);
- if (Status != 0) {
- DbgOut("Error: Unable to register %s.\n", Extension);
- TotalStatus = Status;
- }
- Extension = "res";
- OneLineDescription = "Prints resource allocations, requirements, and "
- "lists.";
- Status = DbgRegisterExtension(Context,
- Token,
- Extension,
- OneLineDescription,
- ExtResource);
- if (Status != 0) {
- DbgOut("Error: Unable to register %s.\n", Extension);
- TotalStatus = Status;
- }
- return TotalStatus;
- }
- //
- // --------------------------------------------------------- Internal Functions
- //
|