Revision cc38b844 linux-user/main.c
b/linux-user/main.c | ||
---|---|---|
28 | 28 |
|
29 | 29 |
#define DEBUG_LOGFILE "/tmp/qemu.log" |
30 | 30 |
|
31 |
FILE *logfile = NULL; |
|
32 |
int loglevel; |
|
33 | 31 |
static const char *interp_prefix = CONFIG_QEMU_PREFIX; |
34 | 32 |
|
35 | 33 |
#ifdef __i386__ |
... | ... | |
367 | 365 |
if (argc <= 1) |
368 | 366 |
usage(); |
369 | 367 |
|
370 |
loglevel = 0; |
|
368 |
/* init debug */ |
|
369 |
cpu_set_log_filename(DEBUG_LOGFILE); |
|
370 |
|
|
371 | 371 |
optind = 1; |
372 | 372 |
for(;;) { |
373 | 373 |
if (optind >= argc) |
... | ... | |
380 | 380 |
if (!strcmp(r, "-")) { |
381 | 381 |
break; |
382 | 382 |
} else if (!strcmp(r, "d")) { |
383 |
loglevel = 1;
|
|
383 |
cpu_set_log(CPU_LOG_ALL);
|
|
384 | 384 |
} else if (!strcmp(r, "s")) { |
385 | 385 |
r = argv[optind++]; |
386 | 386 |
x86_stack_size = strtol(r, (char **)&r, 0); |
... | ... | |
407 | 407 |
usage(); |
408 | 408 |
filename = argv[optind]; |
409 | 409 |
|
410 |
/* init debug */ |
|
411 |
if (loglevel) { |
|
412 |
logfile = fopen(DEBUG_LOGFILE, "w"); |
|
413 |
if (!logfile) { |
|
414 |
perror(DEBUG_LOGFILE); |
|
415 |
_exit(1); |
|
416 |
} |
|
417 |
setvbuf(logfile, NULL, _IOLBF, 0); |
|
418 |
} |
|
419 |
|
|
420 | 410 |
/* Zero out regs */ |
421 | 411 |
memset(regs, 0, sizeof(struct target_pt_regs)); |
422 | 412 |
|
Also available in: Unified diff