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] Improve load command's help text


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

commit 5cf30ebf64d3c6da961094c615a94d2f1682a478
Author: Luis Machado <lgustavo@codesourcery.com>
Date:   Mon Feb 13 07:29:30 2017 -0600

    Improve load command's help text
    
    This fairly obvious patch adds usage text to the load command's help text.
    
    Originally it did not have usage and mentioned things like FILE and OFFSET
    without explaining how those should be passed in the command.
    
    gdb/ChangeLog:
    
    2017-02-13  Luis Machado  <lgustavo@codesourcery.com>
    
    	* symfile (_initialize_symfile): Add usage text to the load command's
    	help text.
    
    gdb/doc/ChangeLog:
    
    2017-02-13  Luis Machado  <lgustavo@codesourcery.com>
    
    	* gdb.texinfo (Target Commands): Document the optional offset
    	argument for the load command.

Diff:
---
 gdb/ChangeLog       | 5 +++++
 gdb/doc/ChangeLog   | 5 +++++
 gdb/doc/gdb.texinfo | 8 ++++++--
 gdb/symfile.c       | 5 ++++-
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index dcd047a..e274191 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-13  Luis Machado  <lgustavo@codesourcery.com>
+
+	* symfile (_initialize_symfile): Add usage text to the load command's
+	help text.
+
 2017-02-10  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* utils.c (defaulted_query): Don't query on secondary UIs.
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 8acc482..7f125bc 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-13  Luis Machado  <lgustavo@codesourcery.com>
+
+	* gdb.texinfo (Target Commands): Document the optional offset
+	argument for the load command.
+
 2017-02-10  Martin Galvan  <martingalvan@sourceware.org>
 
 	PR gdb/21122
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 35804c1..f619470 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -19600,8 +19600,8 @@ Show the current status of displaying communications between
 
 @table @code
 
-@kindex load @var{filename}
-@item load @var{filename}
+@kindex load @var{filename} @var{offset}
+@item load @var{filename} @var{offset}
 @anchor{load}
 Depending on what remote debugging facilities are configured into
 @value{GDBN}, the @code{load} command may be available.  Where it exists, it
@@ -19620,6 +19620,10 @@ link the program; for other formats, like a.out, the object file format
 specifies a fixed address.
 @c FIXME! This would be a good place for an xref to the GNU linker doc.
 
+It is also possible to tell @value{GDBN} to load the executable file at a
+specific offset described by the optional argument @var{offset}.  When
+@var{offset} is provided, @var{filename} must also be provided.
+
 Depending on the remote side capabilities, @value{GDBN} may be able to
 load programs into flash memory.
 
diff --git a/gdb/symfile.c b/gdb/symfile.c
index f31075d..f2528fc 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3927,7 +3927,10 @@ that lies within the boundaries of this symbol file in memory."),
   c = add_cmd ("load", class_files, load_command, _("\
 Dynamically load FILE into the running program, and record its symbols\n\
 for access from GDB.\n\
-A load OFFSET may also be given."), &cmdlist);
+An optional load OFFSET may also be given as a literal address.\n\
+When OFFSET is provided, FILE must also be provided.  FILE can be provided\n\
+on its own.\n\
+Usage: load [FILE] [OFFSET]"), &cmdlist);
   set_cmd_completer (c, filename_completer);
 
   add_prefix_cmd ("overlay", class_support, overlay_command,


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