This is the mail archive of the gdb@sourceware.cygnus.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]

One more macro ? XMALLOC(TYPE)


>If we *do* use this, I would rather encourage its use, add a
>multiplying version (call it XMALLOC_N or some such), deprecate bare
>calls to xmalloc, and - ideally - change all the existing calls.  It's
>much more important to me to be consistent throughout the code.
>Otherwise future GDB hackers will scratch their heads and wonder
>whether they're supposed to be using xmalloc or XMALLOC.

  I want here to give my two cents about the use of macros in GDB
(of course its very special because I mainly a pascal programmer
where macros do not exist !)

  I really think that macros are one of the most difficult things
when you try to read and understand GDB source code.
Quite often, the sense of the macros, even if the name
should be quite informative, are only easy to understand to
trained GDB hackers. I spend a lot of time at searching macros
definitions accross headers !!

  Now that I know the source code better, I can most of the time
imagine what a macro does from its name, but its still
not that easy.

  My main point is that for me, macros
where the most difficult point to overcome to get into GDB
source code! But as I already said, I am a pascal programmer
and started C only to be able to change GDB !
  


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