mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-12 09:00:09 +08:00
libtcc: Activate DWARF debug infos with tcc -gdwarf ...
This fixes the bug that "tcc -gdwarf ..." still creates the stab debug infos, when tcc was build without using DWARF debug infos by default (configure option: --dwarf=x) -- Regards ... Detlef
This commit is contained in:
parent
2acf65f7e6
commit
c51236eee7
5
libtcc.c
5
libtcc.c
@ -1868,8 +1868,9 @@ reparse:
|
||||
case TCC_OPTION_g:
|
||||
s->do_debug = 1;
|
||||
s->dwarf = DWARF_VERSION;
|
||||
if (strstart("dwarf-", &optarg))
|
||||
s->dwarf = atoi(optarg);
|
||||
|
||||
if (strstart("dwarf", &optarg))
|
||||
s->dwarf = (*optarg) ? (0 - atoi(optarg)) : DEFAULT_DWARF_VERSION;
|
||||
break;
|
||||
case TCC_OPTION_c:
|
||||
x = TCC_OUTPUT_OBJ;
|
||||
|
8
tcc.h
8
tcc.h
@ -1815,10 +1815,18 @@ ST_FUNC void tcc_tcov_reset_ind(TCCState *s1);
|
||||
#define dwarf_str_section s1->dwarf_str_section
|
||||
#define dwarf_line_str_section s1->dwarf_line_str_section
|
||||
|
||||
/* default dwarf version for "-g". use 0 to emit stab debug infos */
|
||||
#ifndef DWARF_VERSION
|
||||
# define DWARF_VERSION 0
|
||||
#endif
|
||||
|
||||
/* default dwarf version for "-gdwarf" */
|
||||
#ifdef TCC_TARGET_MACHO
|
||||
# define DEFAULT_DWARF_VERSION 2
|
||||
#else
|
||||
# define DEFAULT_DWARF_VERSION 5
|
||||
#endif
|
||||
|
||||
#if defined TCC_TARGET_PE
|
||||
# define R_DATA_32DW 'Z' /* fake code to avoid DLL relocs */
|
||||
#elif defined TCC_TARGET_X86_64
|
||||
|
Loading…
Reference in New Issue
Block a user