# HG changeset patch # User Horms # Node ID fe3da025d7c08ca29dc6019fb2bd8c2b1acc18cd # Parent eb41d4dae66e9319d48c27cfa1821a096b1e6d5f libxc: Avoid ifing values covered by case in xc_ptrace() PTRACE_GETREGS, PTRACE_GETFPREGS and PTRACE_GETFPXREGS are grouped into a single case, and then with the exception of a call to FETCH_REGS(), different code is executed based on ifing the values covered by the case. The PTRACE_GETFPREGS and PTRACE_GETFPXREGS code is actually a duplicate. This patch breaks the code out to two different cases. Signed-Off-By: Horms diff -r eb41d4dae66e -r fe3da025d7c0 tools/libxc/xc_ptrace.c --- a/tools/libxc/xc_ptrace.c Fri Mar 3 11:54:50 2006 +0900 +++ b/tools/libxc/xc_ptrace.c Fri Mar 3 12:23:40 2006 +0900 @@ -374,23 +374,15 @@ xc_ptrace( break; case PTRACE_GETREGS: + FETCH_REGS(cpu); + SET_PT_REGS(pt, ctxt[cpu].user_regs); + memcpy(data, &pt, sizeof(struct gdb_regs)); + break; + case PTRACE_GETFPREGS: case PTRACE_GETFPXREGS: - FETCH_REGS(cpu); - if ( request == PTRACE_GETREGS ) - { - SET_PT_REGS(pt, ctxt[cpu].user_regs); - memcpy(data, &pt, sizeof(struct gdb_regs)); - } - else if (request == PTRACE_GETFPREGS) - { - memcpy(data, &ctxt[cpu].fpu_ctxt, sizeof(ctxt[cpu].fpu_ctxt)); - } - else /*if (request == PTRACE_GETFPXREGS)*/ - { - memcpy(data, &ctxt[cpu].fpu_ctxt, sizeof(ctxt[cpu].fpu_ctxt)); - } + memcpy(data, &ctxt[cpu].fpu_ctxt, sizeof(ctxt[cpu].fpu_ctxt)); break; case PTRACE_SETREGS: