History

Add dwarf support

The new gcc12 release does not support stabs any more. This was a good reason to add support for dwarf. The stabs code still works and is used if configure option --dwarf is not used. Tested on x86_64, i386, arm, arm64, riscv64 with dwarf-5. Some debuggers may not support dwarf-5. Try using older dwarf versions i that case. The tccmacho.c code probably need some support for dwarf. arm-gen.c, arm64-gen.c, i386-gen.c, riscv64-gen.c, x86_64-gen. - fix get_sym_ref symbol size arm-link.c, arm64-link.c, i386-link.c, riscv64-link.c, x86_64-link.c - add R_DATA_32U libtcc.c: - parse -gdwarf option tcc.c: - add dwarf option tcc.h: - add dwarf option and sections tccelf.c: - init dwarf sections - avoid adding sh_addr for dwarf sections - remove dwarf relocs for output dll - add dwarf sections for tccrun tccgen.c: - add dwarf defines + global data - add dwarf_* functions - mix dwarf code with stabs code - a trick is used to emit function name in .debug_line section so only this section has to be parsed instead of .debug_info and .debug_abbrev. - fix init debug_modes tccrun.c: - add dwarf sections in rt_context - init them in tcc_run - add new dwarf code rt_printline_dwarf to find file/function dwarf.h: - New file tcc-doc.texi: - document dwarf configure: - add dwarf option lib/Makefile - change -gstabs into -gdwarf lib/bt-exe.c, tests/tests2/Makefile, tests/tests2/126_bound_global: - Add __bound_init call - Add new testcase to test it

herman ten brugge committed 4 years ago

Commit 2f2708a1 parent d3e940c26 files · +2754 −144Browse files

Showing the changes to lib (2 of 26 files). Show all

Unified · Split

2 files
  1. lib/Makefile +1 −1
  2. lib/bt-exe.c +4 −0
lib/Makefile+1−1
@@ -27,7 +27,7 @@ arm-libtcc1-usegcc ?= no · 26 unmodified lines
27ifeq "$($(T)-libtcc1-usegcc)" "yes"27ifeq "$($(T)-libtcc1-usegcc)" "yes"
28 XCC = $(CC)28 XCC = $(CC)
29 XAR = $(AR)29 XAR = $(AR)
30 XFLAGS = $(CFLAGS) -fPIC -gstabs -fno-omit-frame-pointer -Wno-unused-function -Wno-unused-variable30 XFLAGS = $(CFLAGS) -fPIC -gdwarf -fno-omit-frame-pointer -Wno-unused-function -Wno-unused-variable
31endif31endif
32 32
33ifneq ($(CONFIG_backtrace),no)33ifneq ($(CONFIG_backtrace),no)
lib/bt-exe.c+4−0
@@ -18,6 +18,10 @@ void __bt_init(rt_context *p, int num_callers) · 17 unmodified lines
18 __attribute__((weak)) void __bound_init(void*, int);18 __attribute__((weak)) void __bound_init(void*, int);
19 struct rt_context *rc = &g_rtctxt;19 struct rt_context *rc = &g_rtctxt;
20 //fprintf(stderr, "__bt_init %d %p %p\n", num_callers, p->stab_sym, p->bounds_start), fflush(stderr);20 //fprintf(stderr, "__bt_init %d %p %p\n", num_callers, p->stab_sym, p->bounds_start), fflush(stderr);
21 /* call __bound_init here due to redirection of sigaction */
22 /* needed to add global symbols */
23 if (__bound_init && p->bounds_start)
24 __bound_init(p->bounds_start, -1);
21 if (num_callers) {25 if (num_callers) {
22 memcpy(rc, p, offsetof(rt_context, next));26 memcpy(rc, p, offsetof(rt_context, next));
23 rc->num_callers = num_callers - 1;27 rc->num_callers = num_callers - 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t