From: Vladimir Prus <ghost@cs.msu.su>
To: gdb@sources.redhat.com
Subject: Re: The 'x' command: size problem
Date: Wed, 07 Sep 2005 06:55:00 -0000 [thread overview]
Message-ID: <dfm2pe$maa$1@sea.gmane.org> (raw)
In-Reply-To: <20050906154249.GA3270@nevyn.them.org>
Daniel Jacobowitz wrote:
> On Tue, Sep 06, 2005 at 07:35:12PM +0400, Vladimir Prus wrote:
>> No, it's not very hard. But given anynchronious nature of communication
>> with gdb I'm trying to limit the number of queries to minimum, to
>> minimize the amount of data I have to keep.
>
> The MI data stream is basically synchronous. Sure, there are
> asynchronous notifications in it. But a synchronous reply always
> corresponds to the previously implemented synchronous command, doesn't
> it? It's serialized, so if you have a lot of different threads wanting
> to bang away at GDB, sure you're going to need some bookkeeping.
By "asynchronous" I mean that after sending a command to gdb, I can't just
immediately get the result. I need to return to Qt message loop and wait
why gdb reply is sent to my object. So, instead of:
unsigned size = gdb_eval("sizeof(g)");
I need to add another method to my class that will be called when result of
"sizeof" arrives, and this complicates the implementation quite a bit.
>> <aside>
>> I might be wrong, but I feel it would be much better if gdb were a
>> library that I could link to. That would eliminate most anynchonious
>> communication and won't require to keep track which gdb reply corresponds
>> to which previously issued command and where the result of the command
>> must be sent inside the frontend.
>> </aside>
>
> And it'll give you a whole new host of issues keeping up with the
> changing interface.
But at least (assuming the interface is a nice C++ one), something like:
get_memory(std::vector<char>& c)
is crystal clear, while documentation of MI's -data-read-memory output
format is very unclear. It does not document what's "table", or "next page"
is and does not link to any definitions of those terms.
> And GDB does some fairly complicated things using
> signals and wait, which can yield very surprising behavior if you're
> running it in the same context as your GUI.
Can't comment on this.
> I don't see how it would eliminate the need for asynchronous
> interfaces, either.
I'd be talking with gdb in a separate thread. At least in Qt4, it will be
possible to send requests from GUI thread to debugger controller thread,
fully transparently. For Qt3, I'd implement such
across-threads-command-queue myself.
- Volodya
next prev parent reply other threads:[~2005-09-07 6:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-06 15:04 Vladimir Prus
2005-09-06 15:25 ` Daniel Jacobowitz
2005-09-06 15:35 ` Vladimir Prus
2005-09-06 15:42 ` Daniel Jacobowitz
2005-09-07 6:55 ` Vladimir Prus [this message]
2005-09-07 13:14 ` Daniel Jacobowitz
2005-09-07 13:42 ` Vladimir Prus
2005-09-07 18:02 ` Eli Zaretskii
2005-09-06 19:17 ` Eli Zaretskii
2005-09-06 19:29 ` Daniel Jacobowitz
2005-09-07 6:40 ` Vladimir Prus
[not found] ` <17181.45190.337014.159288@gargle.gargle.HOWL>
2005-09-06 15:27 ` Vladimir Prus
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='dfm2pe$maa$1@sea.gmane.org' \
--to=ghost@cs.msu.su \
--cc=gdb@sources.redhat.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).