This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA] Patch to a valops.c error message



Unless someone objects to this, i'd like to check it in.
Nobody understands what "Argument list of <name> mismatch with
component in the structure" means.

This just puzzles me, and I had to grep the sources to even figure out
what the hell it was talking about (IE I couldn't even figure out what
was going on when it gave this message).
I pity the poor users.

It's much clearer to just say "One of the arguments you tried to pass
to <name> could not be converted to what the function wants".

That would immediately tell me what was happening (as well as the
user), which is that it's trying to see if the arguments match in
type, and they don't.

Too bad i can't extract the argument number without adding another
parameter to 5 different functions, since that would be even *more*
helpful (We actually know when we do the type comparison which
argument we can't convert, we just have no way of passing that info
back to this routine, unless I add 1 and negate it, which would just
hurt the next person to look at the code.)


--Dan
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.21
diff -c -3 -w -B -b -p -r1.21 valops.c
*** valops.c	2000/07/15 17:40:30	1.21
--- valops.c	2000/07/16 04:42:19
*************** typecmp (staticp, t1, t2)
*** 2034,2040 ****
  	 we need to do this so you can take something like a map<const
  	 char *>, and properly access map["hello"], because the
  	 argument to [] will be a reference to a pointer to a char,
! 	 and the arrgument will be a pointer to a char.      */
        while ( TYPE_CODE(tt1) == TYPE_CODE_REF ||
  	      TYPE_CODE (tt1) == TYPE_CODE_PTR)
  	{
--- 2034,2040 ----
  	 we need to do this so you can take something like a map<const
  	 char *>, and properly access map["hello"], because the
  	 argument to [] will be a reference to a pointer to a char,
! 	 and the argument will be a pointer to a char. */
        while ( TYPE_CODE(tt1) == TYPE_CODE_REF ||
  	      TYPE_CODE (tt1) == TYPE_CODE_PTR)
  	{
*************** value_struct_elt (argp, args, name, stat
*** 2539,2545 ****
  
    if (v == (value_ptr) - 1)
      {
!       error ("Argument list of %s mismatch with component in the structure.", name);
      }
    else if (v == 0)
      {
--- 2539,2545 ----
    
    if (v == (value_ptr) - 1)
      {
!       error ("One of the arguments you tried to pass to %s could not be converted to what the function wants.", name);
      }
    else if (v == 0)
      {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]