projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix TCL error in gdb.python/py-format-string.exp.
[deliverable/binutils-gdb.git]
/
sim
/
common
/
syscall.c
diff --git
a/sim/common/syscall.c
b/sim/common/syscall.c
index a34207cebff46a63de40f6060f3caf951c902e2f..18128c74930c7a3ad9256fedb33ce0ea982ea60e 100644
(file)
--- a/
sim/common/syscall.c
+++ b/
sim/common/syscall.c
@@
-1,6
+1,5
@@
/* Remote target system call support.
/* Remote target system call support.
- Copyright 1997, 1998, 2002, 2004, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright 1997-2020 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
This file is part of GDB.
Contributed by Cygnus Solutions.
This file is part of GDB.
@@
-25,7
+24,7
@@
supported. */
#ifdef HAVE_CONFIG_H
supported. */
#ifdef HAVE_CONFIG_H
-#include "c
c
onfig.h"
+#include "config.h"
#endif
#include "ansidecl.h"
#include "libiberty.h"
#endif
#include "ansidecl.h"
#include "libiberty.h"
@@
-76,13
+75,9
@@
char *simulator_sysroot = "";
/* Utility of cb_syscall to fetch a path name or other string from the target.
The result is 0 for success or a host errno value. */
/* Utility of cb_syscall to fetch a path name or other string from the target.
The result is 0 for success or a host errno value. */
-static int
-get_string (cb, sc, buf, buflen, addr)
- host_callback *cb;
- CB_SYSCALL *sc;
- char *buf;
- int buflen;
- TADDR addr;
+int
+cb_get_string (host_callback *cb, CB_SYSCALL *sc, char *buf, int buflen,
+ TADDR addr)
{
char *p, *pend;
{
char *p, *pend;
@@
-93,7
+88,7
@@
get_string (cb, sc, buf, buflen, addr)
path name along with the syscall request, and cache the file
name somewhere (or otherwise tweak this as desired). */
unsigned int count = (*sc->read_mem) (cb, sc, addr, p, 1);
path name along with the syscall request, and cache the file
name somewhere (or otherwise tweak this as desired). */
unsigned int count = (*sc->read_mem) (cb, sc, addr, p, 1);
-
+
if (count != 1)
return EINVAL;
if (*p == 0)
if (count != 1)
return EINVAL;
if (*p == 0)
@@
-111,17
+106,13
@@
get_string (cb, sc, buf, buflen, addr)
If an error occurs, no buffer is left malloc'd. */
static int
If an error occurs, no buffer is left malloc'd. */
static int
-get_path (cb, sc, addr, bufp)
- host_callback *cb;
- CB_SYSCALL *sc;
- TADDR addr;
- char **bufp;
+get_path (host_callback *cb, CB_SYSCALL *sc, TADDR addr, char **bufp)
{
char *buf = xmalloc (MAX_PATH_LEN);
int result;
int sysroot_len = strlen (simulator_sysroot);
{
char *buf = xmalloc (MAX_PATH_LEN);
int result;
int sysroot_len = strlen (simulator_sysroot);
- result = get_string (cb, sc, buf, MAX_PATH_LEN - sysroot_len, addr);
+ result =
cb_
get_string (cb, sc, buf, MAX_PATH_LEN - sysroot_len, addr);
if (result == 0)
{
/* Prepend absolute paths with simulator_sysroot. Relative paths
if (result == 0)
{
/* Prepend absolute paths with simulator_sysroot. Relative paths
@@
-148,9
+139,7
@@
get_path (cb, sc, addr, bufp)
/* Perform a system call on behalf of the target. */
CB_RC
/* Perform a system call on behalf of the target. */
CB_RC
-cb_syscall (cb, sc)
- host_callback *cb;
- CB_SYSCALL *sc;
+cb_syscall (host_callback *cb, CB_SYSCALL *sc)
{
TWORD result = 0, errcode = 0;
{
TWORD result = 0, errcode = 0;
@@
-251,7
+240,7
@@
cb_syscall (cb, sc)
#endif /* wip */
case CB_SYS_exit :
#endif /* wip */
case CB_SYS_exit :
- /* Caller must catch and handle. */
+ /* Caller must catch and handle
; see sim_syscall as an example
. */
break;
case CB_SYS_open :
break;
case CB_SYS_open :
@@
-345,12
+334,12
@@
cb_syscall (cb, sc)
errcode = EINVAL;
goto FinishSyscall;
}
errcode = EINVAL;
goto FinishSyscall;
}
- if (cb_is_stdout(cb, fd))
+ if (cb_is_stdout
(cb, fd))
{
result = (int) (*cb->write_stdout) (cb, buf, bytes_read);
(*cb->flush_stdout) (cb);
}
{
result = (int) (*cb->write_stdout) (cb, buf, bytes_read);
(*cb->flush_stdout) (cb);
}
- else if (cb_is_stderr(cb, fd))
+ else if (cb_is_stderr
(cb, fd))
{
result = (int) (*cb->write_stderr) (cb, buf, bytes_read);
(*cb->flush_stderr) (cb);
{
result = (int) (*cb->write_stderr) (cb, buf, bytes_read);
(*cb->flush_stderr) (cb);
@@
-466,7
+455,7
@@
cb_syscall (cb, sc)
result = -1;
goto FinishSyscall;
}
result = -1;
goto FinishSyscall;
}
- result = (*cb->stat) (cb, path, &statbuf);
+ result = (*cb->
to_
stat) (cb, path, &statbuf);
free (path);
if (result < 0)
goto ErrorFinish;
free (path);
if (result < 0)
goto ErrorFinish;
@@
-499,7
+488,7
@@
cb_syscall (cb, sc)
struct stat statbuf;
TADDR addr = sc->arg2;
struct stat statbuf;
TADDR addr = sc->arg2;
- result = (*cb->fstat) (cb, sc->arg1, &statbuf);
+ result = (*cb->
to_
fstat) (cb, sc->arg1, &statbuf);
if (result < 0)
goto ErrorFinish;
buflen = cb_host_to_target_stat (cb, NULL, NULL);
if (result < 0)
goto ErrorFinish;
buflen = cb_host_to_target_stat (cb, NULL, NULL);
@@
-537,7
+526,7
@@
cb_syscall (cb, sc)
result = -1;
goto FinishSyscall;
}
result = -1;
goto FinishSyscall;
}
- result = (*cb->lstat) (cb, path, &statbuf);
+ result = (*cb->
to_
lstat) (cb, path, &statbuf);
free (path);
if (result < 0)
goto ErrorFinish;
free (path);
if (result < 0)
goto ErrorFinish;
This page took
0.024397 seconds
and
4
git commands to generate.