/* Implementation of the "info macros" command. */ static void info_macros_command (const char *args, int from_tty) { gdb::unique_xmalloc_ptr<struct macro_scope> ms; if (args == NULL) ms = default_macro_scope (); else { std::vector<symtab_and_line> sals = decode_line_with_current_source (args, 0); if (!sals.empty ()) ms = sal_macro_scope (sals[0]); } if (! ms || ! ms->file || ! ms->file->table) macro_inform_no_debuginfo (); else macro_for_each_in_scope (ms->file, ms->line, print_macro_definition); }
/* Implementation of the "info macros" command. */ static void info_macros_command (char *args, int from_tty) { struct macro_scope *ms = NULL; struct cleanup *cleanup_chain = make_cleanup (free_current_contents, &ms); if (args == NULL) ms = default_macro_scope (); else { struct symtabs_and_lines sals = decode_line_with_current_source (args, 0); if (sals.nelts) ms = sal_macro_scope (sals.sals[0]); } if (! ms || ! ms->file || ! ms->file->table) macro_inform_no_debuginfo (); else macro_for_each_in_scope (ms->file, ms->line, print_macro_callback, NULL); do_cleanups (cleanup_chain); }