From b6577aab8a7e97470c5ff96000f3d0dbdb2c1ee1 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Fri, 30 Jan 2015 20:49:51 -0800 Subject: Add producer string to output of info source. gdb/ChangeLog: * NEWS: "info source" command now display producer string if present. * source.c (source_info): Print producer string if present. gdb/doc/ChangeLog: * gdb.texinfo (Symbols) : Output now contains producer string if present. --- gdb/source.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gdb/source.c') diff --git a/gdb/source.c b/gdb/source.c index 574d9fa..49c9d83 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -654,12 +654,15 @@ static void source_info (char *ignore, int from_tty) { struct symtab *s = current_source_symtab; + struct compunit_symtab *cust; if (!s) { printf_filtered (_("No current source file.\n")); return; } + + cust = SYMTAB_COMPUNIT (s); printf_filtered (_("Current source file is %s\n"), s->filename); if (SYMTAB_DIRNAME (s) != NULL) printf_filtered (_("Compilation directory is %s\n"), SYMTAB_DIRNAME (s)); @@ -670,10 +673,13 @@ source_info (char *ignore, int from_tty) s->nlines == 1 ? "" : "s"); printf_filtered (_("Source language is %s.\n"), language_str (s->language)); + printf_filtered (_("Producer is %s.\n"), + COMPUNIT_PRODUCER (cust) != NULL + ? COMPUNIT_PRODUCER (cust) : _("unknown")); printf_filtered (_("Compiled with %s debugging format.\n"), - COMPUNIT_DEBUGFORMAT (SYMTAB_COMPUNIT (s))); + COMPUNIT_DEBUGFORMAT (cust)); printf_filtered (_("%s preprocessor macro info.\n"), - COMPUNIT_MACRO_TABLE (SYMTAB_COMPUNIT (s)) != NULL + COMPUNIT_MACRO_TABLE (cust) != NULL ? "Includes" : "Does not include"); } -- cgit v1.1