[PATCH v16 1/5] New remove-symbol-file command.
Tom Tromey
tromey@redhat.com
Thu Oct 10 20:13:00 GMT 2013
>>>>> "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
More information about the Gdb-patches
mailing list