3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-21 22:09:23 +01:00

test-runner: Add hwsim to --gdb support

This commit is contained in:
Denis Kenzior 2018-05-21 17:33:45 -05:00
parent 4760b31e3e
commit d13f10c111

View File

@ -708,10 +708,16 @@ static bool destroy_hwsim_radio(int radio_id)
static pid_t register_hwsim_as_trans_medium(void)
{
char *argv[2];
char *argv[16];
unsigned int idx = 0;
argv[0] = BIN_HWSIM;
argv[1] = NULL;
if (strcmp(gdb_opt, "hwsim") == 0) {
argv[idx++] = "gdb";
argv[idx++] = "--args";
}
argv[idx++] = BIN_HWSIM;
argv[idx++] = NULL;
return execute_program(argv, false, check_verbosity(BIN_HWSIM));
}
@ -2344,9 +2350,10 @@ int main(int argc, char *argv[])
case 'g':
gdb_opt = optarg;
if (!(!strcmp(gdb_opt, "iwd") ||
!strcmp(gdb_opt, "hostapd"))) {
!strcmp(gdb_opt, "hostapd") ||
!strcmp(gdb_opt, "hwsim"))) {
l_error("--gdb can only be used with iwd"
" or hostapd");
", hwsim or hostapd");
return EXIT_FAILURE;
}
break;