Skip to contentSkip to conversation

Problem of debugging modules on x86_64 platform using KGDB

PATCH Mithlesh Thukral 2 participants 2 messages Sep 8, 2004

lore
Share & tools
lore
#0 lore raw

hi,
On the x86_64 platform we faced a problem of debugging modules using KGDB.
For working around the problem, we need the compile the file 'arch/x86_64/kernel/vsyscall.c' without the generation of debugging information.
For this i moved the 'vsyscall.c' from the directory 'arch/x86_64/kernel' to a new directory 'arch/x86_64/kernel/vsyscall/' . The make file in this new directory does not generate the debugging information for the file 'vsyscall.c'.
Please let me know if there is some other way by which i can specify a different set of compilation flags for a single file in the directory. this will help me in not moving the file in a new directory.

Regards,
Mithlesh Thukral

arch/x86_64/kernel/Makefile +2 -1
Index: linux-2.6.7/arch/x86_64/kernel/Makefile
===================================================================
@@ -6,8 +6,9 @@
 EXTRA_AFLAGS	:= -traditional
 obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o \
 		ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \
-		x8664_ksyms.o i387.o syscall.o vsyscall.o \
+		x8664_ksyms.o i387.o syscall.o \
 		setup64.o bootflag.o e820.o reboot.o warmreboot.o
+obj-y	+= vsyscall/
 obj-y += mce.o
 
 obj-$(CONFIG_MTRR)		+= ../../i386/kernel/cpu/mtrr/
arch/x86_64/kernel/vsyscall.c +0 -180

180 lines not on this page · raw message

arch/x86_64/kernel/vsyscall/vsyscall.c +180 -0

180 lines not on this page · raw message

arch/x86_64/kernel/vsyscall/Makefile +3 -0
Index: linux-2.6.7/arch/x86_64/kernel/vsyscall/Makefile
===================================================================
@@ -0,0 +1,3 @@
+EXTRA_CFLAGS	:= -g0
+
+obj-y := vsyscall.o
#1 lore raw
Quoted 5 lines · Mithlesh Thukral

hi,
On the x86_64 platform we faced a problem of debugging modules using KGDB.
For working around the problem, we need the compile the file 'arch/x86_64/kernel/vsyscall.c' without the generation of debugging

Quoted 8 lines

information.
For this i moved the 'vsyscall.c' from the directory 'arch/x86_64/kernel' to a new directory 'arch/x86_64/kernel/vsyscall/' . The make file in this new directory does not generate the debugging information for the file 'vsyscall.c'.
Please let me know if there is some other way by which i can specify a different set of compilation flags for a single file in the directory. this will help me in not moving the file in a new directory.

In arch/x86_64/kernel/Makfile:
CFLAGS_vsyscalls.o := -g0

That should do the trick.

Use make V=1 to check which flags are passed to gcc. See also Documentation/kbuild/makefiles.txt for reference.

Sam