scripts/gdb: fix lx-dmesg when CONFIG_PRINTK_CALLER is set
authorJoel Colledge <joel.colledge@linbit.com>
Sat, 19 Oct 2019 03:19:26 +0000 (20:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 19 Oct 2019 10:32:31 +0000 (06:32 -0400)
commitca210ba32ef7537b02731bfe255ed8eb1e4e2b59
tree98a7918375b841cc78fd3f4a4f137030ba19db12
parent96c804a6ae8c59a9092b3d5dd581198472063184
scripts/gdb: fix lx-dmesg when CONFIG_PRINTK_CALLER is set

When CONFIG_PRINTK_CALLER is set, struct printk_log contains an
additional member caller_id.  This affects the offset of the log text.
Account for this by using the type information from gdb to determine all
the offsets instead of using hardcoded values.

This fixes following error:

  (gdb) lx-dmesg
  Python Exception <class 'ValueError'> embedded null character:
  Error occurred in Python command: embedded null character

The read_u* utility functions now take an offset argument to make them
easier to use.

Link: http://lkml.kernel.org/r/20191011142500.2339-1-joel.colledge@linbit.com
Signed-off-by: Joel Colledge <joel.colledge@linbit.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/gdb/linux/dmesg.py
scripts/gdb/linux/utils.py