report valid values for all errors for enum variables...

Andrew Cagney cagney@gnu.org
Tue Oct 28 16:08:00 GMT 2003


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++)
                   {



More information about the Gdb-patches mailing list