[PATCH] Improve maint print symbols,psymbols,msymbols
Pedro Alves
palves@redhat.com
Fri Apr 22 13:31:00 GMT 2016
On 04/20/2016 06:30 PM, Doug Evans wrote:
> Hi.
>
> More old sandbox spring cleaning.
>
> At the time I needed this, I used it a lot.
Thanks, I think this is quite useful and helpful.
> I've since also added msymbol improvements if only for consistency sake.
> It's helpful to have more control over what to print,
> and to have the output appear on the screen
> without having to go looking for it. Bleah.
Yeah...
No real comments on the patch itself. Only a small
passer-by comment below.
> + else if (strcmp (argv[i], "-source") == 0)
> + {
> + if (argv[i + 1] == NULL)
> + error (_("Missing source file"));
> + source_arg = argv[++i];
> + }
> + else if (strcmp (argv[i], "-objfile") == 0)
> + {
> + if (argv[i + 1] == NULL)
> + error (_("Missing objfile name"));
> + objfile_arg = argv[++i];
> + }
> + else if (argv[i][0] == '-')
> + {
> + /* Future proofing: Don't allow OUTFILE to begin with "-". */
> + error (_("Unknown option: %s"), argv[i]);
> + }
We don't do this often, but it's usual for tools to
understand "--" as meaning end of "-" options. I'd
instead do:
else if (strcmp (argv[i], "--") == 0)
{
/* Explicit "--" marks end of options. */
break;
}
else if (argv[i][0] == '-')
error (_("Unknown option: %s"), argv[i]);
else
break;
So anyone wanting a filename that begins with "-" could still have it.
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list