emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: better "pr" with gdb-6.4


From: Nick Roberts
Subject: Re: better "pr" with gdb-6.4
Date: Tue, 7 Feb 2006 23:48:32 +1300

 > FWIW, I find the current emacs debug macros quite hard to remember in
 > all their subtle variation.  It would be nice to have the "main"
 > macros like pr and xbacktrace work intuitively in more cases (which I
 > think includes accepting an argument for pr -- everytime I debug emacs
 > after a long absence, I seem to try giving pr an argument a few times
 > before I remember how it works... :-), and deprecate the older less
 > flexible ones (they can be kept around for people with ancient
 > versions of gdb).

Well GDB 6.3 isn't exactly ancient, but I think we can keep everybody
happy.  If we follow Kim's suggestion and modify Dan's function (GDB
doesn't understand elif):

set $argc = -1

define pr
  if ($argc == -1 || $argc == 0)
     set debug_print ($)
  else
    if ($argc == 1)
       set debug_print ($arg0)
    end
  end
end

then pr will work without an argument for pre 6.4 (as before) and with and
without an argument for 6.4.

We could also add more arguments as Dan suggests if people want, but note
that GDB's print command doesn't have this feature.

We need to keep pp for pre 6.4 (but those with 6.4 don't need to remember it!).

Nick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]