From 59af5a88e9309673554e36ababbe6bb6df1e2887 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Tue, 2 Jul 2019 14:26:39 +0200 Subject: [PATCH] =?utf8?q?Avoid=20letting=20=E2=80=9C-gdwarf*=E2=80=9D=20f?= =?utf8?q?orce=20=E2=80=9Crun=5Fsecond=5Fcpp=20=3D=20true=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes #394. --- src/ccache.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ccache.c b/src/ccache.c index aa7ca96f8..0e264d7a4 100644 --- a/src/ccache.c +++ b/src/ccache.c @@ -2732,6 +2732,13 @@ cc_process_args(struct args *args, struct args **preprocessor_args, if (str_startswith(argv[i], "-g")) { args_add(stripped_args, argv[i]); + if (str_startswith(argv[i], "-gdwarf")) { + // Selection of DWARF format (-gdwarf or -gdwarf-) enables + // debug info on level 2. + generating_debuginfo = true; + continue; + } + char last_char = argv[i][strlen(argv[i]) - 1]; if (last_char == '0') { // "-g0", "-ggdb0" or similar: All debug information disabled. -- 2.47.2