History

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

Detlef Riekenberg committed 4 years ago

Commit c51236e1 parent 2acf65f2 files · +12 −3Browse files

Unified · Split

2 files
  1. libtcc.c +4 −3
  2. tcc.h +8 −0
libtcc.c+4−3
@@ -1867,9 +1867,10 @@ reparse: · 1866 unmodified lines
1867#endif1867#endif
1868 case TCC_OPTION_g:1868 case TCC_OPTION_g:
1869 s->do_debug = 1;1869 s->do_debug = 1;
1870 s->dwarf = DWARF_VERSION;1870 s->dwarf = DWARF_VERSION;
1871 if (strstart("dwarf-", &optarg))1871
1872 s->dwarf = atoi(optarg);1872 if (strstart("dwarf", &optarg))
1873 s->dwarf = (*optarg) ? (0 - atoi(optarg)) : DEFAULT_DWARF_VERSION;
1873 break;1874 break;
1874 case TCC_OPTION_c:1875 case TCC_OPTION_c:
1875 x = TCC_OUTPUT_OBJ;1876 x = TCC_OUTPUT_OBJ;
tcc.h+8−0
@@ -1815,10 +1815,18 @@ ST_FUNC void tcc_tcov_reset_ind(TCCState *s1); · 1814 unmodified lines
1815#define dwarf_str_section s1->dwarf_str_section1815#define dwarf_str_section s1->dwarf_str_section
1816#define dwarf_line_str_section s1->dwarf_line_str_section1816#define dwarf_line_str_section s1->dwarf_line_str_section
1817 1817
1818/* default dwarf version for "-g". use 0 to emit stab debug infos */
1818#ifndef DWARF_VERSION1819#ifndef DWARF_VERSION
1819# define DWARF_VERSION 01820# define DWARF_VERSION 0
1820#endif1821#endif
1821 1822
1823/* default dwarf version for "-gdwarf" */
1824#ifdef TCC_TARGET_MACHO
1825# define DEFAULT_DWARF_VERSION 2
1826#else
1827# define DEFAULT_DWARF_VERSION 5
1828#endif
1829
1822#if defined TCC_TARGET_PE1830#if defined TCC_TARGET_PE
1823# define R_DATA_32DW 'Z' /* fake code to avoid DLL relocs */1831# define R_DATA_32DW 'Z' /* fake code to avoid DLL relocs */
1824#elif defined TCC_TARGET_X86_641832#elif defined TCC_TARGET_X86_64

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