This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Add producer string to output of info source.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b6577aab8a7e97470c5ff96000f3d0dbdb2c1ee1

commit b6577aab8a7e97470c5ff96000f3d0dbdb2c1ee1
Author: Doug Evans <dje@google.com>
Date:   Fri Jan 30 20:49:51 2015 -0800

    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.

Diff:
---
 gdb/ChangeLog       |  5 +++++
 gdb/NEWS            |  4 ++++
 gdb/doc/ChangeLog   |  5 +++++
 gdb/doc/gdb.texinfo |  3 +++
 gdb/source.c        | 10 ++++++++--
 5 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 71ed80c..58f5a7b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/NEWS b/gdb/NEWS
index bd85967..2fca5f2 100644
--- 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",
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index be563f5..82197b1 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -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.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 277df25..2e58a53 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -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
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");
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]