This is the mail archive of the
mailing list for the binutils project.
RE: [PATCH] [ARC] Fix handling of cpu=... disassembler option value
> > As a result this macro can be used to improve existing code in
> > arc-dis.c, however it doesn't address the issue that this particular
> > patch is trying to fix.
> Hmm, the description you originally send only talked about parsing the
> option value incorrectly. If you change arc-dis.c:parse_cpu_option to use
> disassembler_options_cmp for comparing options, then I think it should fix
> the original issue you described? Guess the issue then would be that
> disassembler_options_cmp is case sensitive. I wonder whether
> architectures really want to be different here..
Right, this will change behaviour for ARC cpu= options - they now will be case
sensitive. Which should be ok, most options that I see in other places
(including arc-dis.c) are case sensitive, so making this case-insensitive was
not a good decision on my side to start with, I think.
> Actually I find it a bug that this code even prints to stderr directly in the first
> place. That'll be the wrong thing to do when this code is being called by GDB
> -- a gdb Python script can disassemble with output redirected to a string, for
I don't see where it could print right now though - according to the name and
comment disassemble_info->memory_error_func is used for cases when there is an
error reading from memory, not an error parsing options. To address this
problem, I think a new field should be added to disassembler_info - either a
function that prints to desired error stream or pointer to error stream itself.