]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add producer string to output of info source.
authorDoug Evans <dje@google.com>
Sat, 31 Jan 2015 04:49:51 +0000 (20:49 -0800)
committerDoug Evans <dje@google.com>
Sat, 31 Jan 2015 04:49:51 +0000 (20:49 -0800)
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.

gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/source.c

index 71ed80cf535f4f08237732fc31d6aa63fbd64639..58f5a7b3b7c7013ab7d7a8b65d8c1229492f8108 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-30  Doug Evans  <dje@google.com>
+
+       * NEWS: "info source" command now display producer string if present.
+       * source.c (source_info): Print producer string if present.
+
 2015-01-30  Simon Marchi  <simon.marchi@ericsson.com>
 
        * varobj.c (varobj_delete): Fix comment.
index bd85967aa5623643a90ca950aa4881559dfa4a54..2fca5f20691517814450ef58a5bdc62cf25a6a43 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,10 @@
 
 *** Changes since GDB 7.9
 
+* The "info source" command now displays the producer string if it was
+  present in the debug info.  This typically includes the compiler version
+  and may include things like its command line arguments.
+
 * Python Scripting
 
   ** gdb.Objfile objects have a new attribute "username",
index be563f5ce2cd88001154a0339426b8023bc055d2..82197b10cd46daa086c5e7b25dc4228671d16d5f 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-30  Doug Evans  <dje@google.com>
+
+       * gdb.texinfo (Symbols) <info source>: Output now contains producer
+       string if present.
+
 2015-01-27  Doug Evans  <dje@google.com>
 
        * python.texi (Objfiles In Python): Document Objfile.username.
index 277df2589a15bf7f64b1b4757fe4a85cce6f4b4d..2e58a53558539ec47e14bce7f1ad20649b8828a8 100644 (file)
@@ -16300,6 +16300,9 @@ its length, in lines,
 @item
 which programming language it is written in,
 @item
+if the debug information provides it, the program that compiled the file
+(which may include, e.g., the compiler version and command line arguments),
+@item
 whether the executable includes debugging information for that file, and
 if so, what format the information is in (e.g., STABS, Dwarf 2, etc.), and
 @item
index 574d9fa500013b21e790aa3f93634ea00bbd2214..49c9d83e11279fb4a40c880992e7c692b79083a1 100644 (file)
@@ -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");
 }
 \f