Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 9ded977 in mainline


Ignore:
Timestamp:
2010-07-27T16:10:42Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial
Children:
3629481
Parents:
142084b2
Message:

add initial support for line debugging information and generating disassembly outputs with source code intermixed (useful for analyzing of stack traces)
currently the disassembly and source is intermixed only in the case of amd64 kernel (other linker scripts strip the debugging sections so far)

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    r142084b2 r9ded977  
    543543! CONFIG_BAREBONE (n/y)
    544544
     545% Line debugging information
     546! [CONFIG_STRIP_BINARIES!=y] CONFIG_LINE_DEBUG (n/y)
  • boot/Makefile.build

    r142084b2 r9ded977  
    6161        GCC_CFLAGS += -Werror
    6262        ICC_CFLAGS += -Werror
     63endif
     64
     65ifeq ($(CONFIG_LINE_DEBUG),y)
     66        GCC_CFLAGS += -g
     67        ICC_CFLAGS += -g
     68        SUNCC_CFLAGS += -g
     69        CLANG_CFLAGS += -g
    6370endif
    6471
  • kernel/Makefile

    r142084b2 r9ded977  
    120120ifeq ($(CONFIG_LTO),y)
    121121        GCC_CFLAGS += -flto
     122endif
     123
     124ifeq ($(CONFIG_LINE_DEBUG),y)
     125        GCC_CFLAGS += -g
     126        ICC_CFLAGS += -g
     127        SUNCC_CFLAGS += -g
     128        CLANG_CFLAGS += -g
    122129endif
    123130
     
    401408
    402409$(DISASM): $(RAW)
     410ifeq ($(CONFIG_LINE_DEBUG),y)
     411        $(OBJDUMP) -d -S $< > $@
     412else
    403413        $(OBJDUMP) -d $< > $@
     414endif
    404415
    405416$(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS)
  • kernel/arch/amd64/_link.ld.in

    r142084b2 r9ded977  
    5353        }
    5454       
     55#ifdef CONFIG_LINE_DEBUG
     56        .comment 0 : { *(.comment); }
     57        .debug_abbrev 0 : { *(.debug_abbrev); }
     58        .debug_aranges 0 : { *(.debug_aranges); }
     59        .debug_info 0 : { *(.debug_info); }
     60        .debug_line 0 : { *(.debug_line); }
     61        .debug_loc 0 : { *(.debug_loc); }
     62        .debug_pubnames 0 : { *(.debug_pubnames); }
     63        .debug_pubtypes 0 : { *(.debug_pubtypes); }
     64        .debug_ranges 0 : { *(.debug_ranges); }
     65        .debug_str 0 : { *(.debug_str); }
     66#endif
     67       
    5568        /DISCARD/ : {
    5669                *(*);
  • uspace/Makefile.common

    r142084b2 r9ded977  
    172172ifneq ($(BINARY),)
    173173%.disasm: $(BINARY)
     174ifeq ($(CONFIG_LINE_DEBUG),y)
     175        $(OBJDUMP) -d -S $< > $@
     176else
    174177        $(OBJDUMP) -d $< > $@
     178endif
    175179
    176180$(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBS) $(BASE_LIBS)
Note: See TracChangeset for help on using the changeset viewer.