From c29e190650f30db978afb8d180fe1c0b63774df9 Mon Sep 17 00:00:00 2001 From: Royce Mitchell III Date: Thu, 9 Dec 2004 14:20:06 +0000 Subject: [PATCH] allow data from SYM files to be used in stack traces in DBG builds svn path=/trunk/; revision=11993 --- reactos/include/ntdll/ldr.h | 4 ++-- reactos/ntoskrnl/Makefile | 12 +++++++++++- reactos/ntoskrnl/include/internal/kd.h | 6 +++--- reactos/ntoskrnl/include/internal/module.h | 2 +- reactos/ntoskrnl/io/driver.c | 4 ++-- reactos/ntoskrnl/ke/i386/exp.c | 2 +- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/reactos/include/ntdll/ldr.h b/reactos/include/ntdll/ldr.h index db3afd2c8d0..d002bc8e6da 100644 --- a/reactos/include/ntdll/ldr.h +++ b/reactos/include/ntdll/ldr.h @@ -68,7 +68,7 @@ typedef struct _LDR_MODULE HANDLE SectionHandle; ULONG CheckSum; ULONG TimeDateStamp; -#ifdef KDBG +#if defined(DBG) || defined(KDBG) IMAGE_SYMBOL_INFO SymbolInfo; #endif /* KDBG */ } LDR_MODULE, *PLDR_MODULE; @@ -85,7 +85,7 @@ typedef struct _LDR_SYMBOL_INFO { #define RVA(m, b) ((ULONG)b + m) -#ifdef KDBG +#if defined(KDBG) || defined(DBG) VOID LdrpLoadUserModuleSymbols(PLDR_MODULE LdrModule); diff --git a/reactos/ntoskrnl/Makefile b/reactos/ntoskrnl/Makefile index e65a8255177..8749e004485 100644 --- a/reactos/ntoskrnl/Makefile +++ b/reactos/ntoskrnl/Makefile @@ -16,6 +16,13 @@ TARGET_BOOTSTRAP = yes CONFIG := +ifeq ($(DBG), 1) +DBG_OR_KDBG := 1 +endif +ifeq ($(KDBG), 1) +DBG_OR_KDBG := 1 +endif + LINKER_SCRIPT := ntoskrnl.lnk STRIP_FLAGS := -Wl,-s @@ -27,7 +34,7 @@ endif ifeq ($(KDBG), 1) OBJECTS_KDBG := dbg/kdb.o dbg/kdb_serial.o dbg/kdb_keyboard.o dbg/rdebug.o \ - dbg/i386/kdb_help.o dbg/kdb_stabs.o dbg/kdb_symbols.o dbg/profile.o \ + dbg/i386/kdb_help.o dbg/profile.o \ ../dk/w32/lib/libkjs.a dbg/i386/i386-dis.o CFLAGS_KDBG := -I../lib/kjs/include preall: all @@ -37,6 +44,9 @@ preall: all else OBJECTS_KDBG := endif +ifeq ($(DBG_OR_KDBG), 1) +OBJECTS_KDBG := $(OBJECTS_KDBG) dbg/kdb_stabs.o dbg/kdb_symbols.o +endif TARGET_ASFLAGS = -I./include TARGET_CFLAGS = -I./include $(CFLAGS_KDBG) -Wall -Werror $(CFLAGS_OPT) diff --git a/reactos/ntoskrnl/include/internal/kd.h b/reactos/ntoskrnl/include/internal/kd.h index 1e8a2157483..38cb2836c5d 100644 --- a/reactos/ntoskrnl/include/internal/kd.h +++ b/reactos/ntoskrnl/include/internal/kd.h @@ -1,4 +1,4 @@ -/* $Id: kd.h,v 1.28 2004/11/20 22:21:35 arty Exp $ +/* $Id: kd.h,v 1.29 2004/12/09 14:20:06 royce Exp $ * * kernel debugger prototypes */ @@ -108,7 +108,7 @@ KdEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, VOID KdInitializeMda(VOID); VOID KdPrintMda(PCH pch); -#ifndef KDBG +#if !defined(KDBG) && !defined(DBG) # define KDB_LOADUSERMODULE_HOOK(LDRMOD) do { } while (0) # define KDB_DELETEPROCESS_HOOK(PROCESS) do { } while (0) # define KDB_LOADDRIVER_HOOK(FILENAME, MODULE) do { } while (0) @@ -160,7 +160,7 @@ KdbEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, PKTRAP_FRAME TrapFrame, BOOLEAN HandleAlways); -#endif /* KDBG */ +#endif /* KDBG || DBG */ VOID DebugLogDumpMessages(VOID); diff --git a/reactos/ntoskrnl/include/internal/module.h b/reactos/ntoskrnl/include/internal/module.h index b9f0c9c038c..9c60eba1ca5 100644 --- a/reactos/ntoskrnl/include/internal/module.h +++ b/reactos/ntoskrnl/include/internal/module.h @@ -14,7 +14,7 @@ typedef struct _MODULE_TEXT_SECTION LIST_ENTRY ListEntry; PWCH Name; PIMAGE_OPTIONAL_HEADER OptionalHeader; -#ifdef KDBG +#if defined(DBG) || defined(KDBG) IMAGE_SYMBOL_INFO SymbolInfo; #endif /* KDBG */ } MODULE_TEXT_SECTION, *PMODULE_TEXT_SECTION; diff --git a/reactos/ntoskrnl/io/driver.c b/reactos/ntoskrnl/io/driver.c index d1dffa6f34f..c28b3c5d64f 100644 --- a/reactos/ntoskrnl/io/driver.c +++ b/reactos/ntoskrnl/io/driver.c @@ -1,4 +1,4 @@ -/* $Id: driver.c,v 1.55 2004/11/07 21:20:51 navaraf Exp $ +/* $Id: driver.c,v 1.56 2004/12/09 14:20:06 royce Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -1237,7 +1237,7 @@ IopInitializeBootDrivers(VOID) * and symbol files, if the kernel debugger is active */ if (_stricmp(Extension, ".exe") && _stricmp(Extension, ".dll") -#ifdef KDBG +#if defined(DBG) || defined(KDBG) && _stricmp(Extension, ".sym") #endif ) diff --git a/reactos/ntoskrnl/ke/i386/exp.c b/reactos/ntoskrnl/ke/i386/exp.c index 0ddff89e8f5..4c8f660af0e 100644 --- a/reactos/ntoskrnl/ke/i386/exp.c +++ b/reactos/ntoskrnl/ke/i386/exp.c @@ -124,7 +124,7 @@ static NTSTATUS ExceptionToNtStatus[] = /* FUNCTIONS ****************************************************************/ -#ifdef KDBG +#if defined(DBG) || defined(KDBG) BOOLEAN STDCALL KeRosPrintAddress(PVOID address) {