ReactOS  0.4.14-dev-390-g34947ad
kdb_symbols.cmake.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * FILE: ntoskrnl/kdbg/kdb_symbols.cmake.c
5  * PURPOSE: Getting symbol information...
6  *
7  * PROGRAMMERS: David Welch (welch@cwcom.net)
8  * Colin Finck (colin@reactos.org)
9  */
10 
11 /* INCLUDES *****************************************************************/
12 
13 #include <ntoskrnl.h>
14 
15 #define NDEBUG
16 #include <cache/section/newmm.h>
17 #include <debug.h>
18 
19 /* GLOBALS ******************************************************************/
20 
21 typedef struct _IMAGE_SYMBOL_INFO_CACHE
22 {
27 }
29 
30 typedef struct _ROSSYM_KM_OWN_CONTEXT {
34 
38 //static PROSSYM_INFO KdbpRosSymInfo;
39 //static ULONG_PTR KdbpImageBase;
41 
42 /* FUNCTIONS ****************************************************************/
43 
44 static BOOLEAN
46 {
48  Context->FileOffset.QuadPart = Target;
49  return TRUE;
50 }
51 
52 static BOOLEAN
54 {
58  (Context->FileObject,
59  &Context->FileOffset,
60  Buffer,
61  Length,
62  FALSE,
63  &Iosb);
64  return NT_SUCCESS(Status);
65 }
66 
69 {
71  if (!Context) return NULL;
73  Context->FileOffset.QuadPart = 0;
74  Context->FileObject = FileObject;
75  return Context;
76 }
77 
78 static VOID
80 {
81  ObDereferenceObject(Context->FileObject);
83 }
84 
85 static BOOLEAN
87  IN PLIST_ENTRY current_entry,
88  IN PLIST_ENTRY end_entry,
89  IN PLONG Count,
91  IN LPCWSTR Name,
92  IN INT Index,
93  OUT PLDR_DATA_TABLE_ENTRY* pLdrEntry)
94 {
95  while (current_entry && current_entry != end_entry)
96  {
97  *pLdrEntry = CONTAINING_RECORD(current_entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
98 
99  if ((Address && Address >= (PVOID)(*pLdrEntry)->DllBase && Address < (PVOID)((ULONG_PTR)(*pLdrEntry)->DllBase + (*pLdrEntry)->SizeOfImage)) ||
100  (Name && !_wcsnicmp((*pLdrEntry)->BaseDllName.Buffer, Name, (*pLdrEntry)->BaseDllName.Length / sizeof(WCHAR))) ||
101  (Index >= 0 && (*Count)++ == Index))
102  {
103  return TRUE;
104  }
105 
106  current_entry = current_entry->Flink;
107  }
108 
109  return FALSE;
110 }
111 
124 BOOLEAN
129  OUT PLDR_DATA_TABLE_ENTRY* pLdrEntry)
130 {
131  LONG Count = 0;
133 
134  /* First try to look up the module in the kernel module list. */
137  &Count,
138  Address,
139  Name,
140  Index,
141  pLdrEntry))
142  {
143  return TRUE;
144  }
145 
146  /* That didn't succeed. Try the module list of the current process now. */
148 
149  if(!CurrentProcess || !CurrentProcess->Peb || !CurrentProcess->Peb->Ldr)
150  return FALSE;
151 
152  return KdbpSymSearchModuleList(CurrentProcess->Peb->Ldr->InLoadOrderModuleList.Flink,
153  &CurrentProcess->Peb->Ldr->InLoadOrderModuleList,
154  &Count,
155  Address,
156  Name,
157  Index,
158  pLdrEntry);
159 }
160 
172 BOOLEAN
174  IN PVOID Address,
176 {
177  int i;
180  PLDR_DATA_TABLE_ENTRY LdrEntry;
181 #if 0
183 #endif
184  ULONG_PTR RelativeAddress;
186  ROSSYM_LINEINFO LineInfo = {0};
187 
188  struct {
189  enum _ROSSYM_REGNAME regname;
190  size_t ctx_offset;
191  } regmap[] = {
199  { ROSSYM_X86_ESP, FIELD_OFFSET(KTRAP_FRAME, HardwareEsp) }
200  };
201 
202  if (Context)
203  {
204 #if 0
205  // Disable arguments for now
206  DPRINT("Has Context %x (EBP %x)\n", Context, Context->Ebp);
208 #endif
209 
210  for (i = 0; i < sizeof(regmap) / sizeof(regmap[0]); i++) {
211  memcpy
212  (&LineInfo.Registers.Registers[regmap[i].regname],
213  ((PCHAR)Context)+regmap[i].ctx_offset,
214  sizeof(ULONG_PTR));
215  DPRINT("DWARF REG[%d] -> %x\n", regmap[i].regname, LineInfo.Registers.Registers[regmap[i].regname]);
216  }
217  }
218 
219  if (!KdbpSymbolsInitialized || !KdbpSymFindModule(Address, NULL, -1, &LdrEntry))
220  return FALSE;
221 
222  RelativeAddress = (ULONG_PTR)Address - (ULONG_PTR)LdrEntry->DllBase;
224  (LdrEntry->PatchInformation,
225  RelativeAddress,
226  &LineInfo);
227 
228  if (NT_SUCCESS(Status))
229  {
230  DbgPrint("<%wZ:%x (%s:%d (%s))>",
231  &LdrEntry->BaseDllName, RelativeAddress, LineInfo.FileName, LineInfo.LineNumber, LineInfo.FunctionName);
232  if (Context && LineInfo.NumParams)
233  {
234  int i;
235  char *comma = "";
236  DbgPrint("(");
237  for (i = 0; i < LineInfo.NumParams; i++) {
238  DbgPrint
239  ("%s%s=%llx",
240  comma,
241  LineInfo.Parameters[i].ValueName,
242  LineInfo.Parameters[i].Value);
243  comma = ",";
244  }
245  DbgPrint(")");
246  }
247 
248  return TRUE;
249  }
250  else if (Address < MmSystemRangeStart)
251  {
254  {
255  goto end;
256  }
257 
259  if (!(SectionObject->AllocationAttributes & SEC_IMAGE)) goto end;
260 #if 0
261  if (MemoryArea->StartingAddress != (PVOID)KdbpImageBase)
262  {
263  if (KdbpRosSymInfo)
264  {
265  RosSymDelete(KdbpRosSymInfo);
266  KdbpRosSymInfo = NULL;
267  KdbpImageBase = 0;
268  }
269 
271  {
272  if (RosSymCreateFromFile(FileContext, &KdbpRosSymInfo))
273  KdbpImageBase = (ULONG_PTR)MemoryArea->StartingAddress;
274 
276  }
277  }
278 
279  if (KdbpRosSymInfo)
280  {
281  RelativeAddress = (ULONG_PTR)Address - KdbpImageBase;
282  RosSymFreeInfo(&LineInfo);
284  (KdbpRosSymInfo,
285  RelativeAddress,
286  &LineInfo);
287  if (NT_SUCCESS(Status))
288  {
289  DbgPrint
290  ("<%wZ:%x (%s:%d (%s))>",
291  &SectionObject->FileObject->FileName,
292  RelativeAddress,
293  LineInfo.FileName,
294  LineInfo.LineNumber,
295  LineInfo.FunctionName);
296 
297  if (Context && LineInfo.NumParams)
298  {
299  int i;
300  char *comma = "";
301  DbgPrint("(");
302  for (i = 0; i < LineInfo.NumParams; i++) {
303  DbgPrint
304  ("%s%s=%llx",
305  comma,
306  LineInfo.Parameters[i].ValueName,
307  LineInfo.Parameters[i].Value);
308  comma = ",";
309  }
310  DbgPrint(")");
311  }
312 
313  return TRUE;
314  }
315  }
316 #endif
317  }
318 
319 end:
320  DbgPrint("<%wZ:%x>", &LdrEntry->BaseDllName, RelativeAddress);
321 
322  return TRUE;
323 }
324 
325 
342 NTSTATUS
344  IN PROSSYM_INFO RosSymInfo,
345  IN ULONG_PTR RelativeAddress,
346  IN PROSSYM_LINEINFO LineInfo)
347 {
348  if (!KdbpSymbolsInitialized ||
349  !RosSymInfo ||
350  !RosSymGetAddressInformation(RosSymInfo, RelativeAddress, LineInfo))
351  {
352  return STATUS_UNSUCCESSFUL;
353  }
354 
355  return STATUS_SUCCESS;
356 }
357 
373 {
374  PIMAGE_SYMBOL_INFO_CACHE Current;
375  PLIST_ENTRY CurrentEntry;
376  KIRQL Irql;
377 
379 
380  CurrentEntry = SymbolFileListHead.Flink;
381  while (CurrentEntry != (&SymbolFileListHead))
382  {
383  Current = CONTAINING_RECORD(CurrentEntry, IMAGE_SYMBOL_INFO_CACHE, ListEntry);
384 
385  if (RtlEqualUnicodeString(&Current->FileName, FileName, TRUE))
386  {
387  Current->RefCount++;
389  DPRINT("Found cached file!\n");
390  return Current->RosSymInfo;
391  }
392 
393  CurrentEntry = CurrentEntry->Flink;
394  }
395 
397 
398  DPRINT("Cached file not found!\n");
399  return NULL;
400 }
401 
409 static VOID
412  IN PROSSYM_INFO RosSymInfo)
413 {
414  PIMAGE_SYMBOL_INFO_CACHE CacheEntry;
415 
416  DPRINT("Adding symbol file: %wZ RosSymInfo = %p\n", FileName, RosSymInfo);
417 
418  /* allocate entry */
420  ASSERT(CacheEntry);
421  RtlZeroMemory(CacheEntry, sizeof (IMAGE_SYMBOL_INFO_CACHE));
422 
423  /* fill entry */
425  FileName->Length,
426  TAG_KDBS);
427  CacheEntry->FileName.MaximumLength = FileName->Length;
428  RtlCopyUnicodeString(&CacheEntry->FileName, FileName);
429  ASSERT(CacheEntry->FileName.Buffer);
430  CacheEntry->RefCount = 1;
431  CacheEntry->RosSymInfo = RosSymInfo;
432  InsertTailList(&SymbolFileListHead, &CacheEntry->ListEntry); /* FIXME: Lock list? */
433 }
434 
445 static VOID
447  IN PROSSYM_INFO RosSymInfo)
448 {
449  PIMAGE_SYMBOL_INFO_CACHE Current;
450  PLIST_ENTRY CurrentEntry;
451  KIRQL Irql;
452 
454 
455  CurrentEntry = SymbolFileListHead.Flink;
456  while (CurrentEntry != (&SymbolFileListHead))
457  {
458  Current = CONTAINING_RECORD(CurrentEntry, IMAGE_SYMBOL_INFO_CACHE, ListEntry);
459 
460  if (Current->RosSymInfo == RosSymInfo) /* found */
461  {
462  ASSERT(Current->RefCount > 0);
463  Current->RefCount--;
464  if (Current->RefCount < 1)
465  {
466  RemoveEntryList(&Current->ListEntry);
467  RosSymDelete(Current->RosSymInfo);
468  ExFreePool(Current);
469  }
470 
472  return;
473  }
474 
475  CurrentEntry = CurrentEntry->Flink;
476  }
477 
479 }
480 
488 VOID
491  OUT PROSSYM_INFO *RosSymInfo)
492 {
499 
500  /* Allow KDB to break on module load */
501  KdbModuleLoaded(FileName);
502 
503  if (!LoadSymbols)
504  {
505  *RosSymInfo = NULL;
506  return;
507  }
508 
509  /* Try to find cached (already loaded) symbol file */
510  *RosSymInfo = KdbpSymFindCachedFile(FileName);
511  if (*RosSymInfo)
512  {
513  DPRINT("Found cached symbol file %wZ\n", FileName);
514  return;
515  }
516 
517  /* Open the file */
519  FileName,
521  NULL,
522  NULL);
523 
524  DPRINT("Attempting to open image: %wZ\n", FileName);
525 
529  &IoStatusBlock,
532  if (!NT_SUCCESS(Status))
533  {
534  DPRINT("Could not open image file(%x): %wZ\n", Status, FileName);
535  return;
536  }
537 
538  DPRINT("Loading symbols from %wZ...\n", FileName);
539 
541  (FileHandle,
543  NULL,
544  KernelMode,
545  (PVOID*)&FileObject,
546  NULL);
547 
548  if (!NT_SUCCESS(Status))
549  {
550  DPRINT("Could not get the file object\n");
552  return;
553  }
554 
556  {
557  if (RosSymCreateFromFile(FileContext, RosSymInfo))
558  {
559  /* add file to cache */
560  int i;
561  UNICODE_STRING TruncatedName = *FileName;
562  for (i = (TruncatedName.Length / sizeof(WCHAR)) - 1; i >= 0; i--)
563  if (TruncatedName.Buffer[i] == '\\') {
564  TruncatedName.Buffer += i+1;
565  TruncatedName.Length -= (i+1)*sizeof(WCHAR);
566  TruncatedName.MaximumLength -= (i+1)*sizeof(WCHAR);
567  break;
568  }
569  KdbpSymAddCachedFile(&TruncatedName, *RosSymInfo);
570  DPRINT("Installed symbols: %wZ %p\n", &TruncatedName, *RosSymInfo);
571  }
573  }
574 
577 }
578 
579 VOID
581  IN PLDR_DATA_TABLE_ENTRY LdrEntry)
582 {
583  if (!LoadSymbols)
584  {
585  LdrEntry->PatchInformation = NULL;
586  return;
587  }
588 
589  /* Remove symbol info if it already exists */
590  if (LdrEntry->PatchInformation) {
591  KdbpSymRemoveCachedFile(LdrEntry->PatchInformation);
592  }
593 
594  /* Error loading symbol info, try to load it from file */
595  KdbpSymLoadModuleSymbols(&LdrEntry->FullDllName,
596  (PROSSYM_INFO*)&LdrEntry->PatchInformation);
597 
598  if (!LdrEntry->PatchInformation) {
599  // HACK: module dll names don't identify the real files
601  UNICODE_STRING ModuleNameCopy;
602  RtlInitUnicodeString(&SystemRoot, L"\\SystemRoot\\System32\\Drivers\\");
603  ModuleNameCopy.Length = 0;
604  ModuleNameCopy.MaximumLength =
605  LdrEntry->BaseDllName.MaximumLength + SystemRoot.MaximumLength;
606  ModuleNameCopy.Buffer = ExAllocatePool(NonPagedPool, SystemRoot.MaximumLength + LdrEntry->BaseDllName.MaximumLength);
607  RtlCopyUnicodeString(&ModuleNameCopy, &SystemRoot);
609  (ModuleNameCopy.Buffer + ModuleNameCopy.Length / sizeof(WCHAR),
610  LdrEntry->BaseDllName.Buffer,
611  LdrEntry->BaseDllName.Length);
612  ModuleNameCopy.Length += LdrEntry->BaseDllName.Length;
613  KdbpSymLoadModuleSymbols(&ModuleNameCopy,
614  (PROSSYM_INFO*)&LdrEntry->PatchInformation);
615  if (!LdrEntry->PatchInformation) {
616  SystemRoot.Length -= strlen("Drivers\\") * sizeof(WCHAR);
617  RtlCopyUnicodeString(&ModuleNameCopy, &SystemRoot);
619  (ModuleNameCopy.Buffer + ModuleNameCopy.Length / sizeof(WCHAR),
620  LdrEntry->BaseDllName.Buffer,
621  LdrEntry->BaseDllName.Length);
622  ModuleNameCopy.Length += LdrEntry->BaseDllName.Length;
623  KdbpSymLoadModuleSymbols(&ModuleNameCopy,
624  (PROSSYM_INFO*)&LdrEntry->PatchInformation);
625  }
626  RtlFreeUnicodeString(&ModuleNameCopy);
627  }
628 
629  /* It already added symbols to cache */
630  DPRINT("Installed symbols: %wZ@%p-%p %p\n",
631  &LdrEntry->BaseDllName,
632  LdrEntry->DllBase,
633  (PVOID)(LdrEntry->SizeOfImage + (ULONG_PTR)LdrEntry->DllBase),
634  LdrEntry->PatchInformation);
635 }
636 
637 VOID
638 NTAPI
640  PCH Message,
641  ULONG Length)
642 {
643  /* Nothing here */
644 }
645 
647 {
648  return ExAllocatePoolWithTag(NonPagedPool, size, 'RSYM');
649 }
650 
652 {
653  return ExFreePool(Area);
654 }
655 
656 static BOOLEAN KdbpSymReadMem(PVOID FileContext, ULONG_PTR* TargetDebug, PVOID SourceMem, ULONG Size)
657 {
658  return NT_SUCCESS(KdbpSafeReadMemory(TargetDebug, SourceMem, Size));
659 }
660 
665 };
666 
672 VOID
673 NTAPI
675  PKD_DISPATCH_TABLE DispatchTable,
676  ULONG BootPhase)
677 {
678  PCHAR p1, p2;
679  SHORT Found = FALSE;
680  CHAR YesNo;
681  PLDR_DATA_TABLE_ENTRY LdrEntry;
682 
683  DPRINT("KdbSymInit() BootPhase=%d\n", BootPhase);
684 
685  LoadSymbols = FALSE;
686 
687 #if DBG
688  /* Load symbols only if we have 96Mb of RAM or more */
689  if (MmNumberOfPhysicalPages >= 0x6000)
690  LoadSymbols = TRUE;
691 #endif
692 
693  if (BootPhase == 0)
694  {
695  /* Write out the functions that we support for now */
696  DispatchTable->KdpInitRoutine = KdpKdbgInit;
697  DispatchTable->KdpPrintRoutine = KdbDebugPrint;
698 
699  /* Register as a Provider */
700  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
701 
702  /* Perform actual initialization of symbol module */
703  //NtoskrnlModuleObject->PatchInformation = NULL;
704  //LdrHalModuleObject->PatchInformation = NULL;
705 
708 
709  /* Check the command line for /LOADSYMBOLS, /NOLOADSYMBOLS,
710  * /LOADSYMBOLS={YES|NO}, /NOLOADSYMBOLS={YES|NO} */
713  while('\0' != *p1 && NULL != (p2 = strchr(p1, '/')))
714  {
715  p2++;
716  Found = 0;
717  if (0 == _strnicmp(p2, "LOADSYMBOLS", 11))
718  {
719  Found = +1;
720  p2 += 11;
721  }
722  else if (0 == _strnicmp(p2, "NOLOADSYMBOLS", 13))
723  {
724  Found = -1;
725  p2 += 13;
726  }
727  if (0 != Found)
728  {
729  while (isspace(*p2))
730  {
731  p2++;
732  }
733  if ('=' == *p2)
734  {
735  p2++;
736  while (isspace(*p2))
737  {
738  p2++;
739  }
740  YesNo = toupper(*p2);
741  if ('N' == YesNo || 'F' == YesNo || '0' == YesNo)
742  {
743  Found = -1 * Found;
744  }
745  }
746  LoadSymbols = (0 < Found);
747  }
748  p1 = p2;
749  }
750 
752  }
753  else if (BootPhase == 3)
754  {
755  /* Load symbols for NTOSKRNL.EXE.
756  It is always the first module in PsLoadedModuleList. KeLoaderBlock can't be used here as its content is just temporary. */
757  LdrEntry = CONTAINING_RECORD(PsLoadedModuleList.Flink, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
758  KdbSymProcessSymbols(LdrEntry);
759 
760  /* Also load them for HAL.DLL. */
761  LdrEntry = CONTAINING_RECORD(PsLoadedModuleList.Flink->Flink, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
762  KdbSymProcessSymbols(LdrEntry);
763 
765  }
766 }
767 
768 /* EOF */
_Must_inspect_result_ _Outptr_ PVOID * SectionObject
Definition: fsrtlfuncs.h:860
#define FILE_READ_ACCESS
Definition: nt_native.h:610
signed char * PCHAR
Definition: retypes.h:7
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define IN
Definition: typedefs.h:38
#define isspace(c)
Definition: acclib.h:69
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
VOID NTAPI KdpKdbgInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdbg.c:21
_ROSSYM_REGNAME
Definition: rossym.h:33
ULONG Type
Definition: mm.h:214
static BOOLEAN KdbpReadSymFile(PVOID FileContext, PVOID Buffer, ULONG Length)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
NTSTATUS KdbSymGetAddressInformation(IN PROSSYM_INFO RosSymInfo, IN ULONG_PTR RelativeAddress, IN PROSSYM_LINEINFO LineInfo)
Get information for an address (source file, line number, function name)
PROSSYM_INFO KdbpSymFindCachedFile(IN PUNICODE_STRING FileName)
Find cached symbol file.
#define DbgPrint
Definition: loader.c:25
USHORT MaximumLength
Definition: env_spec_w32.h:370
VOID RosSymFreeInfo(PROSSYM_LINEINFO RosSymLineInfo)
Definition: dwarfpc.c:398
char * FileName
Definition: rossym.h:86
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
char CHAR
Definition: xmlstorage.h:175
struct _ROSSYM_KM_OWN_CONTEXT * PROSSYM_KM_OWN_CONTEXT
VOID RosSymDelete(PROSSYM_INFO RosSymInfo)
Definition: delete.c:16
LONG NTSTATUS
Definition: precomp.h:26
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
BOOLEAN RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo)
Definition: fromfile.c:20
ULONG NumParams
Definition: rossym.h:89
ULONGLONG Registers[32]
Definition: rossym.h:62
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
GLuint GLuint end
Definition: gl.h:1545
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define InsertTailList(ListHead, Entry)
PMEMORY_AREA NTAPI MmLocateMemoryAreaByAddress(PMMSUPPORT AddressSpace, PVOID Address)
Definition: marea.c:60
static VOID KdbpReleaseFileForSymbols(PROSSYM_KM_OWN_CONTEXT Context)
_Out_ PKIRQL Irql
Definition: csq.h:179
int32_t INT
Definition: typedefs.h:56
UNICODE_STRING FileName
Definition: kdb_symbols.c:24
#define FILE_SHARE_READ
Definition: compat.h:125
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
LIST_ENTRY KdProviders
Definition: kdinit.c:29
uint32_t ULONG_PTR
Definition: typedefs.h:63
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
PVOID DllBase
Definition: btrfs_drv.h:1857
UCHAR KIRQL
Definition: env_spec_w32.h:591
HANDLE FileHandle
Definition: stats.c:38
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:496
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
long LONG
Definition: pedump.c:60
static VOID KdbpSymAddCachedFile(IN PUNICODE_STRING FileName, IN PROSSYM_INFO RosSymInfo)
Add a symbol file to the cache.
short SHORT
Definition: pedump.c:59
#define FILE_READ_DATA
Definition: nt_native.h:628
union _MEMORY_AREA::@1743 Data
_Check_return_ _CRTIMP int __cdecl _strnicmp(_In_reads_or_z_(_MaxCount) const char *_Str1, _In_reads_or_z_(_MaxCount) const char *_Str2, _In_ size_t _MaxCount)
ROSSYM_PARAMETER Parameters[16]
Definition: rossym.h:90
CHAR * PCH
Definition: ntbasedef.h:398
#define PsGetCurrentProcess
Definition: psfuncs.h:17
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
char * ValueName
Definition: rossym.h:67
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
BOOLEAN RosSymGetAddressInformation(PROSSYM_INFO RosSymInfo, ULONG_PTR RelativeAddress, ULONG *LineNumber, char *FileName, char *FunctionName)
Definition: find.c:94
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
return Found
Definition: dirsup.c:1270
#define MEMORY_AREA_SECTION_VIEW
Definition: mm.h:71
PLOADER_PARAMETER_BLOCK KeLoaderBlock
Definition: krnlinit.c:29
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
_In_ PFCB _In_ PCD_NAME _In_ BOOLEAN _Inout_ PFILE_ENUM_CONTEXT FileContext
Definition: cdprocs.h:444
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
PVOID PatchInformation
Definition: ldrtypes.h:164
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
int toupper(int c)
Definition: utclib.c:881
ULONG CurrentProcess
Definition: shell.c:125
ULONGLONG Value
Definition: rossym.h:66
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR SystemRoot[]
Definition: reg.c:38
__wchar_t WCHAR
Definition: xmlstorage.h:180
return Iosb
Definition: create.c:4426
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static VOID KdbpSymFreeMem(PVOID Area)
BOOLEAN KdbSymPrintAddress(IN PVOID Address, IN PKTRAP_FRAME Context)
Print address...
char * FunctionName
Definition: rossym.h:87
LIST_ENTRY PsLoadedModuleList
Definition: sysldr.c:34
static PROSSYM_KM_OWN_CONTEXT KdbpCaptureFileForSymbols(PFILE_OBJECT FileObject)
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
struct _IMAGE_SYMBOL_INFO_CACHE IMAGE_SYMBOL_INFO_CACHE
struct _MEMORY_AREA::@1743::@1744 SectionData
static const UCHAR Index[8]
Definition: usbohci.c:18
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
VOID NTAPI KdbInitialize(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Initializes the KDB symbols implementation.
static BOOLEAN KdbpSeekSymFile(PVOID FileContext, ULONG_PTR Target)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ typedef _In_ ULONG _In_ BOOLEAN Target
Definition: iotypes.h:1068
* PFILE_OBJECT
Definition: iotypes.h:1955
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
VOID RosSymInit(PROSSYM_CALLBACKS Callbacks)
Definition: init.c:17
BOOLEAN KdbpSymFindModule(IN PVOID Address OPTIONAL, IN LPCWSTR Name OPTIONAL, IN INT Index OPTIONAL, OUT PLDR_DATA_TABLE_ENTRY *pLdrEntry)
Find a module...
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
CHAR Message[80]
Definition: alive.c:5
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSYSAPI NTSTATUS NTAPI ZwOpenFile(_Out_ PHANDLE FileHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_ ULONG ShareAccess, _In_ ULONG OpenOptions)
static const WCHAR L[]
Definition: oid.c:1250
BOOLEAN KdbpSymbolsInitialized
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define FILE_NON_DIRECTORY_FILE
Definition: constants.h:492
Definition: btrfs_drv.h:1853
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
VOID KdbSymProcessSymbols(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: typedefs.h:117
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define SYNCHRONIZE
Definition: nt_native.h:61
Status
Definition: gdiplustypes.h:24
struct _ROSSYM_KM_OWN_CONTEXT ROSSYM_KM_OWN_CONTEXT
struct _FileName FileName
Definition: fatprocs.h:884
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
NTSTATUS KdbpSafeReadMemory(OUT PVOID Dest, IN PVOID Src, IN ULONG Bytes)
Definition: kdb.c:1727
static BOOLEAN LoadSymbols
static VOID KdbpSymRemoveCachedFile(IN PROSSYM_INFO RosSymInfo)
Remove a symbol file (reference) from the cache.
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
static LSA_DISPATCH_TABLE DispatchTable
Definition: authpackage.c:164
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
UNICODE_STRING BaseDllName
Definition: ldrtypes.h:145
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
static BOOLEAN KdbpSymReadMem(PVOID FileContext, ULONG_PTR *TargetDebug, PVOID SourceMem, ULONG Size)
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
static LIST_ENTRY SymbolFileListHead
PROSSYM_INFO RosSymInfo
Definition: kdb_symbols.c:25
struct _IMAGE_SYMBOL_INFO_CACHE * PIMAGE_SYMBOL_INFO_CACHE
char * strchr(const char *String, int ch)
Definition: utclib.c:501
ROSSYM_LINEINFO_FLAGS Flags
Definition: rossym.h:84
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
ROSSYM_REGISTERS Registers
Definition: rossym.h:88
ULONG LineNumber
Definition: rossym.h:85
static PVOID KdbpSymAllocMem(ULONG_PTR size)
#define OUT
Definition: typedefs.h:39
#define ObReferenceObject
Definition: obfuncs.h:204
struct tagContext Context
Definition: acpixf.h:1030
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ULONG_PTR
Definition: config.h:101
#define SEC_IMAGE
Definition: mmtypes.h:96
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
VOID KdbpSymLoadModuleSymbols(IN PUNICODE_STRING FileName, OUT PROSSYM_INFO *RosSymInfo)
Loads a symbol file.
#define TAG_KDBS
Definition: kdb.h:7
return STATUS_SUCCESS
Definition: btrfs.c:2938
static KSPIN_LOCK SymbolFileListLock
signed int * PLONG
Definition: retypes.h:5
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define MmSystemRangeStart
Definition: mm.h:32
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
static ROSSYM_CALLBACKS KdbpRosSymCallbacks
static BOOLEAN KdbpSymSearchModuleList(IN PLIST_ENTRY current_entry, IN PLIST_ENTRY end_entry, IN PLONG Count, IN PVOID Address, IN LPCWSTR Name, IN INT Index, OUT PLDR_DATA_TABLE_ENTRY *pLdrEntry)
NTSTATUS NTAPI MiSimpleRead(PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, PVOID Buffer, ULONG Length, BOOLEAN Paging, PIO_STATUS_BLOCK ReadStatus)
Definition: io.c:114
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
VOID NTAPI KdbDebugPrint(PCH Message, ULONG Length)