static int gdb_handle_vcont(GDBState *s, const char *p)

{

    int res, idx, signal = 0;

    char cur_action;

    char *newstates;

    unsigned long tmp;

    CPUState *cpu;

#ifdef CONFIG_USER_ONLY

    int max_cpus = 1; /* global variable max_cpus exists only in system mode */



    CPU_FOREACH(cpu) {

        max_cpus = max_cpus <= cpu->cpu_index ? cpu->cpu_index + 1 : max_cpus;

    }

#endif

    /* uninitialised CPUs stay 0 */

    newstates = g_new0(char, max_cpus);



    /* mark valid CPUs with 1 */

    CPU_FOREACH(cpu) {

        newstates[cpu->cpu_index] = 1;

    }



    /*

     * res keeps track of what error we are returning, with -ENOTSUP meaning

     * that the command is unknown or unsupported, thus returning an empty

     * packet, while -EINVAL and -ERANGE cause an E22 packet, due to invalid,

     *  or incorrect parameters passed.

     */

    res = 0;

    while (*p) {

        if (*p++ != ';') {

            res = -ENOTSUP;

            goto out;

        }



        cur_action = *p++;

        if (cur_action == 'C' || cur_action == 'S') {

            cur_action = tolower(cur_action);

            res = qemu_strtoul(p + 1, &p, 16, &tmp);

            if (res) {

                goto out;

            }

            signal = gdb_signal_to_target(tmp);

        } else if (cur_action != 'c' && cur_action != 's') {

            /* unknown/invalid/unsupported command */

            res = -ENOTSUP;

            goto out;

        }

        /* thread specification. special values: (none), -1 = all; 0 = any */

        if ((p[0] == ':' && p[1] == '-' && p[2] == '1') || (p[0] != ':')) {

            if (*p == ':') {

                p += 3;

            }

            for (idx = 0; idx < max_cpus; idx++) {

                if (newstates[idx] == 1) {

                    newstates[idx] = cur_action;

                }

            }

        } else if (*p == ':') {

            p++;

            res = qemu_strtoul(p, &p, 16, &tmp);

            if (res) {

                goto out;

            }



            /* 0 means any thread, so we pick the first valid CPU */

            cpu = tmp ? find_cpu(tmp) : first_cpu;



            /* invalid CPU/thread specified */

            if (!cpu) {

                res = -EINVAL;

                goto out;

            }



            /* only use if no previous match occourred */

            if (newstates[cpu->cpu_index] == 1) {

                newstates[cpu->cpu_index] = cur_action;

            }

        }

    }

    s->signal = signal;

    gdb_continue_partial(s, newstates);



out:

    g_free(newstates);



    return res;

}

static int gdb_handle_vcont(GDBState *s, const char *p)

{

    int res, idx, signal = 0;

    char cur_action;

    char *newstates;

    unsigned long tmp;

    CPUState *cpu;

#ifdef CONFIG_USER_ONLY

    int max_cpus = 1; 



    CPU_FOREACH(cpu) {

        max_cpus = max_cpus <= cpu->cpu_index ? cpu->cpu_index + 1 : max_cpus;

    }

#endif

    

    newstates = g_new0(char, max_cpus);



    

    CPU_FOREACH(cpu) {

        newstates[cpu->cpu_index] = 1;

    }



    











    res = 0;

    while (*p) {

        if (*p++ != ';') {

            res = -ENOTSUP;

            goto out;

        }



        cur_action = *p++;

        if (cur_action == 'C' || cur_action == 'S') {

            cur_action = tolower(cur_action);

            res = qemu_strtoul(p + 1, &p, 16, &tmp);

            if (res) {

                goto out;

            }

            signal = gdb_signal_to_target(tmp);

        } else if (cur_action != 'c' && cur_action != 's') {

            

            res = -ENOTSUP;

            goto out;

        }

        

        if ((p[0] == ':' && p[1] == '-' && p[2] == '1') || (p[0] != ':')) {

            if (*p == ':') {

                p += 3;

            }

            for (idx = 0; idx < max_cpus; idx++) {

                if (newstates[idx] == 1) {

                    newstates[idx] = cur_action;

                }

            }

        } else if (*p == ':') {

            p++;

            res = qemu_strtoul(p, &p, 16, &tmp);

            if (res) {

                goto out;

            }



            

            cpu = tmp ? find_cpu(tmp) : first_cpu;



            

            if (!cpu) {

                res = -EINVAL;

                goto out;

            }



            

            if (newstates[cpu->cpu_index] == 1) {

                newstates[cpu->cpu_index] = cur_action;

            }

        }

    }

    s->signal = signal;

    gdb_continue_partial(s, newstates);



out:

    g_free(newstates);



    return res;

}

            cur_action = tolower(cur_action);
static int FUNC_0(GDBState *VAR_0, const char *VAR_1)

{

    int VAR_2, VAR_3, VAR_4 = 0;

    char VAR_5;

    char *VAR_6;

    unsigned long VAR_7;

    CPUState *cpu;

#ifdef CONFIG_USER_ONLY

    int max_cpus = 1; 



    CPU_FOREACH(cpu) {

        max_cpus = max_cpus <= cpu->cpu_index ? cpu->cpu_index + 1 : max_cpus;

    }

#endif

    

    VAR_6 = g_new0(char, max_cpus);



    

    CPU_FOREACH(cpu) {

        VAR_6[cpu->cpu_index] = 1;

    }



    











    VAR_2 = 0;

    while (*VAR_1) {

        if (*VAR_1++ != ';') {

            VAR_2 = -ENOTSUP;

            goto out;

        }



        VAR_5 = *VAR_1++;

        if (VAR_5 == 'C' || VAR_5 == 'S') {

            VAR_5 = tolower(VAR_5);

            VAR_2 = qemu_strtoul(VAR_1 + 1, &VAR_1, 16, &VAR_7);

            if (VAR_2) {

                goto out;

            }

            VAR_4 = gdb_signal_to_target(VAR_7);

        } else if (VAR_5 != 'c' && VAR_5 != 'VAR_0') {

            

            VAR_2 = -ENOTSUP;

            goto out;

        }

        

        if ((VAR_1[0] == ':' && VAR_1[1] == '-' && VAR_1[2] == '1') || (VAR_1[0] != ':')) {

            if (*VAR_1 == ':') {

                VAR_1 += 3;

            }

            for (VAR_3 = 0; VAR_3 < max_cpus; VAR_3++) {

                if (VAR_6[VAR_3] == 1) {

                    VAR_6[VAR_3] = VAR_5;

                }

            }

        } else if (*VAR_1 == ':') {

            VAR_1++;

            VAR_2 = qemu_strtoul(VAR_1, &VAR_1, 16, &VAR_7);

            if (VAR_2) {

                goto out;

            }



            

            cpu = VAR_7 ? find_cpu(VAR_7) : first_cpu;



            

            if (!cpu) {

                VAR_2 = -EINVAL;

                goto out;

            }



            

            if (VAR_6[cpu->cpu_index] == 1) {

                VAR_6[cpu->cpu_index] = VAR_5;

            }

        }

    }

    VAR_0->VAR_4 = VAR_4;

    gdb_continue_partial(VAR_0, VAR_6);



out:

    g_free(VAR_6);



    return VAR_2;

}

static int FUNC_0(GDBState *VAR_0, const char *VAR_1)
{ int VAR_2, VAR_3, VAR_4 = 0; char VAR_5; char *VAR_6; unsigned long VAR_7; CPUState *cpu; #ifdef CONFIG_USER_ONLY
int max_cpus = 1; CPU_FOREACH(cpu) { max_cpus = max_cpus <= cpu->cpu_index ? cpu->cpu_index + 1 : max_cpus; } #endif
VAR_6 = g_new0(char, max_cpus); CPU_FOREACH(cpu) { VAR_6[cpu->cpu_index] = 1; } VAR_2 = 0; while (*VAR_1) { if (*VAR_1++ != ';') { VAR_2 = -ENOTSUP; goto out; } VAR_5 = *VAR_1++; if (VAR_5 == 'C' || VAR_5 == 'S') { VAR_5 = tolower(VAR_5); VAR_2 = qemu_strtoul(VAR_1 + 1, &VAR_1, 16, &VAR_7); if (VAR_2) { goto out; } VAR_4 = gdb_signal_to_target(VAR_7); } else if (VAR_5 != 'c' && VAR_5 != 'VAR_0') { VAR_2 = -ENOTSUP; goto out; } if ((VAR_1[0] == ':' && VAR_1[1] == '-' && VAR_1[2] == '1') || (VAR_1[0] != ':')) { if (*VAR_1 == ':') { VAR_1 += 3; } for (VAR_3 = 0; VAR_3 < max_cpus; VAR_3++) { if (VAR_6[VAR_3] == 1) { VAR_6[VAR_3] = VAR_5; } } } else if (*VAR_1 == ':') { VAR_1++; VAR_2 = qemu_strtoul(VAR_1, &VAR_1, 16, &VAR_7); if (VAR_2) { goto out; } cpu = VAR_7 ? find_cpu(VAR_7) : first_cpu; if (!cpu) { VAR_2 = -EINVAL; goto out; } if (VAR_6[cpu->cpu_index] == 1) { VAR_6[cpu->cpu_index] = VAR_5; } } } VAR_0->VAR_4 = VAR_4; gdb_continue_partial(VAR_0, VAR_6); out:
g_free(VAR_6); return VAR_2; }