On Fri, Sep 23, 2011 at 10:20 AM, Doug Evans wrote: > On Wed, Sep 21, 2011 at 12:33 PM, Matt Rice wrote: >> now that I think about it maybe add an optional arg to 'info macro' >> replace `info definitions MACRO' with 'info macro -all MACRO' ? > > That would be better alright. > > Also, I see calls to error() when there are no macros. > I think this shouldn't be an error. > For example, if it were done in a script it shouldn't break the script > if no macro info was found. > An informational message would be better IMO. > "info var foo" doesn't print an error on stripped binaries, for example. > > E.g. here: > >  if (! ms || ! ms->file || ! ms->file->table) >    error (_("GDB has no preprocessor macro information for that code.")); sorry for the delay, this file was internally inconsistent in this case sometimes using fputs_filtered, sometimes error, apparently i flipped the coin wrong. the attached patch changes the errors mentioned to informational messages... adds -all, and a -- argument for reasons commented. I'm not really opposed to removing the latter if it is unwanted, but pedantic hat on, these come from dwarf which strives for language independence though the macro printing functions, and the macro expansion are all currently c specific. I wasn't really planning on doing anything more to make these less c-specific but didn't want to add any more hurdles... Thanks. 2011-09-28 Matt Rice * macrocmd.c (macro_no_macro_info): New function. (macro_expand_command): Use macro_no_macro_info. (macro_expand_once_command): Ditto. (info_macro_command): Add argument processing, move info_definitions_command here. (_initialize_macrocmd): Remove info definitions command. Add arguments to info macro help text. * NEWS: Replace info definitions command with new info macro options. 2011-09-28 Matt Rice gdb.texinfo (C Preprocessor Macros): Remove info definitions. Add arguments to info macro. 2011-09-28 Matt Rice gdb.base/info-macros.exp: Make tests for info definitions test info macro. Add tests for info macro argument processing.