help-gnu-emacs
[Top][All Lists]
Advanced

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

How to debug strange value changes of a variable?


From: Marcin Borkowski
Subject: How to debug strange value changes of a variable?
Date: Wed, 31 Dec 2014 02:03:54 +0100

Hi there,

a few weeks ago I sent an email to the mu/mu4e mailing list, but got no
answer.  (Not that I blame anyone, my problem might just be hard...)
I'd like to debug the issue myself, but have no clue how.

Here's (more or less) what happens: I define a buffer-local variable (by
make-variable-buffer-local), and define its default value (by
setq-default).  Then, I have a function which updates its value.  (Use
case: I have a few signatures, and I want to be able to cycle between
them.  The variable is the number of the signature, which is incremented
with each cycle, and returns to zero when it reaches the length of the
list of signatures.)

Now somehow mu4e (I know it is to blame, since in stock message-mode,
with emacs -Q, and without mu4e, everything works as expected!) messes
around with the value of this variable /after the first increment/ (or
so it seems: it looks like that after some initialization - including
incf'ing that variable from its inital value of -1 - it somehow comes
back to its original (default) value).  I'd like to check what function
and when changes its value.  Is there any way to use Edebug (or anything
else) for this?

I know about edebug-set-global-break-condition, but this doesn't help a
lot: it can stop when the variable has some value, but does not tell me
/which/ piece of code changed it.

I also know about edebug-backtrace, but I'm not sure whether it will
help me.  (I tried it, but it didn't seem to help.)

(A similar question is to find out what calls such-and-such function.
This one seems easier: I can just instrument the said function and then
press `d' in Edebug to see the backtrace.  Am I right?)

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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