@@ -57,11 +57,11 @@ macro_expand_command (const char *exp, int from_tty)
5757 " expression you\n"
5858 "want to expand." ));
5959
60- gdb :: unique_xmalloc_ptr < macro_scope > ms = default_macro_scope ();
60+ macro_scope ms = default_macro_scope ();
6161
62- if (ms != nullptr )
62+ if (ms . is_valid () )
6363 {
64- gdb ::unique_xmalloc_ptr < char > expanded = macro_expand (exp , * ms );
64+ gdb ::unique_xmalloc_ptr < char > expanded = macro_expand (exp , ms );
6565
6666 gdb_puts ("expands to: " );
6767 gdb_puts (expanded .get ());
@@ -85,11 +85,11 @@ macro_expand_once_command (const char *exp, int from_tty)
8585 " the expression\n"
8686 "you want to expand." ));
8787
88- gdb :: unique_xmalloc_ptr < macro_scope > ms = default_macro_scope ();
88+ macro_scope ms = default_macro_scope ();
8989
90- if (ms != nullptr )
90+ if (ms . is_valid () )
9191 {
92- gdb ::unique_xmalloc_ptr < char > expanded = macro_expand_once (exp , * ms );
92+ gdb ::unique_xmalloc_ptr < char > expanded = macro_expand_once (exp , ms );
9393
9494 gdb_puts ("expands to: " );
9595 gdb_puts (expanded .get ());
@@ -169,7 +169,6 @@ print_macro_definition (const char *name,
169169static void
170170info_macro_command (const char * args , int from_tty )
171171{
172- gdb ::unique_xmalloc_ptr < struct macro_scope > ms ;
173172 const char * name ;
174173 int show_all_macros_named = 0 ;
175174 const char * arg_start = args ;
@@ -201,15 +200,15 @@ info_macro_command (const char *args, int from_tty)
201200 " of the macro\n"
202201 "whose definition you want to see." ));
203202
204- ms = default_macro_scope ();
203+ macro_scope ms = default_macro_scope ();
205204
206- if (! ms )
205+ if (!ms . is_valid () )
207206 macro_inform_no_debuginfo ();
208207 else if (show_all_macros_named )
209- macro_for_each (ms -> file -> table , [& ] (const char * macro_name ,
210- const macro_definition * macro ,
211- macro_source_file * source ,
212- int line )
208+ macro_for_each (ms . file -> table , [& ] (const char * macro_name ,
209+ const macro_definition * macro ,
210+ macro_source_file * source ,
211+ int line )
213212 {
214213 if (strcmp (name , macro_name ) == 0 )
215214 print_macro_definition (name , macro , source , line );
@@ -218,12 +217,12 @@ info_macro_command (const char *args, int from_tty)
218217 {
219218 struct macro_definition * d ;
220219
221- d = macro_lookup_definition (ms -> file , ms -> line , name );
220+ d = macro_lookup_definition (ms . file , ms . line , name );
222221 if (d )
223222 {
224223 int line ;
225224 struct macro_source_file * file
226- = macro_definition_location (ms -> file , ms -> line , name , & line );
225+ = macro_definition_location (ms . file , ms . line , name , & line );
227226
228227 print_macro_definition (name , d , file , line );
229228 }
@@ -232,7 +231,7 @@ info_macro_command (const char *args, int from_tty)
232231 gdb_printf ("The symbol `%s' has no definition as a C/C++"
233232 " preprocessor macro\n"
234233 "at " , name );
235- show_pp_source_pos (gdb_stdout , ms -> file , ms -> line );
234+ show_pp_source_pos (gdb_stdout , ms . file , ms . line );
236235 }
237236 }
238237}
@@ -241,7 +240,7 @@ info_macro_command (const char *args, int from_tty)
241240static void
242241info_macros_command (const char * args , int from_tty )
243242{
244- gdb :: unique_xmalloc_ptr < struct macro_scope > ms ;
243+ macro_scope ms ;
245244
246245 if (args == NULL )
247246 ms = default_macro_scope ();
@@ -254,10 +253,10 @@ info_macros_command (const char *args, int from_tty)
254253 ms = sal_macro_scope (sals [0 ]);
255254 }
256255
257- if (! ms || ! ms -> file || ! ms -> file -> table )
256+ if (!ms . is_valid () || ms . file -> table == nullptr )
258257 macro_inform_no_debuginfo ();
259258 else
260- macro_for_each_in_scope (ms -> file , ms -> line , print_macro_definition );
259+ macro_for_each_in_scope (ms . file , ms . line , print_macro_definition );
261260}
262261
263262
0 commit comments