9b158ba08e
* macrotab.h (macro_callback_fn): Add new arguments to callback. * macrotab.c (foreach_macro): Ditto. (foreach_macro_in_scope): Ditto. * macrocmd.c (print_macro_callback): New function. (info_macro_command): Move some code to print_macro_definition. (print_macro_definition): New function. (print_one_macro): Add new arguments to callback. testsuite/ * gdb.base/info-macros.c: New test sources. * gdb.base/info-macros.exp: New tests. docs/ * gdb.texinfo (Macros): Add info definitions and info macros commands. Update text and cindex entries for info macro command.
73 lines
897 B
C
73 lines
897 B
C
#ifdef DEF_MACROS
|
|
|
|
#ifdef ONE
|
|
#ifdef FOO
|
|
#undef FOO
|
|
#endif
|
|
|
|
#define FOO "hello"
|
|
#else
|
|
#undef FOO
|
|
#endif
|
|
|
|
|
|
#ifdef TWO
|
|
#ifdef FOO
|
|
#undef FOO
|
|
#endif
|
|
#define FOO " "
|
|
#endif
|
|
|
|
#ifdef THREE
|
|
#ifdef FOO
|
|
#undef FOO
|
|
#endif
|
|
|
|
#define FOO "world"
|
|
#endif
|
|
|
|
#ifdef FOUR
|
|
#ifdef FOO
|
|
#undef FOO
|
|
#endif
|
|
#define FOO(a) foo = a
|
|
#endif
|
|
#else
|
|
|
|
int main (int argc, const char **argv)
|
|
{
|
|
char *foo;
|
|
|
|
#define DEF_MACROS
|
|
#define ONE
|
|
#include "info-macros.c"
|
|
foo = FOO;
|
|
|
|
#define TWO
|
|
#include "info-macros.c"
|
|
foo = FOO;
|
|
|
|
#define THREE
|
|
#include "info-macros.c"
|
|
foo = FOO;
|
|
|
|
#undef THREE
|
|
#include "info-macros.c"
|
|
foo = FOO;
|
|
|
|
#undef TWO
|
|
#include "info-macros.c"
|
|
foo = FOO;
|
|
|
|
#undef ONE
|
|
#include "info-macros.c"
|
|
foo = (char *)0;
|
|
|
|
#define FOUR
|
|
#include "info-macros.c"
|
|
FOO ("the end.");
|
|
|
|
return 0;
|
|
}
|
|
#endif
|
|
|