public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug sim/14935] New: printf/swiwrite with arm-none-eabi target simulator only working on first run
@ 2012-12-09  1:11 htm at lavabit dot com
  2012-12-09  1:22 ` [Bug sim/14935] " htm at lavabit dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: htm at lavabit dot com @ 2012-12-09  1:11 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-03 10:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-09  1:11 [Bug sim/14935] New: printf/swiwrite with arm-none-eabi target simulator only working on first run htm at lavabit dot com
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

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).