projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
quit_force: Replace TRY_CATCH wrapper macros
[deliverable/binutils-gdb.git]
/
gdb
/
x86-linux-nat.c
diff --git
a/gdb/x86-linux-nat.c
b/gdb/x86-linux-nat.c
index b2141ebcd335b2fffde7041ee3501031dff61daa..26ae0b834fdbfab9a270bb77faf97782003ca737 100644
(file)
--- a/
gdb/x86-linux-nat.c
+++ b/
gdb/x86-linux-nat.c
@@
-1,6
+1,6
@@
/* Native-dependent code for GNU/Linux x86 (i386 and x86-64).
/* Native-dependent code for GNU/Linux x86 (i386 and x86-64).
- Copyright (C) 1999-201
4
Free Software Foundation, Inc.
+ Copyright (C) 1999-201
5
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-51,6
+51,16
@@
struct arch_lwp_info
int have_ptrace_getregset = -1;
\f
int have_ptrace_getregset = -1;
\f
+/* Return the offset of REGNUM in the u_debugreg field of struct
+ user. */
+
+static int
+u_debugreg_offset (int regnum)
+{
+ return (offsetof (struct user, u_debugreg)
+ + sizeof (((struct user *) 0)->u_debugreg[0]) * regnum);
+}
+
/* Support for debug registers. */
/* Get debug register REGNUM value from only the one LWP of PTID. */
/* Support for debug registers. */
/* Get debug register REGNUM value from only the one LWP of PTID. */
@@
-65,8
+75,8
@@
x86_linux_dr_get (ptid_t ptid, int regnum)
tid = ptid_get_lwp (ptid);
errno = 0;
tid = ptid_get_lwp (ptid);
errno = 0;
- value = ptrace (PTRACE_PEEKUSER, tid,
- offsetof (struct user, u_debugreg[regnum]), 0);
+ value = ptrace (PTRACE_PEEKUSER, tid,
u_debugreg_offset (regnum), 0);
+
if (errno != 0)
perror_with_name (_("Couldn't read debug register"));
if (errno != 0)
perror_with_name (_("Couldn't read debug register"));
@@
-84,8
+94,7
@@
x86_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
tid = ptid_get_lwp (ptid);
errno = 0;
tid = ptid_get_lwp (ptid);
errno = 0;
- ptrace (PTRACE_POKEUSER, tid,
- offsetof (struct user, u_debugreg[regnum]), value);
+ ptrace (PTRACE_POKEUSER, tid, u_debugreg_offset (regnum), value);
if (errno != 0)
perror_with_name (_("Couldn't write debug register"));
}
if (errno != 0)
perror_with_name (_("Couldn't write debug register"));
}
@@
-214,7
+223,7
@@
x86_linux_prepare_to_resume (struct lwp_info *lwp)
lwp->arch_private->debug_registers_changed = 0;
}
lwp->arch_private->debug_registers_changed = 0;
}
- if (clear_status || lwp->stop
ped_by_watchpoint
)
+ if (clear_status || lwp->stop
_reason == TARGET_STOPPED_BY_WATCHPOINT
)
x86_linux_dr_set (lwp->ptid, DR_STATUS, 0);
}
x86_linux_dr_set (lwp->ptid, DR_STATUS, 0);
}
@@
-427,22
+436,25
@@
x86_linux_read_description (struct target_ops *ops)
/* Enable branch tracing. */
static struct btrace_target_info *
/* Enable branch tracing. */
static struct btrace_target_info *
-x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid)
+x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid,
+ const struct btrace_config *conf)
{
struct btrace_target_info *tinfo;
struct gdbarch *gdbarch;
errno = 0;
{
struct btrace_target_info *tinfo;
struct gdbarch *gdbarch;
errno = 0;
- tinfo = linux_enable_btrace (ptid);
+ tinfo = linux_enable_btrace (ptid
, conf
);
if (tinfo == NULL)
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 == NULL)
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. */
- gdbarch = target_thread_architecture (ptid);
- tinfo->ptr_bits = gdbarch_ptr_bit (gdbarch);
-
+ if (tinfo->ptr_bits == 0)
+ {
+ gdbarch = target_thread_architecture (ptid);
+ tinfo->ptr_bits = gdbarch_ptr_bit (gdbarch);
+ }
return tinfo;
}
return tinfo;
}
@@
-470,12
+482,22
@@
x86_linux_teardown_btrace (struct target_ops *self,
static enum btrace_error
x86_linux_read_btrace (struct target_ops *self,
static enum btrace_error
x86_linux_read_btrace (struct target_ops *self,
-
VEC (btrace_block_s) *
*data,
+
struct btrace_data
*data,
struct btrace_target_info *btinfo,
enum btrace_read_type type)
{
return linux_read_btrace (data, btinfo, type);
}
struct btrace_target_info *btinfo,
enum btrace_read_type type)
{
return linux_read_btrace (data, btinfo, type);
}
+
+/* See to_btrace_conf in target.h. */
+
+static const struct btrace_config *
+x86_linux_btrace_conf (struct target_ops *self,
+ const struct btrace_target_info *btinfo)
+{
+ return linux_btrace_conf (btinfo);
+}
+
\f
/* Helper for ps_get_thread_area. Sets BASE_ADDR to a pointer to
\f
/* Helper for ps_get_thread_area. Sets BASE_ADDR to a pointer to
@@
-550,6
+572,7
@@
x86_linux_create_target (void)
t->to_disable_btrace = x86_linux_disable_btrace;
t->to_teardown_btrace = x86_linux_teardown_btrace;
t->to_read_btrace = x86_linux_read_btrace;
t->to_disable_btrace = x86_linux_disable_btrace;
t->to_teardown_btrace = x86_linux_teardown_btrace;
t->to_read_btrace = x86_linux_read_btrace;
+ t->to_btrace_conf = x86_linux_btrace_conf;
return t;
}
return t;
}
This page took
0.025245 seconds
and
4
git commands to generate.