From b5640dfb24177bd59586b7fd6c2b10a8cdaf82ec Mon Sep 17 00:00:00 2001 From: lucic71 Date: Tue, 28 Jun 2022 19:40:51 +0300 Subject: [PATCH] Added debug symbols for bochs --- bochs.sh | 1 + bochs/bochsrc.txt | 1 + kernel/Makefile | 4 ++-- sym.sh | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 sym.sh diff --git a/bochs.sh b/bochs.sh index 1252b86..cea7a5e 100755 --- a/bochs.sh +++ b/bochs.sh @@ -1,6 +1,7 @@ #!/bin/sh . ./iso.sh +(./sym.sh "kernel/os.kernel") BOCHS_CONFIG_FILE=bochs/bochsrc.txt diff --git a/bochs/bochsrc.txt b/bochs/bochsrc.txt index 3867ce3..54771e4 100644 --- a/bochs/bochsrc.txt +++ b/bochs/bochsrc.txt @@ -8,3 +8,4 @@ log: ./bochs/bochslog.txt clock: sync=realtime, time0=local cpu: count=1, ips=1000000 magic_break: enabled=1 +debug_symbols: file=./kernel/os.kernel.sym diff --git a/kernel/Makefile b/kernel/Makefile index 0402168..79b62da 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -6,7 +6,7 @@ HOSTARCH!=../target-triplet-to-arch.sh $(HOST) # Compiler and linker flags. -CFLAGS?=-g3 +CFLAGS?=-g CPPFLAGS?= LDFLAGS?= LIBS?= @@ -126,7 +126,7 @@ $(ARCHDIR)/crtbegin.o $(ARCHDIR)/crtend.o: $(CC) -MD -c $< -o $@ $(CFLAGS) $(CPPFLAGS) clean: library_clean module_clean - rm -f os.kernel + rm -f os.kernel* rm -f $(OBJS) *.o */*.o */*/*.o rm -f $(OBJS:.o=.d) *.d */*.d */*/*.d diff --git a/sym.sh b/sym.sh new file mode 100755 index 0000000..d9500c2 --- /dev/null +++ b/sym.sh @@ -0,0 +1,2 @@ +#!/bin/sh +nm $1 | grep " T " | awk '{ print $1" "$3 }' > $1.sym