add option --T_dont_fork to tracee (lte-softmodem, oaisim)

The T has 2 processes: the tracee and the local tracer
if the tracee dies (segfault or whatever) the tracee
may still be running.

So there is a third process that monitors those two others
and kill everything when one dies.

The problem is that this third process has to be the parent
of the two others. That makes debugging the tracee with gdb
impossible. This new option disables the third monitor process.
This commit is contained in:
Cedric Roux
2016-06-28 12:50:58 +02:00
parent be03e9f80f
commit 3d78e5a34b
5 changed files with 31 additions and 9 deletions
+3 -1
View File
@@ -250,6 +250,7 @@ help (void)
#if T_TRACER
printf ("--T_port [port] use given port\n");
printf ("--T_nowait don't wait for tracer, start immediately\n");
printf ("--T_dont_fork to ease debugging with gdb\n");
#endif
}
@@ -1258,6 +1259,7 @@ l2l1_task (void *args_p)
#if T_TRACER
int T_wait = 1; /* by default we wait for the tracer */
int T_port = 2021; /* default port to listen to to wait for the tracer */
int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
#endif
/*------------------------------------------------------------------------------*/
@@ -1294,7 +1296,7 @@ main (int argc, char **argv)
get_simulation_options (argc, argv); //Command-line options
#if T_TRACER
T_init(T_port, T_wait);
T_init(T_port, T_wait, T_dont_fork);
#endif
// Initialize VCD LOG module
+8
View File
@@ -216,6 +216,7 @@ void get_simulation_options(int argc, char *argv[])
#if T_TRACER
LONG_OPTION_T_PORT,
LONG_OPTION_T_NOWAIT,
LONG_OPTION_T_DONT_FORK,
#endif
};
@@ -254,6 +255,7 @@ void get_simulation_options(int argc, char *argv[])
#if T_TRACER
{"T_port", required_argument, 0, LONG_OPTION_T_PORT},
{"T_nowait", no_argument, 0, LONG_OPTION_T_NOWAIT},
{"T_dont_fork", no_argument, 0, LONG_OPTION_T_DONT_FORK},
#endif
{NULL, 0, NULL, 0}
@@ -436,6 +438,12 @@ void get_simulation_options(int argc, char *argv[])
T_wait = 0;
break;
}
case LONG_OPTION_T_DONT_FORK: {
extern int T_dont_fork;
T_dont_fork = 1;
break;
}
#endif
case 'a':