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]

Re: [RFA] Symeval stuff


Andrew Cagney <ac131313@cygnus.com> writes:

>> Okay, I changed the interface to remove the varargs, since Jim
>> mentioned both he and Andrew despise them with a passion.
> 
> 
> FYI, I despise spending my time debugging something that is hard to
> keep portable, undebuggable and very unmaintable.
To each his own. However, your digs aren't really that fair.

1. It's undebuggability is gdb's fault.  I know of debuggers that
   debug varargs functions just fine.  It just requires support for
   macros.
   It's also hard to see what you mean by "undebuggable". If you mean
   you can't easily see the arguments all at once in gdb, you'd be
   right. However, since you have to extract each argument into a
   temporary variable anyway, ....
   
2. It's not unmaintainable. GCC does it for building
   trees, and as with that, doing it another way requires passing
   around info we shouldn't have to pass around.  In effect, you make
   it harder to maintain by trying to emulate it than doing it the way
   it was supposed to be.

Imagine if you had to do printf ("%s %s %d\n", a, b, c)
as
printf (&cookie, "%s %s %d\n");
printf_string (&cookie, a)
printf_string (&cookie, b)
printf_int (&cookie, c)

I would dare say this is much more unmaintainable to implement, harder
to understand, etc, than printf, and the only real way to still get
the format/type checking.

3. It's not unportable, varargs are ISO C.  I have no sympathy for
   compilers that can't be C89 compliant in 2001.  Be it gcc or whatever.


-- 
"When I was eight, I played Little League.  I was on first; I
stole third; I went straight across.  Earlier that week, I
learned that the shortest distance between two points was a
direct line.  I took advantage of that knowledge.
"-Steven Wright


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