This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 0/3] remove-symbol-file
- From: Nicolas Blanc <nicolas dot blanc at intel dot com>
- To: gdb-patches at sourceware dot org, eliz at gnu dot org, yao at codesourcery dot com
- Cc: nicolas dot blanc at intel dot com
- Date: Wed, 24 Apr 2013 14:17:41 +0200
- Subject: [PATCH v2 0/3] remove-symbol-file
Many thanks Eli and Yao for your feedback. Please see the corrections below.
I would appreciate if you could forward this patch for review to poeple you
may know should look at it.
Regards,
Nicolas
* Patch 1/3 commit message:
> Change to doc/observer.texi should be moved to a separate changelog entry.
Fixed.
* Patch 1/3 gdb/breakpoint.c:
>> +/* Disable any breakpoints and tracepoints in OBJFILE upon
>> + notification of FREE_OBJFILE. Only apply to enabled breakpoints,
>
> ^^ Miss one space after period.
Fixed.
* Patch 1/3 File gdb/printcmd.c:
>> +++ b/gdb/printcmd.c
>> @@ -1928,21 +1928,22 @@ disable_display_command (char *args, int from_tty)
>> an item by re-parsing .exp_string field in the new execution
>> context. */
>>
>> static void
>> -clear_dangling_display_expressions (struct so_list *solib)
>> +clear_dangling_display_expressions (struct objfile *objfile)
>> {
>> - struct objfile *objfile = solib->objfile;
>> struct display *d;
>> + struct program_space *pspace;
>>
>> /* With no symbol file we cannot have a block or expression from it. */
>> if (objfile == NULL)
>> return;
>> + pspace = objfile->pspace;
>> if (objfile->separate_debug_objfile_backlink)
>> objfile = objfile->separate_debug_objfile_backlink;
>> - gdb_assert (objfile->pspace == solib->pspace);
>> + gdb_assert (objfile->pspace == pspace);
>>
>
> This assert is always true. Probably, we need to move this assert to the
> callers of "free_objfile" when argument is solib->objfile.
The assertion might get broken in the if-statement above where
OBJFILE is re-assigned, right? So I moved it there:
if (objfile->separate_debug_objfile_backlink)
- objfile = objfile->separate_debug_objfile_backlink;
- gdb_assert (objfile->pspace == solib->pspace);
+ {
+ objfile = objfile->separate_debug_objfile_backlink;
+ gdb_assert (objfile->pspace == pspace);
+ }
* Patch 1/3: File gdb/solib.c:
>> +/* Upon notification of FREE_OBJFILE remove any reference
>> + to any user-added file that is about to be freed. */
>
>A blank line is needed here
Fixed.
* Patch 1/3: File gdb/symfile.c:
>>
>> +
>> +/* This function removes a symbol file that was added via
>> +add-symbol-file. */
>
> A blank line is needed here.
Fixed.
* Patch 3/3 File gdb/doc/gdb.texinfo:
>> +@var{address}. @var{address} must be an expression that
> ^^
> Two spaces here.
Fixed.
* Patch 3/3 File gdb/NEWS:
>Please also add an entry in NEWS for this new command.
Added.
Nicolas Blanc (3):
Added command remove-symbol-file.
Test adding and removing a symbol file at runtime.
Documentation for the remove-symbol-file command.
gdb/NEWS | 5 +
gdb/breakpoint.c | 65 +++++-
gdb/doc/gdb.texinfo | 15 +-
gdb/doc/observer.texi | 4 +
gdb/objfiles.c | 3 +
gdb/printcmd.c | 15 +-
gdb/solib.c | 27 +++
gdb/symfile.c | 64 +++++-
gdb/testsuite/gdb.base/sym-file-lib.c | 21 ++
gdb/testsuite/gdb.base/sym-file-main.c | 369 ++++++++++++++++++++++++++++++++
gdb/testsuite/gdb.base/sym-file.exp | 155 ++++++++++++++
11 files changed, 731 insertions(+), 12 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.10.4