From: Andrew Cagney <ac131313@cygnus.com>
To: Greg Watson <g.watson@computer.org>
Cc: gdb@sourceware.cygnus.com
Subject: Re: libGDB architecture
Date: Tue, 24 Aug 1999 07:25:00 -0000 [thread overview]
Message-ID: <37C2AB3D.EB325BD3@cygnus.com> (raw)
In-Reply-To: <4.2.0.58.19990824165002.0097e570@mail.dgs.monash.edu.au>
Greg Watson wrote:
> >Query/builder
> >-------------
> >
> > This is the most fundamental of the proposed changes to GDB. Up
> >until now, code that implementing a query operation returned raw text
> >(possibly annotated). As explained in the previous section this
> >operation is both un-reliable and inefficient. [I'd better add an
> >explanation].
>
> An alternative would be to expose the GDB object to the client. Is there
> any reason why this option was not chosen? Persumably the builder interface
> is going to need to know about all GDB objects anyway, and I'm going to
> need to supply routines to convert the result to my own local object.
> Actually, I'd rather have an abstract object that represents a GDB object
> handed to me by the query/event routines. Then I can just stick it on the
> (say) breakpoint list that I'm maintaining.
The problem with trying to expose the ``real GDB object'' to the client
is that, in many cases, the object in question doesn't actually exist.
What often appears to be part of an object is actually the result of
executing code. Most of the details of a stack frame, for instance, are
obtained this way.
Regarding, breakpoints. The CLI allows you to manipulate breakpoints
using GDB's internal breakpoint-number. This interface doesn't expect
to be any different. For breakpoints, the key changes are:
o the mechanism handing the client
the identifer of a created breakpoint
is tight.
o the mechanism used to obtain details
of a breakpoint is robust.
The thing I guess that needs to be emphasized is that we're not trying
to rewrite GDB into an OO wonder. Rather we're trying to adapt GDB's
well understood and working interfaces so that they can be used as part
of a larger OO framework. If we try to bite off more than that we're
probably doomed to go the same way as previous efforts :-)
> >Event notify
> >------------
> >
> > The next component is the notify mechanism. When GDB determines
> >that a significant event has occurred (memory changed, breakpoint
> >changed, target started, target stopped) it advises the target using a
> >notify call.
> >
> > For each "object" that GDB can represent symbolically, there is
> >notify mechanism that allows GDB to inform the UI that information has
> >been invalidated. The exact mechanism used depends on the type of data
> >involved.
>
> What about events like process termination or if the target receives a
> signal and there is no associated object? Or is the whole target process
> going to be an object?
This was poorly explained. There are two type of notify:
o object based (breakpoint, variable, ...)
o event based
Target started, target stopped
(it isn't that simple as a target can run as a
result of things like expression evaluation)
> In the model I use, event notification is associated with the operation not
> the object. The limitation of this that I discovered recently is that some
> operations result in multiple responses, which ideally should be handled by
> multiple callbacks. I guess the limitation with your proposal is that every
> object that might change has to carry around an event routine handle.
When the target stops, there is the notion of a stop-reason. That would
either be passed across at the time of the stop notify or available as a
query.
Why two choices, why hedge those bets? Well, if you look at the WFI (er
wait-for-inferior) code, GDB constructs the stop reason on the fly as a
text sequence. There currently is no ``why did we stop?'' function that
can be grabbed.
> >Operators (anyone got a better name)
>
> Actions?
Maybe.
> >------------------------------------
> >
> > An operator manipulates the state of GDB or the target.
> >
> > An operation is either synchronous or asynchronous. A synchronous
> >operation completes synchronously with the client. An asynchronous
> >operation, which involves execution (free running) by the target, has no
> >bounded completion time.
>
> Why distinguish synchronous and asynchronous operations? Why not make all
> operations async and let the client wait for completion if necessary
> (libGDB could provide a default "wait for last operation to complete"
> routine, or wrappers around the "sync" routines). Otherwise you mandate how
> certain operations interact with the client. e.g. suppose adding a
> breakpoint is slow to complete, then a GUI client will hang until the
> operation finishes. Also makes for a more complex interface.
It is a direct reflection of GDB's internal behavour:
o when the target has halted:
GDB can reasonably expect operations to
complete in a bounded period of time.
o when the target is running:
GDB is unable to make any guarentees
about the target's behavour
In the first case, there is a chance that the target could die part way
through an exchange. That in turn could cause GDB to hang until a timer
kicks in. It was felt that the probability of this was low and the
amount of effort needed to handle this case providing marginal return.
As a second pass (or as contributed code) this can be re-worked into a
simpler interface.
> >Output streams
> >--------------
> >
> > In addition to providing access to the target (via the query/notify
> >mechanism), GDB also has a number of out-of-band text streams:
> >
> > * output from the target (sim or remote)
> >
> > * internal traces and logs
> >
> > * CLI console output
> >
> > Each of these text streams are implemented with corresponding stream
> >object. A client can control a given stream by providing its own stream
> >implementation.
>
> The output from the target needs to be separated into stdout and stderr.
> Also a target input stream also needs to be provided. It would be neat, and
> probably necessary for a GUI, if event notification could be used on stream
> objects.
Yes, eventually. The target-output is driven by the need to support
embedded targets. Native targets currently by-pass GDB when displaying
output. I recall Jim Ingham explaining that a UNIX gui debugger should
create a separate window with PTY and start the program under that.
much thanks and keep the questions/comments comming,
Andrew
From sja@brightstareng.com Tue Aug 24 20:47:00 1999
From: Stuart Adams <sja@brightstareng.com>
To: gdb@sourceware.cygnus.com
Subject: remote thread packet formats
Date: Tue, 24 Aug 1999 20:47:00 -0000
Message-id: <37C36799.69D64353@brightstareng.com>
X-SW-Source: 1999-q3/msg00231.html
Content-length: 439
Can anyone shed more light on the remote thread packet formats ???
I want to add thread support for a custom RTOS.
For example what does GDB expect in response to the "qL" and "qP"
commands ???
-- Stuart
------------------------------------------
Stuart Adams
Bright Star Engineering Inc.
19 Enfield Drive
Andover MA 01810 USA
Tel: +1-978-470-8738
Fax: +1-978-470-8878
Email: sja@brightstareng.com
Web: http://www.brightstareng.com/
From MPetzold@ELSA.de Wed Aug 25 07:02:00 1999
From: "Michael Petzold" <MPetzold@ELSA.de>
To: gdb@sourceware.cygnus.com
Subject: sh-stub.c question
Date: Wed, 25 Aug 1999 07:02:00 -0000
Message-id: <412567D8.0050A54E.00@elsa.de>
X-SW-Source: 1999-q3/msg00232.html
Content-length: 1307
Hi,
I'm trying to get gdb remote debugging to work with a SH-2 target. The gdb
distribution contains already a sample remote stub, sh-stub.c, which I'm
currently adapting to my needs.
A problem I encountered is that the exception vector table (via exceptions())
isn't generated as is intended. The code doesn't even compile... Gcc
(egcs-2.91.57 cross NT -> sh) says for the occurences of
code_for_catch_exeception(x): "inconsistent operand constraints". By this it
means the three lines which deal with the int parameter 'n'. Is token merging
supposed to work also with assembler templates? But I think it's rather the "i"
constraint, that announces 'n' as a constant, which is irritating gcc.
I found no way to get this nice _inlining_ idea work - at last I sort of
manually unrolled the calls to code_for_catch_exeception ;-(
Are there some special compiler switches (apart from -O3) that I should employ?
Or something else?
Thanks + regards,
Michael.
____________________________________________________________
Michael Petzold Engineering Consumer Communcations
ELSA AG
Sonnenweg 11 Phone: +49-(0)241-606-0
52070 Aachen Fax: +49-(0)241-606-2099
Germany E-Mail: MPetzold@elsa.de
____________________________________________________________
next prev parent reply other threads:[~1999-08-24 7:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-08-24 0:05 Greg Watson
1999-08-24 7:25 ` Andrew Cagney [this message]
[not found] <199909161655.JAA11061@hpcll563.cup.hp.com>
1999-09-16 12:15 ` Jim Blandy
1999-09-17 18:18 ` Ovidiu Predescu
[not found] ` <37E6F077.F75C8BE8@cygnus.com>
1999-11-27 18:50 ` James Ingham
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=37C2AB3D.EB325BD3@cygnus.com \
--to=ac131313@cygnus.com \
--cc=g.watson@computer.org \
--cc=gdb@sourceware.cygnus.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