-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Extend -Cdebuginfo
with new options and named aliases
#83947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,9 +71,11 @@ If not specified, debug assertions are automatically enabled only if the | |
This flag controls the generation of debug information. It takes one of the | ||
following values: | ||
|
||
* `0`: no debug info at all (the default). | ||
* `1`: line tables only. | ||
* `2`: full debug info. | ||
* `0` or `none`: no debug info at all (the default). | ||
* `line-directives-only`: line info directives only, (For the nvptx* targets this enables [profiling](https://reviews.llvm.org/D46061), but on other targets the behavior is unspecified). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, claiming unspecified behaviour in our flags unnecessarily feels… bad? Could we just say "enables profiling for some targets" (also what kind of profiling? sampling? instrumented?) for now? |
||
* `line-tables-only`: line tables only, (Generates the minimal amount of debug info for backtraces with filename/line number info, but not anything else, i.e. variable or function parameter info). | ||
* `1` or `limited`: debug info without type information. | ||
* `2` or `full`: full debug info. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good to document what all these options actually mean, in practice. Also, it would be good to define what "line info directives" and "line tables" mean, at least by giving links to relevant documents. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the new documentation I added clear enough for unfamiliar users? |
||
|
||
Note: The [`-g` flag][option-g-debug] is an alias for `-C debuginfo=2`. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Verify that the limited debuginfo option emits llvm's FullDebugInfo, but no type info. | ||
// | ||
// compile-flags: -C debuginfo=limited | ||
|
||
#[repr(C)] | ||
struct StructType { | ||
a: i64, | ||
b: i32, | ||
} | ||
|
||
extern "C" { | ||
fn creator() -> *mut StructType; | ||
fn save(p: *const StructType); | ||
} | ||
|
||
fn main() { | ||
unsafe { | ||
let value: &mut StructType = &mut *creator(); | ||
value.a = 7; | ||
save(value as *const StructType) | ||
} | ||
} | ||
|
||
// CHECK: !DICompileUnit | ||
// CHECK: emissionKind: FullDebug | ||
// CHECK: !DILocation | ||
// CHECK-NOT: !DIBasicType |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Verify that the only debuginfo generated are the line directives. | ||
// | ||
// compile-flags: -C debuginfo=line-directives-only | ||
|
||
#[repr(C)] | ||
struct StructType { | ||
a: i64, | ||
b: i32, | ||
} | ||
|
||
extern "C" { | ||
fn creator() -> *mut StructType; | ||
fn save(p: *const StructType); | ||
} | ||
|
||
fn main() { | ||
unsafe { | ||
let value: &mut StructType = &mut *creator(); | ||
value.a = 7; | ||
save(value as *const StructType) | ||
} | ||
} | ||
|
||
// CHECK: !DICompileUnit | ||
// CHECK: emissionKind: DebugDirectivesOnly | ||
// CHECK: !DILocation | ||
// CHECK-NOT: !DIBasicType |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Verify that the only debuginfo generated are the line tables. | ||
// | ||
// compile-flags: -C debuginfo=line-tables-only | ||
|
||
#[repr(C)] | ||
struct StructType { | ||
a: i64, | ||
b: i32, | ||
} | ||
|
||
extern "C" { | ||
fn creator() -> *mut StructType; | ||
fn save(p: *const StructType); | ||
} | ||
|
||
fn main() { | ||
unsafe { | ||
let value: &mut StructType = &mut *creator(); | ||
value.a = 7; | ||
save(value as *const StructType) | ||
} | ||
} | ||
|
||
// CHECK: !DICompileUnit | ||
// CHECK: emissionKind: LineTablesOnly | ||
// CHECK: !DILocation | ||
// CHECK-NOT: !DIBasicType |
Uh oh!
There was an error while loading. Please reload this page.