From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27662 invoked by alias); 18 Oct 2013 13:40:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27623 invoked by uid 89); 18 Oct 2013 13:40:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga14.intel.com Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Oct 2013 13:40:56 +0000 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 18 Oct 2013 06:40:54 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by AZSMGA002.ch.intel.com with ESMTP; 18 Oct 2013 06:40:39 -0700 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id r9IDecAL020862; Fri, 18 Oct 2013 14:40:38 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id r9IDebsR015341; Fri, 18 Oct 2013 15:40:37 +0200 Received: (from nblanc@localhost) by ulvlx001.iul.intel.com with œ id r9IDebWu015337; Fri, 18 Oct 2013 15:40:37 +0200 From: Nicolas Blanc To: tromey@redhat.com Cc: gdb-patches@sourceware.org, Nicolas Blanc Subject: [PATCH v17 0/5] remove-symbol-file & add-symbol-file. Date: Fri, 18 Oct 2013 13:40:00 -0000 Message-Id: <1382103635-15300-1-git-send-email-nicolas.blanc@intel.com> X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00557.txt.bz2 Hi Tom, Thanks for the review. I updated the patches according to: * http://sourceware.org/ml/gdb-patches/2013-10/msg00367.html (Feedback for Patch 1/5) * http://sourceware.org/ml/gdb-patches/2013-10/msg00368.html (Feedback for Patch 3/5) * http://sourceware.org/ml/gdb-patches/2013-10/msg00369.html (Feedback for Patch 5/5) One of your suggestions in Patch 3/5 was to move part of add_target_section_of_objfile from symfile.c to exec.c, which contains the similar function add_target_sections. I tried to rewrite add_target_section_of_objfile using add_target_sections. The result did not look good because one needs to allocate a temporary array of target sections for the sole purpose of calling add_target_section. So I propose to move the function to exec.c. In this way all the target-section functions are in one file. I rebased\retested the patches on x64 and x86 Linux. No regression was detected. Thanks again for looking into this. Regards, Nicolas Changes in v17 * is_addr_in_objfile (Patch 1/5): skip unmapped overlay sections. * remove_symbol_file_command (Patch 1/5): Check objfile pointers. * remove_symbol_file_command (Patch 1/5): Wrap too long line. * Commit message (Patch 3/5): new title and description. * Patch 3/5: Move add_target_section_of_objfile from symfile.c to exec.c. Update commit message accordingly. * symfile_free_objfile (Patch 3/5): Check objfile pointer. * sym-file.exp (Patch 5/5): Add curly braces to if-condition. * sym-file.exp (Patch 5/5): Use the file base name instead of the fully qualified name in tests. * sym-file.exp (Patch 5/5): Implement the test using standard_testfile and standard_output_file. Changes in v16 * Patch 4/5: Changed ELF-target detection function. The function compiles a file and checks if the object file is ELF -- see . * Patch 5/5: Call the new ELF-target detection function. Changes in v15 * symfile.c (remove_symbol_file_command): Reflect modification of struct objfile from upstream ("objf->name" => "objfile_name (objf)"). Changes in v14 * symfile.c (add_target_sections_of_objfile): Reflect modification of struct target_section from upstream. (symfile_free_objfile): Reflect modification of struct target_section from upstream. Changes in v13 * Changed "is_elf_target" to "is_known_elf_target" (Patch 4/5) according to Doug's proposal (http://sourceware.org/ml/gdb-patches/2013-07/msg00426.html). * Removed dependency to according to Mark's suggestion (http://sourceware.org/ml/gdb-patches/2013-07/msg00415.html). Changes in v12 * symfile.c (add_target_sections_of_objfile): Reflect modification of struct target_section from upstream. * gdb.base/sym-file-main.c: Move loader into a separate file as suggested and implemented the other recommendations from Doug. * gdb.base/sym-file-loader.c: New file. * gdb.base/sym-file-loader.h: New file. * lib/gdb.exp (is_elf_target): New function. Changes in v11 * Changed documentation for add-symbol-file according to feedback (Patch 3): "keeps adding to" -> "is kept in addition to". * Fixed indentation issues in test (sym-file-main.c from Patch 2). Changes in v10 * Dropped "USAGE" in "USAGE: remove-symbol-file FILENAME" according to suggestion. * Fixed comment according to suggestion: "any reference to any objfile" -> "all references to any objfile" * Added argument names to the prototype of is_addr_in_objfile according to suggestion. * Fixed indentation of "macro" loops according to feedback. * Fixed indentation issues. Changes in v9 * Patch 4: New patch (fix add-symbol-file for 'info files'). * Patch 5: New patch (test add-symbol-file and 'info files'); * sym-file.exp: Fixed test name string. Changes in 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 in 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 in 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 in 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 in v4 * gdb/symfile.c: add missing space character in output string. * gdb/doc/gdb.texinfo: add usage example. Changes in 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. Documentation for the remove-symbol-file command. Create target sections for user-added symbol files. Function is_elf_target. Test adding and removing a symbol file at runtime. gdb/NEWS | 6 + gdb/breakpoint.c | 67 ++++++- gdb/doc/gdb.texinfo | 26 ++- gdb/doc/observer.texi | 4 + gdb/exec.c | 45 ++++ gdb/exec.h | 6 + gdb/objfiles.c | 26 +++ gdb/objfiles.h | 2 + gdb/printcmd.c | 15 +- gdb/solib.c | 19 ++ gdb/symfile.c | 105 +++++++++- gdb/testsuite/gdb.base/sym-file-lib.c | 26 +++ gdb/testsuite/gdb.base/sym-file-loader.c | 353 ++++++++++++++++++++++++++++++ gdb/testsuite/gdb.base/sym-file-loader.h | 99 +++++++++ gdb/testsuite/gdb.base/sym-file-main.c | 79 +++++++ gdb/testsuite/gdb.base/sym-file.exp | 159 ++++++++++++++ gdb/testsuite/lib/gdb.exp | 39 ++++ 17 files changed, 1063 insertions(+), 13 deletions(-) create mode 100644 gdb/testsuite/gdb.base/sym-file-lib.c create mode 100644 gdb/testsuite/gdb.base/sym-file-loader.c create mode 100644 gdb/testsuite/gdb.base/sym-file-loader.h 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