Revision 7ccfb2eb linux-user/strace.c

b/linux-user/strace.c
13 13

  
14 14
struct syscallname {
15 15
    int nr;
16
    char *name;
17
    char *format;
18
    void (*call)(struct syscallname *,
16
    const char *name;
17
    const char *format;
18
    void (*call)(const struct syscallname *,
19 19
                 abi_long, abi_long, abi_long,
20 20
                 abi_long, abi_long, abi_long);
21
    void (*result)(struct syscallname *, abi_long);
21
    void (*result)(const struct syscallname *, abi_long);
22 22
};
23 23

  
24 24
/*
......
131 131
static long newselect_arg5 = 0;
132 132

  
133 133
static void
134
print_newselect(struct syscallname *name,
134
print_newselect(const struct syscallname *name,
135 135
                abi_long arg1, abi_long arg2, abi_long arg3,
136 136
                abi_long arg4, abi_long arg5, abi_long arg6)
137 137
{
......
155 155
#endif
156 156

  
157 157
static void
158
print_semctl(struct syscallname *name,
158
print_semctl(const struct syscallname *name,
159 159
             abi_long arg1, abi_long arg2, abi_long arg3,
160 160
             abi_long arg4, abi_long arg5, abi_long arg6)
161 161
{
......
165 165
}
166 166

  
167 167
static void
168
print_execve(struct syscallname *name,
168
print_execve(const struct syscallname *name,
169 169
             abi_long arg1, abi_long arg2, abi_long arg3,
170 170
             abi_long arg4, abi_long arg5, abi_long arg6)
171 171
{
......
198 198

  
199 199
#ifdef TARGET_NR_ipc
200 200
static void
201
print_ipc(struct syscallname *name,
201
print_ipc(const struct syscallname *name,
202 202
          abi_long arg1, abi_long arg2, abi_long arg3,
203 203
          abi_long arg4, abi_long arg5, abi_long arg6)
204 204
{
205 205
    switch(arg1) {
206 206
    case IPCOP_semctl:
207
        name->name = "semctl";
208
        print_semctl(name,arg2,arg3,arg4,arg5,arg6,0);
207
        gemu_log("semctl(" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld ",", arg1, arg2);
208
        print_ipc_cmd(arg3);
209
        gemu_log(",0x" TARGET_ABI_FMT_lx ")", arg4);
209 210
        break;
210 211
    default:
211 212
        gemu_log("%s(" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld ")",
......
219 220
 */
220 221

  
221 222
static void
222
print_syscall_ret_addr(struct syscallname *name, abi_long ret)
223
print_syscall_ret_addr(const struct syscallname *name, abi_long ret)
223 224
{
224 225
if( ret == -1 ) {
225 226
        gemu_log(" = -1 errno=%d (%s)\n", errno, target_strerror(errno));
......
238 239

  
239 240
#ifdef TARGET_NR__newselect
240 241
static void
241
print_syscall_ret_newselect(struct syscallname *name, abi_long ret)
242
print_syscall_ret_newselect(const struct syscallname *name, abi_long ret)
242 243
{
243 244
    gemu_log(" = 0x" TARGET_ABI_FMT_lx " (", ret);
244 245
    print_fdset(newselect_arg1,newselect_arg2);
......
256 257
 * An array of all of the syscalls we know about
257 258
 */
258 259

  
259
static struct syscallname scnames[] = {
260
static const struct syscallname scnames[] = {
260 261
#include "strace.list"
261 262
};
262 263

  
......
271 272
              abi_long arg4, abi_long arg5, abi_long arg6)
272 273
{
273 274
    int i;
274
    char *format="%s(" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld ")";
275
    const char *format="%s(" TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld "," TARGET_ABI_FMT_ld ")";
275 276

  
276 277
    gemu_log("%d ", getpid() );
277 278

  

Also available in: Unified diff