From: Peter Maydell <peter.maydell@linaro.org>
To: Jonas Maebe <jonas.maebe@elis.ugent.be>
Cc: Matthew Gretton-Dann <matthew.gretton-dann@arm.com>,
"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Debug ARM semihosting Thumb-2 binary
Date: Wed, 15 Feb 2012 17:33:00 -0000 [thread overview]
Message-ID: <CAFEAcA_VzLDM-M1_BAYhM-ftENbAF1OjH3gtzLwvUVs2=_XvOw@mail.gmail.com> (raw)
In-Reply-To: <30DEFAEF-E241-44A7-BB22-5CD1AED61899@elis.ugent.be>
On 9 February 2012 13:08, Jonas Maebe <jonas.maebe@elis.ugent.be> wrote:
> On 09 Feb 2012, at 02:38, Matthew Gretton-Dann wrote:
>> On Wed, Feb 08, 2012 at 10:35:48PM +0000, Jonas Maebe wrote:
>>> The full QEMU command line I use:
>>>
>>> ~/qemu/bin/qemu-system-arm -nographic -semihosting -M realview-eb -cpu
>>> cortex-m3 -kernel qsort_large -append "input_large.dat" -S -s
>>
>> I think -M realview-eb -cpu cortex-m3 is not the best way of invoking qemu
>> as it generates a system with a Cortex-M3 but without the appropriate
>> interrupt controller. Try one of the Stellaris boards instead (use
>> -machine ? to get the actual command line).
>
> I've now tried both -M lm3s811evb (Stellaris LM3S811EVB) and -M lm3s6965evb
> (Stellaris LM3S6965EVB) together with -cpu cortex-m3. Neither appears to
> work at all: there's no output (not even QEMU complaining that it can't open
> any sound devices, which it does instantaneously on startup if I choose the
> realview-eb platform).
You shouldn't expect complaints about sound devices because the
stellaris boards don't have any sound devices.
The reason this isn't working for you is that QEMU's M3 model doesn't
pay any attention to the entry point in an ELF file -- it expects that
you feed it an ELF image which starts at address zero and includes the
M profile vector table (from which it will pull the starting PC and SP).
Not supporting "load ELF file and use its entry point as the starting
PC" is arguably a missing feature (although you have to answer the question
of 'so what should the starting SP be' if you want to support this).
However since QEMU's M profile support is basically in the 'odd fixes'
state this isn't likely to be improved in the near future, so the
simplest thing is for you to just generate an ELF file of the right
shape.
Using the 'realview-eb' platform is definitely a bad idea as it only
'works' because we don't really nail down the set of supported CPUs;
at some point in the future it may actively tell you this set of
command line options are a user error :-)
>> We need to diagnose whether this is a QEmu or GDB issue.
> Yes, I'm also starting to wonder whether I might be QEMU rather than gdb
> that's going wrong...
Coincidentally, Meador Inge from CodeSourcery posted a patch to the
QEMU list today which fixes the SIGINT issue:
http://lists.gnu.org/archive/html/qemu-devel/2012-02/msg02008.html
(not yet code reviewed, but I did a quick test and it does seem to
at least avoid the SIGINT problems.)
However speed of fread over the gdb syscall interface is absolutely
dire, it seems (from 'set debug remote 1') to be doing about one
data packet a second...
-- PMM
next prev parent reply other threads:[~2012-02-15 17:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-08 10:34 Jonas Maebe
2012-02-08 17:34 ` Matthew Gretton-Dann
2012-02-08 22:36 ` Jonas Maebe
2012-02-09 1:38 ` Matthew Gretton-Dann
2012-02-09 13:08 ` Jonas Maebe
2012-02-15 17:33 ` Peter Maydell [this message]
2012-02-20 16:21 ` Peter Maydell
2012-02-23 14:12 ` Jonas Maebe
2012-02-23 14:48 ` Peter Maydell
2012-02-23 14:51 ` Jonas Maebe
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='CAFEAcA_VzLDM-M1_BAYhM-ftENbAF1OjH3gtzLwvUVs2=_XvOw@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=gdb@sourceware.org \
--cc=jonas.maebe@elis.ugent.be \
--cc=matthew.gretton-dann@arm.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