• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂d0e8b2cc4a9c174b45871df552632f249227d818 (tree)
時間2019-06-05 07:22:42
作者Pedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

Fix "set enum-command value junk"

With enum commands, we currently fail to notice junk after the value.

Currently:

(gdb) set print entry-values compact foo
(gdb) show print entry-values foo
Printing of function arguments at function entry is "compact".

After this fix:

(gdb) set print entry-values compact foo
Junk after item "compact": foo

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* cli/cli-setshow.c (do_set_command) <var_enum>: Detect junk
after item.

Change Summary

差異

--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -413,6 +413,10 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c)
413413 if (nmatches > 1)
414414 error (_("Ambiguous item \"%s\"."), arg);
415415
416+ const char *after = skip_spaces (arg + len);
417+ if (*after != '\0')
418+ error (_("Junk after item \"%.*s\": %s"), len, arg, after);
419+
416420 if (*(const char **) c->var != match)
417421 {
418422 *(const char **) c->var = match;