From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12384 invoked by alias); 9 Dec 2012 01:11:52 -0000 Received: (qmail 12357 invoked by uid 48); 9 Dec 2012 01:11:51 -0000 From: "htm at lavabit dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: sim X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: htm at lavabit dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2012-q4/txt/msg00359.txt.bz2 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.