aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-12-28 22:12:17 +1030
committerAlan Modra <amodra@gmail.com>2023-12-30 12:59:23 +1030
commit3838f0bc107c48765059b3ca615f02077d961f39 (patch)
tree38dd731828954d4148d54d2455bc8b7a82ef7e0e
parent3957a3fb0e5e69b944fb3354185406a343aeb514 (diff)
downloadgdb-3838f0bc107c48765059b3ca615f02077d961f39.zip
gdb-3838f0bc107c48765059b3ca615f02077d961f39.tar.gz
gdb-3838f0bc107c48765059b3ca615f02077d961f39.tar.bz2
LoongArch: Commas inside double quotes
This adds an extra feature: Commas inside double quotes are not an arg delimiter, and thus can be part of the arg. * loongarch-coder.c (loongarch_split_args_by_comma): Commas inside quotes are not arg delimiters.
-rw-r--r--opcodes/loongarch-coder.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/opcodes/loongarch-coder.c b/opcodes/loongarch-coder.c
index b683527..c5b0950 100644
--- a/opcodes/loongarch-coder.c
+++ b/opcodes/loongarch-coder.c
@@ -18,6 +18,7 @@
along with this program; see the file COPYING3. If not,
see <http://www.gnu.org/licenses/>. */
#include "sysdep.h"
+#include <stdbool.h>
#include "opcode/loongarch.h"
int
@@ -256,9 +257,12 @@ loongarch_split_args_by_comma (char *args, const char *arg_strs[])
if (*args)
{
+ bool inquote = false;
arg_strs[num++] = args;
for (; *args; args++)
- if (*args == ',')
+ if (*args == '"')
+ inquote = !inquote;
+ else if (*args == ',' && !inquote)
{
if (MAX_ARG_NUM_PLUS_2 - 1 == num)
goto out;