This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v16 1/5] New remove-symbol-file command.
- From: Tom Tromey <tromey at redhat dot com>
- To: Nicolas Blanc <nicolas dot blanc at intel dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 10 Oct 2013 14:13:05 -0600
- Subject: Re: [PATCH v16 1/5] New remove-symbol-file command.
- Authentication-results: sourceware.org; auth=none
- References: <1381148820-21890-1-git-send-email-nicolas dot blanc at intel dot com> <1381148820-21890-2-git-send-email-nicolas dot blanc at intel dot com>
>>>>> "Nicolas" == Nicolas Blanc <nicolas.blanc@intel.com> writes:
Nicolas> New command for removing symbol files added via
Nicolas> the add-symbol-file command.
Thanks. A couple of small nits.
Nicolas> +int
Nicolas> +is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile)
Nicolas> +{
Nicolas> + struct obj_section *osect;
Nicolas> +
Nicolas> + if (objfile == NULL)
Nicolas> + return 0;
Nicolas> +
Nicolas> + ALL_OBJFILE_OSECTIONS (objfile, osect)
Nicolas> + {
Nicolas> + if (obj_section_addr (osect) <= addr
Nicolas> + && addr < obj_section_endaddr (osect))
Nicolas> + return 1;
I suspect this should also check section_is_mapped first.
Nicolas> + if (args == NULL)
Nicolas> + error (_("remove-symbol-file FILENAME\nremove-symbol-file -a ADDRESS"));
We don't normally use usage-style text for errors. Instead it can just
say something along the lines of "remove-symbol-file: no symbol file
provided".
Nicolas> + if (objf->flags & OBJF_USERLOADED
Should have an explicit "!= 0" check here.
Nicolas> + && !query (_("Remove symbol table from file \"%s\"? "), objfile_name (objf)))
Line too long, should wrap.
Tom