aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/emul_netbsd.c
AgeCommit message (Collapse)AuthorFilesLines
2022-10-24sim/ppc: initialize a memory buffer in all casesAndrew Burgess1-1/+1
In the ppc simulator's do_fstat function, which provides the fstat call for the simulator, if the fstat is going to fail then we currently write an uninitialized buffer into the simulated target. In theory, I think this is fine, we also write the error status into the simulated target, so, given that the fstat has failed, the target shouldn't be relying on the buffer contents. However, writing an uninitialized buffer means we might leak simulator private data into the simulated target, which is probably a bad thing. Plus it probably makes life easier if something consistent, like all zeros, is written rather than random junk, which might look like a successful call (except for the error code). So, in this commit, I initialize the stat buffer to zero before it is potentially used. If the stat call is not made then the buffer will be left initialized as all zeros.
2022-01-01sim: ppc: drop natural typesMike Frysinger1-6/+6
These are almost entirely unused. For the very few places using them, replace with explicit signed types. This matches what was done in the common sim code.
2021-10-30sim: fix compilation on mingw64 [PR sim/28476]Orgad Shaneh1-2/+4
...by reordering includes. 1. sim-utils.c sim/mips/sim-main.h defines UserMode, while there is a struct in winnt.h which has UserMode as a member. So if sim-main.h is included before winnt.h, compilation fails. 2. ppc registers.h defines CR, which is used as a member in winnt.h. winsock2.h is included by sys/time.h, so sys/time.h has to be included before registers.h. Bug: https://sourceware.org/PR28476
2021-05-29sim: ppc: avoid shadowing errnoMike Frysinger1-4/+0
If the OS headers define the "errno" symbol, it breaks some of these funcs that were using "int errno" itself. Rename local vars to "err" to avoid that, and delete the old "extern int errno".
2021-05-19sim: ppc: fix Wnonnull warningTom de Vries1-2/+1
When compiling with --enable-werror and CFLAGS="-O0 -g -Wall", we run into: ... src/sim/ppc/emul_netbsd.c: In function 'do_gettimeofday': src/sim/ppc/emul_netbsd.c:770:16: error: null argument where non-null \ required (argument 1) [-Werror=nonnull] int status = gettimeofday((t_addr != 0 ? &t : NULL), ^~~~~~~~~~~~ ... Fix this by unconditionally passing &t as first argument.
2021-01-11sim: clean up C11 header includesMike Frysinger1-9/+0
Since we require C11 now, we can assume many headers exist, and clean up all of the conditional includes. It's not like any of this code actually accounted for the headers not existing, just whether we could include them. The strings.h cleanup is a little nuanced: it isn't in C11, but every use of it in the codebase will include strings.h only if string.h doesn't exist. Since we now assume the C11 string.h exists, we'll never include strings.h, so we can delete it.
2020-10-22Fix printf formatting errors where "0x" is used as a prefix for a decimal ↵Dr. David Alan Gilbert1-1/+1
number. bfd * po/es.po: Fix printf format binutils * windmc.c: Fix printf format gas * config/tc-arc.c: Fix printf format opcodes * po/es.po: Fix printf format sim * arm/armos.c: Fix printf format * ppc/emul_netbsd.c: Fix printf format -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
2020-03-12sim: ppc: netbsd: Sync signal names with NetBSD 9.99.49Kamil Rytarowski1-0/+32
sim/ppc/ChangeLog: * emul_netbsd.c (netbsd_signal_names): Sync with NetBSD 9.99.49.
2020-03-12sim: ppc: netbsd: Sync errno codes with NetBSD 9.99.49Kamil Rytarowski1-1/+18
sim/ppc/ChangeLog: * emul_netbsd.c (netbsd_error_names): Sync with NetBSD 9.99.49.
2017-02-13sim: use ARRAY_SIZE instead of ad-hoc sizeof calculationsMike Frysinger1-3/+3
2015-12-29sim: ppc: track closed state of file descriptors 0, 1, and 2.Kevin Buettner1-12/+66
This change tracks the "closed" state of file descriptors 0, 1, and 2, introducing the function fdbad() to emul_netbsd.c and emul_unix.c. Note that a function of the same name and purpose exists in sim/common/callback.c. This patch eliminates all of the "unresolved testcases" when testing GDB against the powerpc simulator. This occurs because the powerpc simulator closes, on behalf of the testcase, the file descriptors associated with stdin, stdout, and stderr. GDB still needs these descriptors to communicate with the user or, in this case, with the testing framework.
2012-12-19[sim] Update old contact info in GPL license noticesJoel Brobecker1-2/+1
sim/ChangeLog: Update old contact info in GPL license notices.
2012-12-19Update sim copyright headers from GPLv2-or-later to GPLv3-or-later.Joel Brobecker1-1/+1
gdb/sim/ChangeLog: Update the non-FSF-copyrighted files in sim to GPLv3 or later.
2011-02-14sim: punt zfree()Mike Frysinger1-4/+4
The sim keeps track of which allocations are zero-ed internally (via zalloc) and then calls a helper "zfree" function rather than "free". But this "zfree" function simply calls "free" itself. Since I can see no point in this and it is simply useless overhead, punt it. The only real change is in hw-alloc.c where we remove the zalloc_p tracking, and sim-utils.c where zfree is delete. The rest of the changes are a simple `sed` from "zfree" to "free". Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2006-02-02 * emul_netbsd.c (emul_netbsd_create): Quote file-name property.Mark Mitchell1-1/+4
* emul_unix.c (emul_unix_create): Likewise. * tree.c (libiberty.h): Include it. (tree_quote_property): New function. * tree.h (tree_quote_property): Declare.
2005-11-28 * configure.ac (USE_WIN32API): Define it.Mark Mitchell1-3/+2
* configure.in: Regenerate. * config.in: Likewise. * emul_netbsd.c (write_timezone): Guard with HAVE_GETTIMEOFDAY. * emul_unix.c (do_unix_mkdir): Handle Win32 1-argument mkdir.
2004-09-242004-09-24 Ian Lance Taylor <ian@wasabisystems.com>Andrew Cagney1-0/+8
Committed by Andrew Cagney. * configure.in: Check for sys/mount.h, sys/vfs.h, sys/statfs.h. Check for struct statfs. * emul_netbsd.c: If not HAVE_STRUCT_STATFS, #undef HAVE_FSTATFS. * configure, config.in: Regenerate.
2003-10-172003-10-16 Michael Snyder <msnyder@redhat.com>Michael Snyder1-1/+1
* emul_netbsd.c: Only a comment may follow an #endif.
2001-03-05Fixes for NetBSD 1.5. NetBSD has been renumbering/renaming itsAndrew Cagney1-0/+12
SYS_* interfaces.
2001-01-15 * emul_netbsd.c (do_open): Translate the flag parameter to theGeoffrey Keating1-1/+19
open syscall to the numbers supported by the host.
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+1439
1999-04-16Initial creation of sourceware repositoryStan Shebs1-1425/+0
1996-06-02Add Solaris and Linux emulationsMichael Meissner1-1/+1
1996-05-24More changes for GO32 canadian cross buildsMichael Meissner1-0/+1
1996-05-24More changes for GO32 canadian cross buildsMichael Meissner1-24/+84
1996-05-16Check for sys/ioctl.hMichael Meissner1-26/+33
1996-02-22Add input support; at end of user writes, call fflushMichael Meissner1-0/+2
1996-02-21Update to 1995-02-20 releaseMichael Meissner1-2/+17
1996-02-14Work with HP/UX 9.00Michael Meissner1-52/+44
1995-12-15Changes from AndrewMichael Meissner1-220/+355
1995-11-08first stage in function unit support; add new switches & latest code from andrewMichael Meissner1-1/+0
1995-11-02Use autoconf correctly; provide more stats with -IMichael Meissner1-6/+18
1995-11-01Lots of changesMichael Meissner1-0/+1202