public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "htm at lavabit dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug sim/14935] New: printf/swiwrite with arm-none-eabi target simulator only working on first run
Date: Sun, 09 Dec 2012 01:11:00 -0000	[thread overview]
Message-ID: <bug-14935-4717@http.sourceware.org/bugzilla/> (raw)

http://sourceware.org/bugzilla/show_bug.cgi?id=14935

             Bug #: 14935
           Summary: printf/swiwrite with arm-none-eabi target simulator
                    only working on first run
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: sim
        AssignedTo: unassigned@sourceware.org
        ReportedBy: htm@lavabit.com
    Classification: Unclassified


Hello,
the printf behaviour with 7.5 and arm-none-eabi simulator is strange.
It will only show output on the very first run of the programm. Running it
again will show no further output.
To make it worse there seem to be two bugs:
SWIWrite (from armos.c) is only called after the first "run" after "load".
"run" again after a finished inferior will not call SWIWrite again.
This is workaroundable by calling "load" again, but then at the second run the
file descriptor is wrong:
armos.c:
res = sim_callback->write (sim_callback, f, local, len);
this will call through
callback.c
os_write
where a call to
fdbad
will return -1 and set error to EBADF because 
p->fd_buddy[fd] < 0

Until a real fix (the simulator seems to be not reinitialized well)
sim_callback->write_stdout (sim_callback, local, len);
can be substituted for the write.
But this still only works on the first run.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


             reply	other threads:[~2012-12-09  1:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-09  1:11 htm at lavabit dot com [this message]
2012-12-09  1:22 ` [Bug sim/14935] " htm at lavabit dot com
2014-03-14  0:46 ` vapier at gentoo dot org
2015-03-29 22:02 ` vapier at gentoo dot org
2015-03-29 22:09 ` vapier at gentoo dot org
2021-10-31 17:27 ` [Bug sim/14935] sim: arm: printf/swiwrite " vapier at gentoo dot org
2022-11-02 11:34 ` luis.machado at arm dot com
2022-11-03 10:26 ` nickc at redhat dot com

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=bug-14935-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).