https://sourceware.org/bugzilla/show_bug.cgi?id=33384
--- Comment #1 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Alan Modra <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=58a722afdb64a2c4b2ce606d4628214b890705d3 commit 58a722afdb64a2c4b2ce606d4628214b890705d3 Author: Alan Modra <[email protected]> Date: Sat Oct 4 08:44:58 2025 +0930 gdb: PR 33384 invalid disassembler option message This is the gdb part of fixing PR33384, where it is noted that an error in a disassembler option prints the rest of the comma separated option string rather than just the option in error. Removing FOR_EACH_DISASSEMBLER_OPTION seemed a good idea to me, as we then expose the strchr there which is useful in zero terminating the option, and in the case of arm-tdep.c, to replace strcspn. Also, if the option is zero terminated we don't need disassembler_options_cmp. Alternatively, you could do similarly to arm-tdep.c in disasm.c by changing the error message to use %.*s with a length found by strcspn. I rejected that smaller patch on the grounds that it makes for churn in message translation. I also prefer to see code using the standard string functions. Regression tested on x86_64-linux. Message behaviour tested on powerpc64le-linux and arm-linux-eabi. * arm-tdep.c (show_disassembly_style_sfunc): Don't use FOR_EACH_DISASSEMBLER_OPTION. Use strchr needed for loop control to size option len. * disasm.c (set_disassembler_options): Don't use FOR_EACH_DISASSEMBLER_OPTION. Overwrite comma in options with a zero. Replace disassembler_options_cmp with strcmp. -- You are receiving this mail because: You are on the CC list for the bug.
