From: Nick Roberts <nickrob@snap.net.nz>
To: "Alpár Jüttner" <alpar@cs.elte.hu>
Cc: Daniel Jacobowitz <drow@false.org>, gdb@sourceware.org
Subject: Re: (Not) debugging STL
Date: Sat, 03 Mar 2007 19:24:00 -0000 [thread overview]
Message-ID: <17897.52060.139181.614251@kahikatea.snap.net.nz> (raw)
In-Reply-To: <1172932555.4011.25.camel@mikro.mikro>
> 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
next prev parent reply other threads:[~2007-03-03 19:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-01 12:05 Alpár Jüttner
2007-03-01 12:19 ` Daniel Jacobowitz
2007-03-01 12:40 ` Alpár Jüttner
2007-03-01 12:46 ` Daniel Jacobowitz
2007-03-03 10:46 ` Alpár Jüttner
2007-03-03 11:34 ` Nick Roberts
2007-03-03 13:00 ` Alpár Jüttner
2007-03-03 14:36 ` Alpár Jüttner
2007-03-03 19:24 ` Nick Roberts [this message]
2007-03-05 12:39 ` Daniel Jacobowitz
2007-03-01 17:56 ` Brian Dessent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17897.52060.139181.614251@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=alpar@cs.elte.hu \
--cc=drow@false.org \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox