aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2015-01-30 20:49:51 -0800
committerDoug Evans <dje@google.com>2015-01-30 20:49:51 -0800
commitb6577aab8a7e97470c5ff96000f3d0dbdb2c1ee1 (patch)
tree73067456aeceee7300fd04d7210763d13547fb96 /gdb/source.c
parent230c609dce78f1db4fd3c860f0346ea4b6b46c58 (diff)
downloadgdb-b6577aab8a7e97470c5ff96000f3d0dbdb2c1ee1.zip
gdb-b6577aab8a7e97470c5ff96000f3d0dbdb2c1ee1.tar.gz
gdb-b6577aab8a7e97470c5ff96000f3d0dbdb2c1ee1.tar.bz2
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) <info source>: Output now contains producer string if present.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c10
1 files changed, 8 insertions, 2 deletions
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");
}