This is the mail archive of the gdb@sourceware.org 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]
Other format: [Raw text]

Re: (Not) debugging STL


 > It seems to me that variable 'gud-last-last-frame' contains the name of
 > current source file. Thus I tried the following.
 > 
 > (defun my-step ()
 >   (interactive)
 >   (gud-step 1)
 >   (while (string-match "/usr/.*" (car gud-last-last-frame))
 >     (gud-step 1)))
 > 
 > However this did not work, I think because gud-step doesn't seem to
 > update the variable gud-last-last-frame. At least the following function
 > always prints the same string twice.
 > 
 > (defun m-step ()
 >  (interactive)
 >  (print (car gud-last-last-frame))
 >  (gud-step 1)
 >  (print (car gud-last-last-frame))
 > )

It probably doesn't print a different string because the interaction between
Emacs and GDB is asynchronous i.e. Emacs

Prints gud-last-last-frame
Sends "step" to GDB
Prints gud-last-last-frame
Receives GDB output
Updates gud-last-last-frame

so gud-last-last-frame is printed for the second time *before* it is
updated.

 > What to do then? Shall I use something else instead of gud-step?

If you look at the file that I have written, gdb-ui.el in Emacs 22, you'll
see it uses queues to solve this kind of problem i.e waits for the output of
one command before sending the next.

However I must point out it uses annotations which are an extension to the
fullname marker that I referred to earlier, and these are being deprecated
in favour of a new interface called GDB/MI.  All this is described in the
manual.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


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