[[noreturn]] static void
captured_main (int argc, char *argv[])
{
- int bad_attach;
int pid;
char *arg_end;
const char *port = NULL;
char **next_arg = &argv[1];
- volatile int multi_mode = 0;
- volatile int attach = 0;
- int was_running;
+ volatile bool multi_mode = false;
+ volatile bool attach = false;
bool selftest = false;
#if GDB_SELF_TEST
std::vector<const char *> selftest_filters;
exit (0);
}
else if (strcmp (*next_arg, "--attach") == 0)
- attach = 1;
+ attach = true;
else if (strcmp (*next_arg, "--multi") == 0)
- multi_mode = 1;
+ multi_mode = true;
else if (strcmp (*next_arg, "--wrapper") == 0)
{
char **tmp;
if (port != NULL)
remote_prepare (port);
- bad_attach = 0;
+ bool bad_attach = false;
pid = 0;
/* --attach used to come after PORT, so allow it there for
compatibility. */
if (*next_arg != NULL && strcmp (*next_arg, "--attach") == 0)
{
- attach = 1;
+ attach = true;
next_arg++;
}
|| (pid = strtoul (*next_arg, &arg_end, 0)) == 0
|| *arg_end != '\0'
|| next_arg[1] != NULL))
- bad_attach = 1;
+ bad_attach = true;
if (bad_attach)
{
if (current_thread != nullptr)
current_process ()->dlls_changed = false;
+ bool was_running;
if (cs.last_status.kind () == TARGET_WAITKIND_EXITED
|| cs.last_status.kind () == TARGET_WAITKIND_SIGNALLED)
- was_running = 0;
+ was_running = false;
else
- was_running = 1;
+ was_running = true;
if (!was_running && !multi_mode)
error ("No program to debug");