This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: report valid values for all errors for enum variables...
Jim,
Since you're looking a that code, can you please tweak it so that it
uses a mem_file instead of the 1024 byte stack buffer.
Is there a test case?
Andrew
+ /* If there was an error, print an informative
+ error message. */
char msg[1024];
! if (arg == NULL)
! strcpy (msg, "Requires an argument.");
! else if (nmatches <= 0)
! sprintf (msg, "Undefined item: \"%s\".", arg);
! else if (nmatches > 1)
! sprintf (msg, "Ambiguous item \"%s\".", arg);
! strcat (msg, " Valid values are ");
for (i = 0; c->enums[i]; i++)
{