aboutsummaryrefslogtreecommitdiff
path: root/gdb/ChangeLog
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2015-08-11 11:05:58 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2015-09-09 10:35:35 +0200
commit0568462bbf0f666d5bf9f720e16147da71eec46a (patch)
tree59f573e2faef6955c19c23d3ce7ca2c6b9534391 /gdb/ChangeLog
parentc0fa8fbd1c2f02921b90083e595a8452d3d51ba2 (diff)
downloadgdb-0568462bbf0f666d5bf9f720e16147da71eec46a.zip
gdb-0568462bbf0f666d5bf9f720e16147da71eec46a.tar.gz
gdb-0568462bbf0f666d5bf9f720e16147da71eec46a.tar.bz2
btrace: kernel address filtering
For the BTS recording format, we sometimes get a FROM->TO record where the FROM address lies in the kernel and the TO address lies in user space at whatever address the user process was resumed. GDB has a heuristic to filter out such records based on looking at the most significant bit in the PC. This works fine for 64-bit systems but it doesn't always work for 32-bit systems. Libraries that are loaded at fairly high addresses might be mistaken for kernel code and branches inside the library are filtered out. Change the heuristic to (again heuristically) try to determine the lowest address in kernel space. Any PC that is smaller than that should be in user space. On today's systems, there should be a symbol "_text" at that address. Read /proc/kallsyms and search for that symbol. It is not guaranteed that /proc/kallsyms is readable on all systems. On 64-bit systems, we fall back to check the most significant bit. On 32-bit systems, we refrain from filtering out addresses. The filtering should really be done by the kernel. And it soon will be: https://lkml.org/lkml/2015/8/31/212. gdb/ * nat/linux-btrace.h (struct btrace_target_info) <ptr_bits>: Remove. * nat/linux-btrace.c: Include filestuff.h and inttypes.h. Remove include of sys/utsname.h. (linux_determine_kernel_ptr_bits): Remove. (linux_determine_kernel_start): New. (perf_event_is_kernel_addr): Remove tinfo argument. Update users. Update check. (perf_event_skip_bts_record): Remove tinfo argument. Update users. (linux_enable_bts, linux_enable_pt): Remove tinfo->ptr_bits initialization. * x86-linux-nat.c (x86_linux_enable_btrace): Remove ptr_bits assignment. gdbserver/ * linux-low.c (linux_low_enable_btrace): Remove. (linux_target_ops): Replace linux_low_enable_btrace with linux_enable_btrace.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r--gdb/ChangeLog15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8fca48e..bed048a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,18 @@
+2015-09-09 Markus Metzger <markus.t.metzger@intel.com>
+
+ * nat/linux-btrace.h (struct btrace_target_info) <ptr_bits>: Remove.
+ * nat/linux-btrace.c: Include filestuff.h and inttypes.h.
+ Remove include of sys/utsname.h.
+ (linux_determine_kernel_ptr_bits): Remove.
+ (linux_determine_kernel_start): New.
+ (perf_event_is_kernel_addr): Remove tinfo argument. Update users.
+ Update check.
+ (perf_event_skip_bts_record): Remove tinfo argument. Update users.
+ (linux_enable_bts, linux_enable_pt): Remove tinfo->ptr_bits
+ initialization.
+ * x86-linux-nat.c (x86_linux_enable_btrace): Remove ptr_bits
+ assignment.
+
2015-09-07 Pedro Alves <palves@redhat.com>
* guile/guile-internal.h (as_a_scm_t_subr): New.