History

Update do_debug handling

Make options '-g -b' and '-b -g' set -g2 in both cases.

herman ten brugge committed 3 years ago

Commit 0f29dbc1 parent bf928f31 file · +2 −3Browse files

Unified · Split

libtcc.c+2−3
@@ -1972,7 +1972,7 @@ dorun: · 1971 unmodified lines
19721972 s->rt_num_callers = atoi(optarg); /* zero = default (6) */
19731973 enable_backtrace:
19741974 s->do_backtrace = 1;
1975− s->do_debug = 1;
1975+ s->do_debug = s->do_debug ? s->do_debug : 1;
19761976 s->dwarf = DWARF_VERSION;
19771977 break;
19781978 #ifdef CONFIG_TCC_BCHECK
@@ -1989,8 +1989,7 @@ dorun: · 10 unmodified lines
19891989 } else if (isnum(*optarg)) {
19901990 x = *optarg - '0';
19911991 /* -g0 = no info, -g1 = lines/functions only, -g2 = full info */
1992− if (x <= 2)
1993− s->do_debug = x;
1992+ s->do_debug = x > 2 ? 2 : x == 0 && s->do_backtrace ? 1 : x;
19941993 #ifdef TCC_TARGET_PE
19951994 } else if (0 == strcmp(".pdb", optarg)) {
19961995 s->dwarf = 5, s->do_debug |= 16;

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