linux/scripts
André Draszik d6c9708737 scripts/gdb: make lx-dmesg command work (reliably)
lx-dmesg needs access to the log_buf symbol from printk.c.
Unfortunately, the symbol log_buf also exists in BPF's verifier.c and
hence gdb can pick one or the other.  If it happens to pick BPF's
log_buf, lx-dmesg doesn't work:

  (gdb) lx-dmesg
  Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 0x0:
  Error occurred in Python command: Cannot access memory at address 0x0
  (gdb) p log_buf
  $15 = 0x0

Luckily, GDB has a way to deal with this, see
  https://sourceware.org/gdb/onlinedocs/gdb/Symbols.html

  (gdb) info variables ^log_buf$
  All variables matching regular expression "^log_buf$":

  File <linux.git>/kernel/bpf/verifier.c:
  static char *log_buf;

  File <linux.git>/kernel/printk/printk.c:
  static char *log_buf;
  (gdb) p 'verifier.c'::log_buf
  $1 = 0x0
  (gdb) p 'printk.c'::log_buf
  $2 = 0x811a6aa0 <__log_buf> ""
  (gdb) p &log_buf
  $3 = (char **) 0x8120fe40 <log_buf>
  (gdb) p &'verifier.c'::log_buf
  $4 = (char **) 0x8120fe40 <log_buf>
  (gdb) p &'printk.c'::log_buf
  $5 = (char **) 0x8048b7d0 <log_buf>

By being explicit about the location of the symbol, we can make lx-dmesg
work again.  While at it, do the same for the other symbols we need from
printk.c

Link: http://lkml.kernel.org/r/20170526112222.3414-1-git@andred.net
Signed-off-by: André Draszik <git@andred.net>
Tested-by: Kieran Bingham <kieran@bingham.xyz>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-06-02 15:07:38 -07:00
..
basic
coccinelle drm: Introduce drm_property_blob_{get,put}() 2017-02-28 16:16:46 +01:00
dtc DeviceTree fixes for 4.12-rc: 2017-05-19 15:03:24 -07:00
gcc-plugins Fixes a typo in sancov plugin, exposed in earlier compiler versions 2017-03-09 18:05:41 -08:00
gdb scripts/gdb: make lx-dmesg command work (reliably) 2017-06-02 15:07:38 -07:00
genksyms Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2017-03-11 01:18:25 +09:00
kconfig gconfig: remove misleading parentheses around a condition 2017-03-22 02:56:33 +09:00
ksymoops Fix dead URLs to ftp.kernel.org 2017-03-28 16:16:52 +02:00
mod kbuild: Consolidate header generation from ASM offset information 2017-04-13 05:43:37 +09:00
package Kbuild misc updates for 4.12 2017-05-10 20:41:43 -07:00
selinux selinux: include sys/socket.h in host programs to have PF_MAX 2017-03-10 15:09:27 -05:00
tracing
.gitignore
Kbuild.include Kbuild updates for v4.12 2017-05-10 20:11:05 -07:00
Lindent
Makefile
Makefile.asm-generic
Makefile.build objtool: make it visible in make V=1 output 2017-05-03 13:39:37 +09:00
Makefile.clean
Makefile.dtbinst kbuild: dtbinst: remove unnecessary __dtbs_install_prep target 2017-05-08 07:26:06 +09:00
Makefile.extrawarn kbuild: drop -Wno-unknown-warning-option from clang options 2017-04-23 16:09:15 +09:00
Makefile.fwinst
Makefile.gcc-plugins
Makefile.headersinst kbuild: skip install/check of headers right under uapi directories 2017-05-18 02:17:45 +09:00
Makefile.help
Makefile.host
Makefile.kasan
Makefile.lib devicetree: Move include prefixes from arch to separate directory 2017-05-18 23:55:48 -07:00
Makefile.modbuiltin
Makefile.modinst
Makefile.modpost
Makefile.modsign
Makefile.ubsan
adjust_autoksyms.sh
asn1_compiler.c
bloat-o-meter
bootgraph.pl
check-lc_ctype.c
check_00index.sh
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl checkpatch: improve the SUSPECT_CODE_INDENT test 2017-05-08 17:15:11 -07:00
checkstack.pl scripts: remove AVR32 support from checkstack.pl 2017-05-01 09:27:15 +02:00
checksyscalls.sh x86/syscalls/32: Ignore arch_prctl for other architectures 2017-03-24 14:13:55 +01:00
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
conmakehash.c
const_structs.checkpatch
decode_stacktrace.sh
decodecode
depmod.sh
diffconfig
docproc.c
export_report.pl
extract-cert.c
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_initramfs_list.sh
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers.sh
headers_check.pl
headers_install.sh
insert-sys-cert.c
kallsyms.c
kernel-doc scripts/kernel-doc: fix handling of parameters with parenthesis 2017-04-02 14:06:56 -06:00
kernel-doc-xml-ref
ld-version.sh
link-vmlinux.sh
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap
mkuboot.sh
mkversion
module-common.lds module: set .init_array alignment to 8 2017-03-13 09:40:28 -07:00
namespace.pl
objdiff scripts: objdiff: Ignore debug info when comparing 2017-03-11 11:13:38 +09:00
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c ftrace: Allow for function tracing to record init functions on boot up 2017-03-24 20:51:49 -04:00
recordmcount.h
recordmcount.pl ftrace: Allow for function tracing to record init functions on boot up 2017-03-24 20:51:49 -04:00
setlocalversion
show_delta
sign-file.c
sortextable.c
sortextable.h
spelling.txt treewide: spelling: correct diffrent[iate] and banlance typos 2017-05-08 17:15:13 -07:00
stackdelta
stackusage
tags.sh scripts/tags.sh: include arch/Kconfig* for tags generation 2017-02-22 16:41:26 -08:00
unifdef.c
ver_linux ver_linux: Use /usr/bin/awk instead of /bin/awk 2017-04-08 18:03:42 +02:00
xen-hypercalls.sh
xz_wrap.sh