File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
compiler/rustc_expand/src Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -796,9 +796,15 @@ impl SyntaxExtension {
796796 /// | external | no | if-ext | if-ext | yes |
797797 /// | yes | yes | yes | yes | yes |
798798 fn get_collapse_debuginfo ( sess : & Session , attrs : & [ ast:: Attribute ] , is_local : bool ) -> bool {
799- let collapse_debuginfo_attr = attr:: find_by_name ( attrs, sym:: collapse_debuginfo)
799+ let mut collapse_debuginfo_attr = attr:: find_by_name ( attrs, sym:: collapse_debuginfo)
800800 . map ( |v| Self :: collapse_debuginfo_by_name ( sess, v) )
801801 . unwrap_or ( CollapseMacroDebuginfo :: Unspecified ) ;
802+ if collapse_debuginfo_attr == CollapseMacroDebuginfo :: Unspecified
803+ && attr:: contains_name ( attrs, sym:: rustc_builtin_macro)
804+ {
805+ collapse_debuginfo_attr = CollapseMacroDebuginfo :: Yes ;
806+ }
807+
802808 let flag = sess. opts . unstable_opts . collapse_macro_debuginfo ;
803809 let attr = collapse_debuginfo_attr;
804810 let ext = !is_local;
Original file line number Diff line number Diff line change 1+ // ignore-lldb
2+ #![ feature( collapse_debuginfo) ]
3+
4+ use std:: fmt;
5+
6+ // Test that builtin macro debug info is collapsed.
7+ // Debug info for format_args must be #format_arg_external, not #format_arg_internal.
8+ // Because format_args is a builtin macro.
9+ // compile-flags:-g
10+
11+ // === GDB TESTS ===================================================================================
12+
13+ // gdb-command:run
14+ // gdb-command:next 2
15+ // gdb-command:frame
16+ // gdb-check:[...]#format_arg_external[...]
17+ // gdb-command:continue
18+
19+ fn main ( ) {
20+ let ret = 0 ; // #break
21+ let w = "world" . to_string ( ) ;
22+ let s = fmt:: format (
23+ format_args ! ( // #format_arg_external
24+ "hello {}" , w // #format_arg_internal
25+ )
26+ ) ; // #format_callsite
27+ println ! (
28+ "{}" ,
29+ s
30+ ) ; // #println_callsite
31+ std:: process:: exit ( ret) ;
32+ }
You can’t perform that action at this time.
0 commit comments