2013-02-05 15:29:57 +08:00
|
|
|
// Check that we split debug output properly
|
|
|
|
//
|
2013-02-22 06:35:01 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
|
2013-02-05 15:29:57 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
|
|
|
|
//
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-ACTIONS: "-split-dwarf-file" "split-debug.dwo" "-split-dwarf-output" "split-debug.dwo"
|
2013-02-05 15:29:57 +08:00
|
|
|
|
2018-11-14 17:22:16 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -c -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-ACTIONS-SINGLE-SPLIT < %t %s
|
|
|
|
//
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-ACTIONS-SINGLE-SPLIT: "-split-dwarf-file" "split-debug.o"
|
|
|
|
// CHECK-ACTIONS-SINGLE-SPLIT-NOT: "-split-dwarf-output"
|
2018-11-14 17:22:16 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### -o %tfoo.o %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-SINGLE-SPLIT-FILENAME < %t %s
|
|
|
|
//
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-SINGLE-SPLIT-FILENAME: "-split-dwarf-file" "{{.*}}foo.o"
|
|
|
|
// CHECK-SINGLE-SPLIT-FILENAME-NOT: "-split-dwarf-output"
|
2013-02-05 15:29:57 +08:00
|
|
|
|
2013-02-22 06:35:05 +08:00
|
|
|
// RUN: %clang -target x86_64-macosx -gsplit-dwarf -c -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
|
|
|
|
//
|
|
|
|
// CHECK-NO-ACTIONS-NOT: -split-dwarf
|
2013-02-22 09:33:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -o Bad.x -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-BAD < %t %s
|
|
|
|
//
|
|
|
|
// CHECK-BAD-NOT: "Bad.dwo"
|
2013-02-23 04:12:52 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
|
|
|
|
//
|
2019-03-28 16:24:00 +08:00
|
|
|
// RUN: %clang -target x86_64-pc-freebsd12 -gsplit-dwarf -c -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
|
|
|
|
//
|
2019-03-30 01:45:40 +08:00
|
|
|
// RUN: %clang -target amdgcn-amd-amdhsa -gsplit-dwarf -c -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
|
|
|
|
//
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-OPTION: "-split-dwarf-file" "split-debug.dwo" "-split-dwarf-output" "split-debug.dwo"
|
2013-06-06 07:58:15 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-ASM < %t %s
|
|
|
|
//
|
|
|
|
// CHECK-ASM-NOT: objcopy
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -no-integrated-as -gsplit-dwarf -c -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-IAS < %t %s
|
|
|
|
//
|
|
|
|
// CHECK-IAS: objcopy
|
2015-07-31 05:42:22 +08:00
|
|
|
|
2016-08-25 07:22:36 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -fno-split-dwarf-inlining -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-GMLT-WITH-SPLIT < %t %s
|
|
|
|
//
|
|
|
|
// CHECK-GMLT-WITH-SPLIT: "-debug-info-kind=line-tables-only"
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-GMLT-WITH-SPLIT: "-split-dwarf-file"
|
2019-06-15 22:07:43 +08:00
|
|
|
// CHECK-GMLT-WITH-SPLIT: "-split-dwarf-output"
|
2016-08-25 07:22:36 +08:00
|
|
|
|
2019-12-11 04:41:07 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -g -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
|
|
|
|
//
|
2017-04-29 04:50:25 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -g -fno-split-dwarf-inlining -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
|
|
|
|
//
|
|
|
|
// CHECK-NOINLINE-WITHOUT-SPLIT: "-fno-split-dwarf-inlining"
|
Switch to using -debug-info-kind=constructor as default (from =limited)
Summary:
-debug-info-kind=constructor reduces the amount of class debug info that
is emitted; this patch switches to using this as the default.
Constructor homing emits the complete type info for a class only when the
constructor is emitted, so it is expected that there will be some classes that
are not defined in the debug info anymore because they are never constructed,
and we shouldn't need debug info for these classes.
I compared the PDB files for clang, and there are 273 class types that are defined with `=limited`
but not with `=constructor` (out of ~60,000 total class types).
We've looked at a number of the types that are no longer defined with =constructor. The vast
majority of cases are something like class A is used as a parameter in a member function of
some other class B, which is emitted. But the function that uses class A is never called, and class A
is never constructed, and therefore isn't emitted in the debug info.
Bug: https://bugs.llvm.org/show_bug.cgi?id=46537
Subscribers: aprantl, cfe-commits, lldb-commits
Tags: #clang, #lldb
Differential Revision: https://reviews.llvm.org/D79147
2020-04-30 07:21:05 +08:00
|
|
|
// CHECK-NOINLINE-WITHOUT-SPLIT: "-debug-info-kind=constructor"
|
2017-04-29 04:50:25 +08:00
|
|
|
|
2016-08-25 07:22:36 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-GMLT < %t %s
|
|
|
|
//
|
Switch to using -debug-info-kind=constructor as default (from =limited)
Summary:
-debug-info-kind=constructor reduces the amount of class debug info that
is emitted; this patch switches to using this as the default.
Constructor homing emits the complete type info for a class only when the
constructor is emitted, so it is expected that there will be some classes that
are not defined in the debug info anymore because they are never constructed,
and we shouldn't need debug info for these classes.
I compared the PDB files for clang, and there are 273 class types that are defined with `=limited`
but not with `=constructor` (out of ~60,000 total class types).
We've looked at a number of the types that are no longer defined with =constructor. The vast
majority of cases are something like class A is used as a parameter in a member function of
some other class B, which is emitted. But the function that uses class A is never called, and class A
is never constructed, and therefore isn't emitted in the debug info.
Bug: https://bugs.llvm.org/show_bug.cgi?id=46537
Subscribers: aprantl, cfe-commits, lldb-commits
Tags: #clang, #lldb
Differential Revision: https://reviews.llvm.org/D79147
2020-04-30 07:21:05 +08:00
|
|
|
// CHECK-SPLIT-WITH-GMLT: "-debug-info-kind=constructor"
|
2019-06-15 22:07:43 +08:00
|
|
|
// CHECK-SPLIT-WITH-GMLT: "-split-dwarf-output"
|
2016-08-25 07:22:36 +08:00
|
|
|
|
2016-09-01 04:54:35 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-NOINL < %t %s
|
|
|
|
//
|
Switch to using -debug-info-kind=constructor as default (from =limited)
Summary:
-debug-info-kind=constructor reduces the amount of class debug info that
is emitted; this patch switches to using this as the default.
Constructor homing emits the complete type info for a class only when the
constructor is emitted, so it is expected that there will be some classes that
are not defined in the debug info anymore because they are never constructed,
and we shouldn't need debug info for these classes.
I compared the PDB files for clang, and there are 273 class types that are defined with `=limited`
but not with `=constructor` (out of ~60,000 total class types).
We've looked at a number of the types that are no longer defined with =constructor. The vast
majority of cases are something like class A is used as a parameter in a member function of
some other class B, which is emitted. But the function that uses class A is never called, and class A
is never constructed, and therefore isn't emitted in the debug info.
Bug: https://bugs.llvm.org/show_bug.cgi?id=46537
Subscribers: aprantl, cfe-commits, lldb-commits
Tags: #clang, #lldb
Differential Revision: https://reviews.llvm.org/D79147
2020-04-30 07:21:05 +08:00
|
|
|
// CHECK-SPLIT-WITH-NOINL: "-debug-info-kind=constructor"
|
2019-06-15 22:07:43 +08:00
|
|
|
// CHECK-SPLIT-WITH-NOINL: "-split-dwarf-output"
|
2016-09-01 04:54:35 +08:00
|
|
|
|
2019-12-11 04:41:07 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -fsplit-dwarf-inlining -S -### %s 2> %t
|
2015-07-31 05:42:22 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-GMLT-OVER-SPLIT < %t %s
|
|
|
|
//
|
2016-08-25 07:22:36 +08:00
|
|
|
// CHECK-GMLT-OVER-SPLIT: "-debug-info-kind=line-tables-only"
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-GMLT-OVER-SPLIT-NOT: "-split-dwarf-file"
|
2019-06-15 22:07:43 +08:00
|
|
|
// CHECK-GMLT-OVER-SPLIT-NOT: "-split-dwarf-output"
|
2015-07-31 05:42:22 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-GMLT < %t %s
|
|
|
|
//
|
Switch to using -debug-info-kind=constructor as default (from =limited)
Summary:
-debug-info-kind=constructor reduces the amount of class debug info that
is emitted; this patch switches to using this as the default.
Constructor homing emits the complete type info for a class only when the
constructor is emitted, so it is expected that there will be some classes that
are not defined in the debug info anymore because they are never constructed,
and we shouldn't need debug info for these classes.
I compared the PDB files for clang, and there are 273 class types that are defined with `=limited`
but not with `=constructor` (out of ~60,000 total class types).
We've looked at a number of the types that are no longer defined with =constructor. The vast
majority of cases are something like class A is used as a parameter in a member function of
some other class B, which is emitted. But the function that uses class A is never called, and class A
is never constructed, and therefore isn't emitted in the debug info.
Bug: https://bugs.llvm.org/show_bug.cgi?id=46537
Subscribers: aprantl, cfe-commits, lldb-commits
Tags: #clang, #lldb
Differential Revision: https://reviews.llvm.org/D79147
2020-04-30 07:21:05 +08:00
|
|
|
// CHECK-SPLIT-OVER-GMLT: "-debug-info-kind=constructor"
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-SPLIT-OVER-GMLT: "-split-dwarf-file"
|
2019-06-15 22:07:43 +08:00
|
|
|
// CHECK-SPLIT-OVER-GMLT: "-split-dwarf-output"
|
2015-12-20 03:41:48 +08:00
|
|
|
|
2016-08-25 07:22:36 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -g0 -fno-split-dwarf-inlining -S -### %s 2> %t
|
2015-12-20 03:41:48 +08:00
|
|
|
// RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
|
|
|
|
//
|
|
|
|
// CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
|
2019-06-15 22:07:43 +08:00
|
|
|
// CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-output"
|
2016-08-25 07:22:36 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -g0 -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
|
[Driver] Simplify -g level computation and its interaction with -gsplit-dwarf
Summary:
When -gsplit-dwarf is used together with other -g options, in most cases
the computed debug info level is decided by the last -g option, with one
special case (see below). This patch drops that special case and thus
makes it easy to reason about:
// If a lower debug level -g comes after -gsplit-dwarf, in some cases
// -gsplit-dwarf is cancelled.
-gsplit-dwarf -g0 => 0
-gsplit-dwarf -gline-directives-only => DebugDirectivesOnly
-gsplit-dwarf -gmlt -fsplit-dwarf-inlining => 1
-gsplit-dwarf -gmlt -fno-split-dwarf-inlining => 1 + split
// If -gsplit-dwarf comes after -g options, with this patch, the net
// effect is 2 + split for all combinations
-g0 -gsplit-dwarf => 2 + split
-gline-directives-only -gsplit-dwarf => 2 + split
-gmlt -gsplit-dwarf -fsplit-dwarf-inlining => 2 + split
-gmlt -gsplit-dwarf -fno-split-dwarf-inlining => 1 + split (before) 2 + split (after)
The last case has been changed. In general, if the user intends to lower
debug info level, place that -g option after -gsplit-dwarf.
Some context:
In gcc, the last of -gsplit-dwarf -g0 -g1 -g2 -g3 -ggdb[0-3] -gdwarf-*
... decides the debug info level (-gsplit-dwarf -gdwarf-* have level 2).
It is a bit unfortunate that -gsplit-dwarf -gdwarf-* ... participate in
the level computation but that is the status quo.
Reviewers: dblaikie, echristo, probinson
Reviewed By: dblaikie, probinson
Subscribers: probinson, aprantl, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59923
llvm-svn: 358544
2019-04-17 09:46:27 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -g0 -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
|
2016-08-25 07:22:36 +08:00
|
|
|
//
|
|
|
|
// CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
|
2019-06-15 22:07:43 +08:00
|
|
|
// CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-output"
|
2015-12-20 03:41:48 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
|
[Driver] Simplify -g level computation and its interaction with -gsplit-dwarf
Summary:
When -gsplit-dwarf is used together with other -g options, in most cases
the computed debug info level is decided by the last -g option, with one
special case (see below). This patch drops that special case and thus
makes it easy to reason about:
// If a lower debug level -g comes after -gsplit-dwarf, in some cases
// -gsplit-dwarf is cancelled.
-gsplit-dwarf -g0 => 0
-gsplit-dwarf -gline-directives-only => DebugDirectivesOnly
-gsplit-dwarf -gmlt -fsplit-dwarf-inlining => 1
-gsplit-dwarf -gmlt -fno-split-dwarf-inlining => 1 + split
// If -gsplit-dwarf comes after -g options, with this patch, the net
// effect is 2 + split for all combinations
-g0 -gsplit-dwarf => 2 + split
-gline-directives-only -gsplit-dwarf => 2 + split
-gmlt -gsplit-dwarf -fsplit-dwarf-inlining => 2 + split
-gmlt -gsplit-dwarf -fno-split-dwarf-inlining => 1 + split (before) 2 + split (after)
The last case has been changed. In general, if the user intends to lower
debug info level, place that -g option after -gsplit-dwarf.
Some context:
In gcc, the last of -gsplit-dwarf -g0 -g1 -g2 -g3 -ggdb[0-3] -gdwarf-*
... decides the debug info level (-gsplit-dwarf -gdwarf-* have level 2).
It is a bit unfortunate that -gsplit-dwarf -gdwarf-* ... participate in
the level computation but that is the status quo.
Reviewers: dblaikie, echristo, probinson
Reviewed By: dblaikie, probinson
Subscribers: probinson, aprantl, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59923
llvm-svn: 358544
2019-04-17 09:46:27 +08:00
|
|
|
// RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf=split -S -### %s 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
|
2015-12-20 03:41:48 +08:00
|
|
|
//
|
Switch to using -debug-info-kind=constructor as default (from =limited)
Summary:
-debug-info-kind=constructor reduces the amount of class debug info that
is emitted; this patch switches to using this as the default.
Constructor homing emits the complete type info for a class only when the
constructor is emitted, so it is expected that there will be some classes that
are not defined in the debug info anymore because they are never constructed,
and we shouldn't need debug info for these classes.
I compared the PDB files for clang, and there are 273 class types that are defined with `=limited`
but not with `=constructor` (out of ~60,000 total class types).
We've looked at a number of the types that are no longer defined with =constructor. The vast
majority of cases are something like class A is used as a parameter in a member function of
some other class B, which is emitted. But the function that uses class A is never called, and class A
is never constructed, and therefore isn't emitted in the debug info.
Bug: https://bugs.llvm.org/show_bug.cgi?id=46537
Subscribers: aprantl, cfe-commits, lldb-commits
Tags: #clang, #lldb
Differential Revision: https://reviews.llvm.org/D79147
2020-04-30 07:21:05 +08:00
|
|
|
// CHECK-SPLIT-OVER-G0: "-debug-info-kind=constructor"
|
2019-06-15 23:38:51 +08:00
|
|
|
// CHECK-SPLIT-OVER-G0: "-split-dwarf-file"
|
2019-06-15 22:07:43 +08:00
|
|
|
// CHECK-SPLIT-OVER-G0: "-split-dwarf-output"
|