Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision 142084b24ae42b2c38696be8135b8058ea48c101)
+++ HelenOS.config	(revision 9ded977c87c346e6072b96a66a580c64f16342bb)
@@ -543,2 +543,4 @@
 ! CONFIG_BAREBONE (n/y)
 
+% Line debugging information
+! [CONFIG_STRIP_BINARIES!=y] CONFIG_LINE_DEBUG (n/y)
Index: boot/Makefile.build
===================================================================
--- boot/Makefile.build	(revision 142084b24ae42b2c38696be8135b8058ea48c101)
+++ boot/Makefile.build	(revision 9ded977c87c346e6072b96a66a580c64f16342bb)
@@ -61,4 +61,11 @@
 	GCC_CFLAGS += -Werror
 	ICC_CFLAGS += -Werror
+endif
+
+ifeq ($(CONFIG_LINE_DEBUG),y)
+	GCC_CFLAGS += -g
+	ICC_CFLAGS += -g
+	SUNCC_CFLAGS += -g
+	CLANG_CFLAGS += -g
 endif
 
Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision 142084b24ae42b2c38696be8135b8058ea48c101)
+++ kernel/Makefile	(revision 9ded977c87c346e6072b96a66a580c64f16342bb)
@@ -120,4 +120,11 @@
 ifeq ($(CONFIG_LTO),y)
 	GCC_CFLAGS += -flto
+endif
+
+ifeq ($(CONFIG_LINE_DEBUG),y)
+	GCC_CFLAGS += -g
+	ICC_CFLAGS += -g
+	SUNCC_CFLAGS += -g
+	CLANG_CFLAGS += -g
 endif
 
@@ -401,5 +408,9 @@
 
 $(DISASM): $(RAW)
+ifeq ($(CONFIG_LINE_DEBUG),y)
+	$(OBJDUMP) -d -S $< > $@
+else
 	$(OBJDUMP) -d $< > $@
+endif
 
 $(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS)
Index: kernel/arch/amd64/_link.ld.in
===================================================================
--- kernel/arch/amd64/_link.ld.in	(revision 142084b24ae42b2c38696be8135b8058ea48c101)
+++ kernel/arch/amd64/_link.ld.in	(revision 9ded977c87c346e6072b96a66a580c64f16342bb)
@@ -53,4 +53,17 @@
 	}
 	
+#ifdef CONFIG_LINE_DEBUG
+	.comment 0 : { *(.comment); }
+	.debug_abbrev 0 : { *(.debug_abbrev); }
+	.debug_aranges 0 : { *(.debug_aranges); }
+	.debug_info 0 : { *(.debug_info); }
+	.debug_line 0 : { *(.debug_line); }
+	.debug_loc 0 : { *(.debug_loc); }
+	.debug_pubnames 0 : { *(.debug_pubnames); }
+	.debug_pubtypes 0 : { *(.debug_pubtypes); }
+	.debug_ranges 0 : { *(.debug_ranges); }
+	.debug_str 0 : { *(.debug_str); }
+#endif
+	
 	/DISCARD/ : {
 		*(*);
Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision 142084b24ae42b2c38696be8135b8058ea48c101)
+++ uspace/Makefile.common	(revision 9ded977c87c346e6072b96a66a580c64f16342bb)
@@ -172,5 +172,9 @@
 ifneq ($(BINARY),)
 %.disasm: $(BINARY)
+ifeq ($(CONFIG_LINE_DEBUG),y)
+	$(OBJDUMP) -d -S $< > $@
+else
 	$(OBJDUMP) -d $< > $@
+endif
 
 $(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBS) $(BASE_LIBS)
