X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fx86-linux-nat.c;h=fa5ef300489b8e9bbb26c1dde74b8b587afc01a5;hb=b08b78e7d4bb56f395d3212eed6184ede236c760;hp=5d8f7c783f87cacf267729a11436782840d2c770;hpb=433bbbf8574a04c1639c5466fd7c320b510b9512;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c index 5d8f7c783f..fa5ef30048 100644 --- a/gdb/x86-linux-nat.c +++ b/gdb/x86-linux-nat.c @@ -21,7 +21,7 @@ #include "inferior.h" #include "elf/common.h" #include "gdb_proc_service.h" -#include +#include "nat/gdb_ptrace.h" #include #include #include @@ -162,13 +162,13 @@ x86_linux_read_description (struct target_ops *ops) if (ptrace (PTRACE_GETFPXREGS, tid, 0, (int) &fpxregs) < 0) { have_ptrace_getfpxregs = 0; - have_ptrace_getregset = 0; + have_ptrace_getregset = TRIBOOL_FALSE; return tdesc_i386_mmx_linux; } } #endif - if (have_ptrace_getregset == -1) + if (have_ptrace_getregset == TRIBOOL_UNKNOWN) { uint64_t xstateregs[(X86_XSTATE_SSE_SIZE / sizeof (uint64_t))]; struct iovec iov; @@ -179,10 +179,10 @@ x86_linux_read_description (struct target_ops *ops) /* Check if PTRACE_GETREGSET works. */ if (ptrace (PTRACE_GETREGSET, tid, (unsigned int) NT_X86_XSTATE, &iov) < 0) - have_ptrace_getregset = 0; + have_ptrace_getregset = TRIBOOL_FALSE; else { - have_ptrace_getregset = 1; + have_ptrace_getregset = TRIBOOL_TRUE; /* Get XCR0 from XSAVE extended state. */ xcr0 = xstateregs[(I386_LINUX_XSAVE_XCR0_OFFSET @@ -194,7 +194,7 @@ x86_linux_read_description (struct target_ops *ops) PTRACE_GETREGSET is not available then set xcr0_features_bits to zero so that the "no-features" descriptions are returned by the switches below. */ - if (have_ptrace_getregset) + if (have_ptrace_getregset == TRIBOOL_TRUE) xcr0_features_bits = xcr0 & X86_XSTATE_ALL_MASK; else xcr0_features_bits = 0; @@ -264,12 +264,6 @@ x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid, error (_("Could not enable branch tracing for %s: %s."), target_pid_to_str (ptid), safe_strerror (errno)); - /* Fill in the size of a pointer in bits. */ - if (tinfo->ptr_bits == 0) - { - gdbarch = target_thread_architecture (ptid); - tinfo->ptr_bits = gdbarch_ptr_bit (gdbarch); - } return tinfo; } @@ -357,6 +351,15 @@ x86_linux_get_thread_area (pid_t pid, void *addr, unsigned int *base_addr) } +/* to_always_non_stop_p implementation. */ + +static int +x86_linux_always_non_stop_p (struct target_ops *self) +{ + /* Enabling this breaks the btrace target. */ + return 0; +} + /* Create an x86 GNU/Linux target. */ struct target_ops * @@ -389,6 +392,8 @@ x86_linux_create_target (void) t->to_read_btrace = x86_linux_read_btrace; t->to_btrace_conf = x86_linux_btrace_conf; + t->to_always_non_stop_p = x86_linux_always_non_stop_p; + return t; }