mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-06-26 11:21:44 +02:00
(main): Fix command-line parsing to allow for more than one argument.
(Logical change 1.71)
This commit is contained in:
parent
3a27d1661c
commit
e6ddf4c3e0
|
@ -137,17 +137,18 @@ main (int argc, char **argv)
|
||||||
argv = args;
|
argv = args;
|
||||||
}
|
}
|
||||||
else if (argc > 1)
|
else if (argc > 1)
|
||||||
{
|
while (argv[optind][0] == '-')
|
||||||
if (strcmp (argv[optind], "-v") == 0)
|
{
|
||||||
++optind, verbose = 1;
|
if (strcmp (argv[optind], "-v") == 0)
|
||||||
if (strcmp (argv[optind], "-i") == 0)
|
++optind, verbose = 1;
|
||||||
++optind, trace_mode = INSTRUCTION; /* backtrace at each insn */
|
if (strcmp (argv[optind], "-i") == 0)
|
||||||
else if (strcmp (argv[optind], "-s") == 0)
|
++optind, trace_mode = INSTRUCTION; /* backtrace at each insn */
|
||||||
++optind, trace_mode = SYSCALL; /* backtrace at each syscall */
|
else if (strcmp (argv[optind], "-s") == 0)
|
||||||
else if (strcmp (argv[optind], "-t") == 0)
|
++optind, trace_mode = SYSCALL; /* backtrace at each syscall */
|
||||||
/* Execute until syscall(-1), then backtrace at each insn. */
|
else if (strcmp (argv[optind], "-t") == 0)
|
||||||
++optind, trace_mode = TRIGGER;
|
/* Execute until syscall(-1), then backtrace at each insn. */
|
||||||
}
|
++optind, trace_mode = TRIGGER;
|
||||||
|
}
|
||||||
|
|
||||||
target_pid = fork ();
|
target_pid = fork ();
|
||||||
if (!target_pid)
|
if (!target_pid)
|
||||||
|
|
Loading…
Reference in a new issue