From: Bart Veer <bartv@ecoscentric.com>
To: Stan Shebs <stan@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: add file I/O support when debugging an embedded target via jtag
Date: Sun, 31 Aug 2008 15:39:00 -0000 [thread overview]
Message-ID: <pnod39ry8d.fsf@delenn.bartv.net> (raw)
In-Reply-To: <48BAAC44.4000002@codesourcery.com> (message from Stan Shebs on Sun, 31 Aug 2008 07:35:48 -0700)
>>>>> "Stan" == Stan Shebs <stan@codesourcery.com> writes:
Stan> Bart Veer wrote:
>> Following on from
>> http://sourceware.org/ml/gdb-patches/2008-08/msg00315.html, I have not
>> heard anything about the code in the last two weeks. Do you know if
>> anybody is looking at it? Also, if there is a likelihood that the
>> patch will be accepted then I should probably get started on the
>> assignment paperwork.
Stan> To be honest, I looked at it but didn't understand why all
Stan> this stuff seemed necessary. If this is not for the remote
Stan> protocol, then what is it for? A target supported by GDB, or
Stan> something else?
The rationale was given in
http://sourceware.org/ml/gdb/2008-07/msg00045.html
The remote protocol file I/O extensions work fine when gdb interacts
with target-side stub code over a serial line or ethernet, since
target-side code can send the requests to gdb.
Now consider a typical setup involving jtag. gdb does not access the
jtag unit directly. Instead it uses the remote protocol to interact
with a server of some kind over TCP, and the server controls the jtag
unit. Examples of this include OpenOCD, m68k-elf-sprite,
nios2-gdb-server, ... Some are open source, others are proprietary.
Target-side code has no portable way of requesting that the jtag
server sends a file I/O request to gdb. Some of these servers may
implement their own file I/O mechanisms, but that does not give a
portable solution.
The purpose of the patch is to provide portable support for file I/O
independent from the jtag server being used. In fact it should also
work with targets that do not involve the remote protocol, e.g.
simulators, although I confess I have not tried that.
Stan> The addition of another stratum raises alarm bells with me,
Stan> because the stratums are not as orthogonal as they should
Stan> be, and I wouldn't be surprised if other configurations were
Stan> broken by this.
I did not see any alternative. The h/w debug file I/O code has to
sit at a higher stratum than process_stratum (e.g. remote_ops) since
it has to override that stratum's resume/wait/load operations. It
should also sit at a level lower than thread_stratum. The file I/O
support is independent from the specific embedded OS or run-time being
used, but thread support for each OS will not be quite so portable. I
did consider putting the code into remote.c and thus explicitly tying
it to the remote protocol and remote_ops, but that would make it
impossible to use the functionality with e.g. a simulator.
For existing configurations there really should not be any change in
behaviour since there won't be any target ops at
process_override_stratum. The numerical value associated with
thread_stratum will have incremented by one, but I would hope that
there is no code anywhere assuming that thread_stratum==4.
Stan> Also, how will everybody regression-test this (read: "make
Stan> check") to know that other changes haven't broken this code?
A fair point. I am not really familiar with the capabilities of the
gdb testsuite, but the obvious problem here is on the target-side. In
due course the h/w debug file I/O support may be integrated to a
greater or lesser extent into various embedded OS's, so you cannot
just take the example code in doc/hwdebug-example.c and turn it into a
testcase: you would have both the OS and the testcase trying to define
_gdb_hwdebug_breakpoint.
Bart
next prev parent reply other threads:[~2008-08-31 15:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-12 16:34 Bart Veer
2008-08-12 19:08 ` Eli Zaretskii
2008-08-31 11:42 ` Bart Veer
2008-08-31 14:36 ` Stan Shebs
2008-08-31 15:39 ` Bart Veer [this message]
2008-09-23 10:15 ` Bart Veer
2008-09-23 12:03 ` Doug Evans
2008-09-24 21:21 ` Bart Veer
2008-09-25 17:05 ` Doug Evans
2008-09-25 20:27 ` Bart Veer
2008-09-25 22:20 ` Daniel Jacobowitz
2008-10-01 18:39 ` Bart Veer
2008-10-01 21:10 ` Daniel Jacobowitz
2008-10-09 17:11 ` Bart Veer
2008-10-17 11:59 ` John Dallaway
2008-09-01 3:07 ` Eli Zaretskii
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=pnod39ry8d.fsf@delenn.bartv.net \
--to=bartv@ecoscentric.com \
--cc=gdb-patches@sourceware.org \
--cc=stan@codesourcery.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