mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
gdbstub: Change gdb_handlesig() argument to CPUState
Prepares for changing GDBState::c_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
9e0c5422cf
commit
db6b81d436
5 changed files with 31 additions and 25 deletions
|
@ -312,6 +312,7 @@ static void set_idt(int n, unsigned int dpl)
|
|||
|
||||
void cpu_loop(CPUX86State *env)
|
||||
{
|
||||
CPUState *cs = CPU(x86_env_get_cpu(env));
|
||||
int trapnr;
|
||||
abi_ulong pc;
|
||||
target_siginfo_t info;
|
||||
|
@ -443,7 +444,7 @@ void cpu_loop(CPUX86State *env)
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig)
|
||||
{
|
||||
info.si_signo = sig;
|
||||
|
@ -875,7 +876,7 @@ void cpu_loop(CPUARMState *env)
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig)
|
||||
{
|
||||
info.si_signo = sig;
|
||||
|
@ -966,7 +967,7 @@ void cpu_loop(CPUUniCore32State *env)
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig(env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig) {
|
||||
info.si_signo = sig;
|
||||
info.si_errno = 0;
|
||||
|
@ -1233,7 +1234,7 @@ void cpu_loop (CPUSPARCState *env)
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig)
|
||||
{
|
||||
info.si_signo = sig;
|
||||
|
@ -1764,7 +1765,7 @@ void cpu_loop(CPUPPCState *env)
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig(env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig) {
|
||||
info.si_signo = sig;
|
||||
info.si_errno = 0;
|
||||
|
@ -2315,7 +2316,7 @@ done_syscall:
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig)
|
||||
{
|
||||
info.si_signo = sig;
|
||||
|
@ -2475,7 +2476,7 @@ void cpu_loop(CPUOpenRISCState *env)
|
|||
break;
|
||||
}
|
||||
if (gdbsig) {
|
||||
gdb_handlesig(env, gdbsig);
|
||||
gdb_handlesig(cs, gdbsig);
|
||||
if (gdbsig != TARGET_SIGTRAP) {
|
||||
exit(1);
|
||||
}
|
||||
|
@ -2518,7 +2519,7 @@ void cpu_loop(CPUSH4State *env)
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig)
|
||||
{
|
||||
info.si_signo = sig;
|
||||
|
@ -2586,7 +2587,7 @@ void cpu_loop(CPUCRISState *env)
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig)
|
||||
{
|
||||
info.si_signo = sig;
|
||||
|
@ -2686,7 +2687,7 @@ void cpu_loop(CPUMBState *env)
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig)
|
||||
{
|
||||
info.si_signo = sig;
|
||||
|
@ -2779,7 +2780,7 @@ void cpu_loop(CPUM68KState *env)
|
|||
{
|
||||
int sig;
|
||||
|
||||
sig = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig)
|
||||
{
|
||||
info.si_signo = sig;
|
||||
|
@ -3006,7 +3007,7 @@ void cpu_loop(CPUAlphaState *env)
|
|||
}
|
||||
break;
|
||||
case EXCP_DEBUG:
|
||||
info.si_signo = gdb_handlesig (env, TARGET_SIGTRAP);
|
||||
info.si_signo = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (info.si_signo) {
|
||||
env->lock_addr = -1;
|
||||
info.si_errno = 0;
|
||||
|
@ -3059,7 +3060,7 @@ void cpu_loop(CPUS390XState *env)
|
|||
break;
|
||||
|
||||
case EXCP_DEBUG:
|
||||
sig = gdb_handlesig(env, TARGET_SIGTRAP);
|
||||
sig = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (sig) {
|
||||
n = TARGET_TRAP_BRKPT;
|
||||
goto do_signal_pc;
|
||||
|
@ -3541,6 +3542,7 @@ int main(int argc, char **argv, char **envp)
|
|||
struct linux_binprm bprm;
|
||||
TaskState *ts;
|
||||
CPUArchState *env;
|
||||
CPUState *cpu;
|
||||
int optind;
|
||||
char **target_environ, **wrk;
|
||||
char **target_argv;
|
||||
|
@ -3637,11 +3639,12 @@ int main(int argc, char **argv, char **envp)
|
|||
fprintf(stderr, "Unable to find CPU definition\n");
|
||||
exit(1);
|
||||
}
|
||||
cpu = ENV_GET_CPU(env);
|
||||
#if defined(TARGET_SPARC) || defined(TARGET_PPC)
|
||||
cpu_reset(ENV_GET_CPU(env));
|
||||
cpu_reset(cpu);
|
||||
#endif
|
||||
|
||||
thread_cpu = ENV_GET_CPU(env);
|
||||
thread_cpu = cpu;
|
||||
|
||||
if (getenv("QEMU_STRACE")) {
|
||||
do_strace = 1;
|
||||
|
@ -4076,7 +4079,7 @@ int main(int argc, char **argv, char **envp)
|
|||
gdbstub_port);
|
||||
exit(1);
|
||||
}
|
||||
gdb_handlesig(env, 0);
|
||||
gdb_handlesig(cpu, 0);
|
||||
}
|
||||
cpu_loop(env);
|
||||
/* never exits */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue