This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug testsuite/14531] gdb.base/dprintf.exp fails in newlibenvironment


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

--- Comment #3 from Yufeng Zhang <yufeng.zhang at arm dot com> 2012-09-18 09:49:03 UTC ---
(In reply to comment #1)
> Maybe we can do 'set dprintf-channel _impure_ptr->_stderr' for newlib??

This is not ideal solution as 'stderr' is not always _impure_ptr->_stderr in
newlib; see newlib/libc/include/stdio.h:

#ifndef _REENT_ONLY
#define stdin   (_REENT->_stdin)
#define stdout  (_REENT->_stdout)
#define stderr  (_REENT->_stderr)
#else /* _REENT_ONLY */
#define stdin   (_impure_ptr->_stdin)
#define stdout  (_impure_ptr->_stdout)
#define stderr  (_impure_ptr->_stderr)
#endif /* _REENT_ONLY */

(In reply to comment #2)
> How about adding a function like 
> 
>  FILE *get_stderr () { return stderr; }
> 
> to the test's .c file, and do 
[snip]

Sound like a good idea!

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]