Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nicolas Blanc <nicolas.blanc@intel.com>
To: gdb-patches@sourceware.org, Hafiz_Abid@mentor.com,
	palves@redhat.com,        tromey@redhat.com, eliz@gnu.org,
	yao@codesourcery.com,        lgustavo@codesourcery.com,
	dje@google.com
Cc: nicolas.blanc@intel.com
Subject: [patch v9 0/5]  remove-symbol-file
Date: Tue, 18 Jun 2013 14:47:00 -0000	[thread overview]
Message-ID: <1371566833-4713-1-git-send-email-nicolas.blanc@intel.com> (raw)

Hello,

As discussed in http://sourceware.org/ml/gdb-patches/2013-05/msg01029.html,
GDB has no command for listing files that have been added via add-symbol-file.

In particular, 'info files' does not list the sections of user-added symbol files
because add-symbol-file does not update the target sections (current_target_sections).
Patch 4 implements this.

So technically, Patch 4 is a fix for add-symbol-file. I send it, for convinience,
as new revision for the remove-symbol-file command because Patch 4 depends on Patch 1,
which is not checked in, and this issue was raised in its context.

Patch 1 and 3 are identical in V8 and V9. Patch 2 is also identical to the previous
version except for a minor typo in symbol-file.exp that I corrected.

I hope you will find this fix for add-symbol-file useful. Please let me know if
you like this patch series.

Thank you,

Nicolas

Changes between v8 abd v9:

* Patch 4: New patch.
* Patch 5: New patch.

* sym-file.exp: Fixed test name string.

Changes between v7 and v8:

* sym-file.exp: Call gdb_get_line_number with ${libfile}.c intead of $libsrc.

* Fixed typo in commit message for Patch 2/3.

Changes between v6 and v7:

* Changed disable_breakpoints_in_freed_objfile () from feedback:
  Use is_breakpoint () and is_tracepoint ().
  Add call to mark_breakpoint_location_modified ().

* Changed command description according to suggestion.

* Changed commit log message for new functions according to feedback.

* Fixed nits in gdb/solib.c and testsuite/gdb.base/sym-file.exp.

Changes between v5 and v6:

* Changed syntax of the command according to feedback:
    remove-symbol-file FILENAME
    remove-symbol-file -a ADDRESS

* Updated the documentation for the new syntax.

* Updated the test for the new syntax.

* Added check to only remove objfiles from the current program space.

Changes between v4 and v5:

* The address parameter can now be any address mapping into one of the sections
  of the file to remove. This is more flexible and more judicious because the symbol
  file may have no text section, as pointed out in some reviews.

* Move is_addr_in_objfile from breakpoint.c to objfiles.c. This new function
  is now used in both symfile.c and breakpoint.c.

* is_addr_in_objfile returns now 0 if OBJFILE is NULL.

* Updated the documentation to reflect the command change.

* Removed double blank lines.

* Reworded the log entries in the commit messages, as suggested.

* The test was simplified using prepare_for_testing, as suggested.

Changes between v3 and v4:

* gdb/symfile.c: add missing space character in output string.

* gdb/doc/gdb.texinfo: add usage example.

Changes between v2 and v3:

* gdb/breakpoints.c (disable_breakpoints_in_freed_objfile):
  Changed name of disable_breakpoints_in_free_objfile to disable_breakpoints_in_freed_objfile.
  Call observer_breakpoint_modified at most one time per breakpoint.

* gdb/objfiles.h (struct objfile): Add comment for low_addr.

* gdb/solib.c (remove_user_added_objfile): Don't check OBJF_SHARED anymore to avoid leaving dangling pointers.

* gdb/symfile.c (add_symbol_file_command): Parse and evaluate the address parameter only once.

* gdb/symfile.c (remove_symbol_file_command): Don't use gdb_buildargv anymore. Ask the user for confirmation before removing a file.

* gdb/doc/gdb.texinfo: The parameter of the command is now referred to as "the address of the text section".

* gdb/NEWS: Move the entry for remove-symbol-file to "Changes since GDB 7.6". The address parameter is now referred to as "the beginning of the text section".

* Fixed letter case of variables in comments.

* Fixed indentation typos.


Nicolas Blanc (5):
  New remove-symbol-file command.
  Test adding and removing a symbol file at runtime.
  Documentation for the remove-symbol-file command.
  'add-symbol-file' should update the current target sections.
  Test 'info files' after 'add-symbol-file' and 'remove-symbol-file'.

 gdb/NEWS                               |    6 +
 gdb/breakpoint.c                       |   67 ++++++-
 gdb/doc/gdb.texinfo                    |   26 ++-
 gdb/doc/observer.texi                  |    4 +
 gdb/objfiles.c                         |   23 ++
 gdb/objfiles.h                         |    2 +
 gdb/printcmd.c                         |   15 +-
 gdb/solib.c                            |   22 ++
 gdb/symfile.c                          |  153 +++++++++++++-
 gdb/testsuite/gdb.base/sym-file-lib.c  |   19 ++
 gdb/testsuite/gdb.base/sym-file-main.c |  365 ++++++++++++++++++++++++++++++++
 gdb/testsuite/gdb.base/sym-file.exp    |  155 ++++++++++++++
 12 files changed, 844 insertions(+), 13 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/sym-file-lib.c
 create mode 100644 gdb/testsuite/gdb.base/sym-file-main.c
 create mode 100644 gdb/testsuite/gdb.base/sym-file.exp

-- 
1.7.6.5


             reply	other threads:[~2013-06-18 14:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 14:47 Nicolas Blanc [this message]
2013-06-18 14:47 ` [patch v9 1/5] New remove-symbol-file command Nicolas Blanc
2013-06-18 17:26   ` Luis Machado
2013-06-19 12:23     ` Blanc, Nicolas
2013-06-19 13:07       ` Luis Machado
2013-06-18 14:47 ` [patch v9 2/5] Test adding and removing a symbol file at runtime Nicolas Blanc
2013-06-18 17:28   ` Luis Machado
2013-06-18 14:47 ` [patch v9 5/5] Test 'info files' after 'add-symbol-file' and 'remove-symbol-file' Nicolas Blanc
2013-06-18 17:53   ` Luis Machado
2013-06-18 14:47 ` [patch v9 3/5] Documentation for the remove-symbol-file command Nicolas Blanc
2013-06-18 16:23   ` Eli Zaretskii
2013-06-18 15:04 ` [patch v9 4/5] 'add-symbol-file' should update the current target sections Nicolas Blanc
2013-06-18 17:29   ` Luis Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371566833-4713-1-git-send-email-nicolas.blanc@intel.com \
    --to=nicolas.blanc@intel.com \
    --cc=Hafiz_Abid@mentor.com \
    --cc=dje@google.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=lgustavo@codesourcery.com \
    --cc=palves@redhat.com \
    --cc=tromey@redhat.com \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox