RFC: GDB as a loader 1/3: silent batch mode
Andrew STUBBS
andrew.stubbs@st.com
Tue Oct 18 11:28:00 GMT 2005
Hi all,
It is my experience that GDB is often used, by means of the --batch and
--command options, as a mechanism for downloading and running programs
on remote targets (development boards and the like). This may be using a
sledgehammer to crack a nut, but given that a debugger is always
required in these cases and that creating an additional specific loader
requires effort, it is not surprising that it is used for this purpose.
I have therefore created a number of features to make this process a
little more comfortable. I have split them into separate posts so that
they may be discussed separately.
All have been regression tested for both i686-pc-linux-gnu and sh-elf an
have produced no new failures. I have not attempted to produce any new
test cases. Probably there should be some, but where and how?
Silent Batch Mode
The attached patch implements a new option --batch-silent. This does
much the same a --batch, except that it also disables gdb_stdout. This
means that all GDB outputs, other than errors, are hidden.
The advantage of this is that I no longer have to create dodgy scripts
to filter out all the various GDB messages from my program output
(Loading section ..., Process exited successfully, etc.).
Obviously this is not particularly useful with targets such as the GDB
simulator that give their output through the GDB print mechanisms.
However, all targets which print via regular stdout (as our custom
target interface here at ST does) work fine. Perhaps somebody could
suggest a solution for those targets with which it does not work.
This patch does not affect the behaviour of stderr or gdb_stderr - an
error is still an error.
Thanks
Andrew Stubbs
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: batch-silent.patch
URL: <http://sourceware.org/pipermail/gdb/attachments/20051018/60f92bb3/attachment.ksh>
More information about the Gdb
mailing list