Re: [PATCH] scripts/gdb: Handle split debug

2019-07-31 Thread Jan Kiszka
On 31.07.19 17:44, Doug Anderson wrote: > Hi, > > On Wed, Jul 31, 2019 at 7:24 AM Jan Kiszka wrote: >> >> On 31.07.19 01:40, Douglas Anderson wrote: >>> Some systems (like Chrome OS) may use "split debug" for kernel >>> modules. That means that t

Re: [PATCH] scripts/gdb: Handle split debug

2019-07-31 Thread Jan Kiszka
On 31.07.19 01:40, Douglas Anderson wrote: > Some systems (like Chrome OS) may use "split debug" for kernel > modules. That means that the debug symbols are in a different file > than the main elf file. Let's handle that by also searching for debug > symbols that end in ".ko.debug". Is this

[Kgdb-bugreport] [PATCH v12 26/28] scripts/gdb: Convert CpuList to generator function

2015-01-29 Thread Jan Kiszka
Yet another code simplification. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/cpus.py| 71 scripts/gdb/linux/modules.py | 2 +- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/scripts/gdb/linux/cpus.py b

[Kgdb-bugreport] [PATCH v12 14/28] scripts/gdb: Add is_target_arch helper

2015-01-29 Thread Jan Kiszka
This helper caches to result of show architecture and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 13 + 1 file changed, 13 insertions(+) diff --git a/scripts/gdb/linux/utils.py b

[Kgdb-bugreport] [PATCH v12 25/28] scripts/gdb: Convert ModuleList to generator function

2015-01-29 Thread Jan Kiszka
Analogously to the task list, convert the module list to a generator function. It noticeably simplifies the code. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 33 +++-- scripts/gdb/linux/symbols.py | 2 +- 2 files changed, 12

[Kgdb-bugreport] [PATCH v12 05/28] scripts/gdb: Add lx-symbols command

2015-01-29 Thread Jan Kiszka
/symbols.py new file mode 100644 index 000..bd21a96 --- /dev/null +++ b/scripts/gdb/linux/symbols.py @@ -0,0 +1,127 @@ +# +# gdb helper commands and functions for Linux kernel debugging +# +# load kernel and module symbols +# +# Copyright (c) Siemens AG, 2011-2013 +# +# Authors: +# Jan Kiszka

[Kgdb-bugreport] [PATCH v12 19/28] scripts/gdb: Add class to iterate over CPU masks

2015-01-29 Thread Jan Kiszka
Will be used first to count module references. It is optimized to read the mask only once per stop. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/cpus.py | 54 +++ 1 file changed, 54 insertions(+) diff --git a/scripts/gdb

[Kgdb-bugreport] [PATCH v12 24/28] scripts/gdb: Use a generator instead of iterator for task list

2015-01-29 Thread Jan Kiszka
Python's generator. Signed-off-by: Daniel Wagner daniel.wag...@bmw-carit.de Cc: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/tasks.py | 50 +++--- 1 file changed, 20 insertions(+), 30 deletions

[Kgdb-bugreport] [PATCH v12 10/28] scripts/gdb: Add read_u16/32/64 helpers

2015-01-29 Thread Jan Kiszka
Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 21 + 1 file changed, 21 insertions

[Kgdb-bugreport] [PATCH v12 04/28] scripts/gdb: Add module iteration class

2015-01-29 Thread Jan Kiszka
Will soon be used for loading symbols, printing global variables or listing modules. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 39 +++ 1 file changed, 39 insertions(+) create mode 100644 scripts/gdb/linux/modules.py

[Kgdb-bugreport] [PATCH v12 03/28] scripts/gdb: Add container_of helper and convenience function

2015-01-29 Thread Jan Kiszka
Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type long for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v12 18/28] scripts/gdb: Add lx_current convenience function

2015-01-29 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu(current_task), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/cpus.py | 17 + 1 file changed, 17 insertions(+) diff --git

[Kgdb-bugreport] [PATCH v12 06/28] module: Do not inline do_init_module

2015-01-29 Thread Jan Kiszka
This provides a reliable breakpoint target, required for automatic symbol loading via the gdb helper command 'lx-symbols'. CC: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kernel/module.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions

[Kgdb-bugreport] [PATCH v12 11/28] scripts/gdb: Add lx-dmesg command

2015-01-29 Thread Jan Kiszka
This pokes into the log buffer of the debugged kernel, dumping it to the gdb console. Helping in case the target should or can no longer execute dmesg itself. CC: Kay Sievers k...@vrfy.org Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/dmesg.py | 64

[Kgdb-bugreport] [PATCH v12 08/28] scripts/gdb: Add internal helper and convenience function to look up a module

2015-01-29 Thread Jan Kiszka
Add the internal helper get_module_by_name to obtain the module structure corresponding to the given name. Also export this service as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 28 scripts/gdb/vmlinux

[Kgdb-bugreport] [PATCH v12 02/28] scripts/gdb: Add cache for type objects

2015-01-29 Thread Jan Kiszka
Type lookups are very slow in gdb-python which is often noticeable when iterating over a number of objects. Introduce the helper class CachedType that keeps a reference to a gdb.Type object but also refreshes it after an object file has been loaded. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v12 20/28] scripts/gdb: Add lx-lsmod command

2015-01-29 Thread Jan Kiszka
This adds a lsmod-like command to list all currently loaded modules of the target. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/scripts/gdb/linux

[Kgdb-bugreport] [PATCH v12 16/28] scripts/gdb: Add get_gdbserver_type helper

2015-01-29 Thread Jan Kiszka
This helper probes the type of the gdb server. Supported are QEMU and KGDB so far. Knowledge about the gdb server is required e.g. to retrieve the current CPU or current task. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 35

[Kgdb-bugreport] [PATCH v12 27/28] scripts/gdb: Define maintainer

2015-01-29 Thread Jan Kiszka
I'm proposing myself for keeping an eye on these scripts and integrating contributions. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2ebb056..3570313 100644 --- a/MAINTAINERS +++ b

[Kgdb-bugreport] [PATCH v12 07/28] scripts/gdb: Add automatic symbol reloading on module insertion

2015-01-29 Thread Jan Kiszka
(re-)loading a module. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/symbols.py | 39 +++ 1 file changed, 39 insertions(+) diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index bd21a96..139841f 100644

[Kgdb-bugreport] [PATCH v11 20/28] scripts/gdb: Add lx-lsmod command

2015-01-28 Thread Jan Kiszka
This adds a lsmod-like command to list all currently loaded modules of the target. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/scripts/gdb/linux

[Kgdb-bugreport] [PATCH v11 26/28] scripts/gdb: Convert CpuList to generator function

2015-01-28 Thread Jan Kiszka
Yet another code simplification. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/cpus.py| 71 scripts/gdb/linux/modules.py | 2 +- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/scripts/gdb/linux/cpus.py b

[Kgdb-bugreport] [PATCH v11 16/28] scripts/gdb: Add get_gdbserver_type helper

2015-01-28 Thread Jan Kiszka
This helper probes the type of the gdb server. Supported are QEMU and KGDB so far. Knowledge about the gdb server is required e.g. to retrieve the current CPU or current task. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 35

[Kgdb-bugreport] [PATCH v11 09/28] scripts/gdb: Add get_target_endianness helper

2015-01-28 Thread Jan Kiszka
Parse the target endianness from the output of show endian and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 18

[Kgdb-bugreport] [PATCH v11 18/28] scripts/gdb: Add lx_current convenience function

2015-01-28 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu(current_task), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/cpus.py | 17 + 1 file changed, 17 insertions(+) diff --git

[Kgdb-bugreport] [PATCH v11 25/28] scripts/gdb: Convert ModuleList to generator function

2015-01-28 Thread Jan Kiszka
Analogously to the task list, convert the module list to a generator function. It noticeably simplifies the code. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 33 +++-- scripts/gdb/linux/symbols.py | 2 +- 2 files changed, 12

[Kgdb-bugreport] [PATCH v11 07/28] scripts/gdb: Add automatic symbol reloading on module insertion

2015-01-28 Thread Jan Kiszka
(re-)loading a module. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/symbols.py | 39 +++ 1 file changed, 39 insertions(+) diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index bd21a96..139841f 100644

[Kgdb-bugreport] [PATCH v11 03/28] scripts/gdb: Add container_of helper and convenience function

2015-01-28 Thread Jan Kiszka
Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type long for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v11 08/28] scripts/gdb: Add internal helper and convenience function to look up a module

2015-01-28 Thread Jan Kiszka
Add the internal helper get_module_by_name to obtain the module structure corresponding to the given name. Also export this service as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 28 scripts/gdb/vmlinux

[Kgdb-bugreport] [PATCH v11 28/28] scripts/gdb: Disable pagination while printing from breakpoint handler

2015-01-28 Thread Jan Kiszka
gdb. Resolve this by disabling pagination during automatic symbol updates. We restore the user's configuration once done. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/symbols.py | 11 +++ 1 file changed, 11 insertions(+) diff --git a/scripts/gdb/linux

[Kgdb-bugreport] [PATCH v11 27/28] scripts/gdb: Define maintainer

2015-01-28 Thread Jan Kiszka
I'm proposing myself for keeping an eye on these scripts and integrating contributions. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2ebb056..3570313 100644 --- a/MAINTAINERS +++ b

[Kgdb-bugreport] [PATCH v11 04/28] scripts/gdb: Add module iteration class

2015-01-28 Thread Jan Kiszka
Will soon be used for loading symbols, printing global variables or listing modules. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 39 +++ 1 file changed, 39 insertions(+) create mode 100644 scripts/gdb/linux/modules.py

[Kgdb-bugreport] [PATCH v11 13/28] scripts/gdb: Add helper and convenience function to look up tasks

2015-01-28 Thread Jan Kiszka
Add the helper task_by_pid that can look up a task by its PID. Also export it as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/tasks.py | 27 +++ scripts/gdb/vmlinux-gdb.py | 1 + 2 files changed, 28 insertions(+) diff

[Kgdb-bugreport] [PATCH v11 02/28] scripts/gdb: Add cache for type objects

2015-01-28 Thread Jan Kiszka
Type lookups are very slow in gdb-python which is often noticeable when iterating over a number of objects. Introduce the helper class CachedType that keeps a reference to a gdb.Type object but also refreshes it after an object file has been loaded. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v11 12/28] scripts/gdb: Add task iteration class

2015-01-28 Thread Jan Kiszka
This class allows to iterate over all tasks of the target. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/tasks.py | 46 ++ 1 file changed, 46 insertions(+) create mode 100644 scripts/gdb/linux/tasks.py diff --git a/scripts

[Kgdb-bugreport] [PATCH v11 19/28] scripts/gdb: Add class to iterate over CPU masks

2015-01-28 Thread Jan Kiszka
Will be used first to count module references. It is optimized to read the mask only once per stop. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/cpus.py | 54 +++ 1 file changed, 54 insertions(+) diff --git a/scripts/gdb

[Kgdb-bugreport] [PATCH v11 14/28] scripts/gdb: Add is_target_arch helper

2015-01-28 Thread Jan Kiszka
This helper caches to result of show architecture and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 13 + 1 file changed, 13 insertions(+) diff --git a/scripts/gdb/linux/utils.py b

[Kgdb-bugreport] [PATCH v7 16/21] scripts/gdb: Add get_gdbserver_type helper

2013-11-11 Thread Jan Kiszka
This helper probes the type of the gdb server. Supported are QEMU and KGDB so far. Knowledge about the gdb server is required e.g. to retrieve the current CPU or current task. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 35

[Kgdb-bugreport] [PATCH v7 19/21] scripts/gdb: Add class to iterate over CPU masks

2013-11-11 Thread Jan Kiszka
Will be used first to count module references. It is optimized to read the mask only once per stop. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/cpus.py | 54 +++ 1 file changed, 54 insertions(+) diff --git a/scripts/gdb

[Kgdb-bugreport] [PATCH v7 12/21] scripts/gdb: Add task iteration class

2013-11-11 Thread Jan Kiszka
This class allows to iterate over all tasks of the target. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/tasks.py | 46 ++ 1 file changed, 46 insertions(+) create mode 100644 scripts/gdb/linux/tasks.py diff --git a/scripts

[Kgdb-bugreport] [PATCH v7 02/21] scripts/gdb: Add cache for type objects

2013-11-11 Thread Jan Kiszka
Type lookups are very slow in gdb-python which is often noticeable when iterating over a number of objects. Introduce the helper class CachedType that keeps a reference to a gdb.Type object but also refreshes it after an object file has been loaded. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v7 08/21] scripts/gdb: Add internal helper and convenience function to look up a module

2013-11-11 Thread Jan Kiszka
Add the internal helper get_module_by_name to obtain the module structure corresponding to the given name. Also export this service as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 28 scripts/gdb/vmlinux

[Kgdb-bugreport] [PATCH v7 13/21] scripts/gdb: Add helper and convenience function to look up tasks

2013-11-11 Thread Jan Kiszka
Add the helper task_by_pid that can look up a task by its PID. Also export it as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/tasks.py | 27 +++ scripts/gdb/vmlinux-gdb.py | 1 + 2 files changed, 28 insertions(+) diff

[Kgdb-bugreport] [PATCH v7 07/21] scripts/gdb: Add automatic symbol reloading on module insertion

2013-11-11 Thread Jan Kiszka
(re-)loading a module. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/symbols.py | 39 +++ 1 file changed, 39 insertions(+) diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index bd21a96..139841f 100644

[Kgdb-bugreport] [PATCH v7 14/21] scripts/gdb: Add is_target_arch helper

2013-11-11 Thread Jan Kiszka
This helper caches to result of show architecture and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 13 + 1 file changed, 13 insertions(+) diff --git a/scripts/gdb/linux/utils.py b

[Kgdb-bugreport] [PATCH v7 05/21] scripts/gdb: Add lx-symbols command

2013-11-11 Thread Jan Kiszka
/symbols.py new file mode 100644 index 000..bd21a96 --- /dev/null +++ b/scripts/gdb/linux/symbols.py @@ -0,0 +1,127 @@ +# +# gdb helper commands and functions for Linux kernel debugging +# +# load kernel and module symbols +# +# Copyright (c) Siemens AG, 2011-2013 +# +# Authors: +# Jan Kiszka

[Kgdb-bugreport] [PATCH v7 03/21] scripts/gdb: Add container_of helper and convenience function

2013-11-11 Thread Jan Kiszka
Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type long for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v7 09/21] scripts/gdb: Add get_target_endianness helper

2013-11-11 Thread Jan Kiszka
Parse the target endianness from the output of show endian and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 18

[Kgdb-bugreport] [PATCH v7 04/21] scripts/gdb: Add module iteration class

2013-11-11 Thread Jan Kiszka
Will soon be used for loading symbols, printing global variables or listing modules. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 39 +++ 1 file changed, 39 insertions(+) create mode 100644 scripts/gdb/linux/modules.py

[Kgdb-bugreport] [PATCH v6 02/21] scripts/gdb: Add cache for type objects

2013-10-28 Thread Jan Kiszka
Type lookups are very slow in gdb-python which is often noticeable when iterating over a number of objects. Introduce the helper class CachedType that keeps a reference to a gdb.Type object but also refreshes it after an object file has been loaded. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v6 18/21] scripts/gdb: Add lx_current convenience function

2013-10-28 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu(current_task), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/cpus.py | 17 + 1 file changed, 17 insertions(+) diff --git

[Kgdb-bugreport] [PATCH v6 07/21] scripts/gdb: Add automatic symbol reloading on module insertion

2013-10-28 Thread Jan Kiszka
(re-)loading a module. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/symbols.py | 39 +++ 1 file changed, 39 insertions(+) diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index bd21a96..139841f 100644

[Kgdb-bugreport] [PATCH v6 05/21] scripts/gdb: Add lx-symbols command

2013-10-28 Thread Jan Kiszka
/symbols.py new file mode 100644 index 000..bd21a96 --- /dev/null +++ b/scripts/gdb/linux/symbols.py @@ -0,0 +1,127 @@ +# +# gdb helper commands and functions for Linux kernel debugging +# +# load kernel and module symbols +# +# Copyright (c) Siemens AG, 2011-2013 +# +# Authors: +# Jan Kiszka

[Kgdb-bugreport] [PATCH v6 04/21] scripts/gdb: Add module iteration class

2013-10-28 Thread Jan Kiszka
Will soon be used for loading symbols, printing global variables or listing modules. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 39 +++ 1 file changed, 39 insertions(+) create mode 100644 scripts/gdb/linux/modules.py

[Kgdb-bugreport] [PATCH v6 20/21] scripts/gdb: Add lx-lsmod command

2013-10-28 Thread Jan Kiszka
This adds a lsmod-like command to list all currently loaded modules of the target. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 46 +++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/scripts/gdb/linux

[Kgdb-bugreport] [PATCH v6 16/21] scripts/gdb: Add get_gdbserver_type helper

2013-10-28 Thread Jan Kiszka
This helper probes the type of the gdb server. Supported are QEMU and KGDB so far. Knowledge about the gdb server is required e.g. to retrieve the current CPU or current task. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 35

[Kgdb-bugreport] [PATCH v6 13/21] scripts/gdb: Add helper and convenience function to look up tasks

2013-10-28 Thread Jan Kiszka
Add the helper task_by_pid that can look up a task by its PID. Also export it as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/tasks.py | 27 +++ scripts/gdb/vmlinux-gdb.py | 1 + 2 files changed, 28 insertions(+) diff

[Kgdb-bugreport] [PATCH v6 08/21] scripts/gdb: Add internal helper and convenience function to look up a module

2013-10-28 Thread Jan Kiszka
Add the internal helper get_module_by_name to obtain the module structure corresponding to the given name. Also export this service as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/modules.py | 28 scripts/gdb/vmlinux

[Kgdb-bugreport] [PATCH v6 03/21] scripts/gdb: Add container_of helper and convenience function

2013-10-28 Thread Jan Kiszka
Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type long for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v6 19/21] scripts/gdb: Add class to iterate over CPU masks

2013-10-28 Thread Jan Kiszka
Will be used first to count module references. It is optimized to read the mask only once per stop. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/cpus.py | 54 +++ 1 file changed, 54 insertions(+) diff --git a/scripts/gdb

[Kgdb-bugreport] [PATCH v6 09/21] scripts/gdb: Add get_target_endianness helper

2013-10-28 Thread Jan Kiszka
Parse the target endianness from the output of show endian and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 18

[Kgdb-bugreport] [PATCH v6 12/21] scripts/gdb: Add task iteration class

2013-10-28 Thread Jan Kiszka
This class allows to iterate over all tasks of the target. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/tasks.py | 46 ++ 1 file changed, 46 insertions(+) create mode 100644 scripts/gdb/linux/tasks.py diff --git a/scripts

[Kgdb-bugreport] [PATCH v6 06/21] module: Do not inline do_init_module

2013-10-28 Thread Jan Kiszka
This provides a reliable breakpoint target, required for automatic symbol loading via the gdb helper command 'lx-symbols'. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kernel/module.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/module.c b/kernel

[Kgdb-bugreport] [PATCH v6 10/21] scripts/gdb: Add read_u16/32/64 helpers

2013-10-28 Thread Jan Kiszka
Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 21 + 1 file changed, 21 insertions

[Kgdb-bugreport] [PATCH v6 14/21] scripts/gdb: Add is_target_arch helper

2013-10-28 Thread Jan Kiszka
This helper caches to result of show architecture and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/linux/utils.py | 13 + 1 file changed, 13 insertions(+) diff --git a/scripts/gdb/linux/utils.py b

Re: [Kgdb-bugreport] [PATCH v5 05/20] scripts/gdb: Add lx-symbols command

2013-02-14 Thread Jan Kiszka
On 2013-02-14 16:40, Tom Tromey wrote: Jan == Jan Kiszka jan.kis...@siemens.com writes: Jan In addition, the command installs a silent breakpoint in the load_module Jan function at the point where the module was loaded but not yet Jan initialized. The breakpoint handler will try to load

[Kgdb-bugreport] [PATCH v5 07/20] scripts/gdb: Add lx_modvar convenience function

2013-01-29 Thread Jan Kiszka
-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/module.py | 48 scripts/gdb/utils.py |7 +++ 2 files changed, 55 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/module.py b/scripts/gdb/module.py index e309c0a..333729a 100644

[Kgdb-bugreport] [PATCH v5 08/20] scripts/gdb: Add get_target_endianness helper

2013-01-29 Thread Jan Kiszka
Parse the target endianness from the output of show endian and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py | 17

[Kgdb-bugreport] [PATCH v5 03/20] scripts/gdb: Add container_of helper and convenience function

2013-01-29 Thread Jan Kiszka
Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type long for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v5 05/20] scripts/gdb: Add lx-symbols command

2013-01-29 Thread Jan Kiszka
files found during lx-symbols execution. This way, breakpoints can be set to module initialization functions, and there is usually no need to explicitly call lx-symbols after (re-)loading a module. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/symbols.py | 147

[Kgdb-bugreport] [PATCH v5 02/20] scripts/gdb: Add cache for type objects

2013-01-29 Thread Jan Kiszka
Type lookups are very slow in gdb-python which is often noticeable when iterating over a number of objects. Introduce the helper class CachedType that keeps a reference to a gdb.Type object but also refreshes it after an object file has been loaded. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v5 11/20] scripts/gdb: Add task iteration helper

2013-01-29 Thread Jan Kiszka
The internal helper for_each_task iterates over all tasks of the target, calling the provided function on each. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/task.py | 35 +++ 1 files changed, 35 insertions(+), 0 deletions(-) create mode

[Kgdb-bugreport] [PATCH v5 06/20] scripts/gdb: Add internal helper and convenience function to look up a module

2013-01-29 Thread Jan Kiszka
Add the internal helper get_module_by_name to obtain the module structure corresponding to the given name. Also export this service as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/module.py | 30 ++ scripts/gdb

[Kgdb-bugreport] [PATCH v5 09/20] scripts/gdb: Add read_u16/32/64 helpers

2013-01-29 Thread Jan Kiszka
Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py | 18 ++ 1 files changed, 18 insertions(+), 0

[Kgdb-bugreport] [PATCH v5 12/20] scripts/gdb: Add helper and convenience function to look up tasks

2013-01-29 Thread Jan Kiszka
Add the helper task_by_pid that can look up a task by its PID. Also export it as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/task.py| 29 + scripts/gdb/vmlinux-gdb.py |1 + 2 files changed, 30 insertions(+), 0

[Kgdb-bugreport] [PATCH v5 13/20] scripts/gdb: Add is_target_arch helper

2013-01-29 Thread Jan Kiszka
This helper caches to result of show architecture and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/utils.py b

[Kgdb-bugreport] [PATCH v5 19/20] scripts/gdb: Add lx-lsmod command

2013-01-29 Thread Jan Kiszka
This adds a lsmod-like command to list all currently loaded modules of the target. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/module.py | 43 +++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/module.py

[Kgdb-bugreport] [PATCH v5 17/20] scripts/gdb: Add lx_current convenience function

2013-01-29 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu(current_task), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/percpu.py | 16 1 files changed, 16 insertions(+), 0 deletions

[Kgdb-bugreport] [PATCH v5 04/20] scripts/gdb: Add module iteration helper

2013-01-29 Thread Jan Kiszka
Will soon be used for loading symbols, printing global variables or listing modules. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/module.py | 28 1 files changed, 28 insertions(+), 0 deletions(-) create mode 100644 scripts/gdb/module.py diff

[Kgdb-bugreport] [PATCH v5 18/20] scripts/gdb: Add helper to iterate over CPU masks

2013-01-29 Thread Jan Kiszka
Will be used first to count module references. It is optimized to read the mask only once per stop and to minimize the loop lengths. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/percpu.py | 33 + 1 files changed, 33 insertions(+), 0 deletions

[Kgdb-bugreport] [PATCH v5 15/20] scripts/gdb: Add get_gdbserver_type helper

2013-01-29 Thread Jan Kiszka
This helper probes the type of the gdb server. Supported are QEMU and KGDB so far. Knowledge about the gdb server is required e.g. to retrieve the current CPU or current task. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py | 35 +++ 1

[Kgdb-bugreport] [PATCH v5 10/20] scripts/gdb: Add lx-dmesg command

2013-01-29 Thread Jan Kiszka
This pokes into the log buffer of the debugged kernel, dumping it to the gdb console. Helping in case the target should or can no longer execute dmesg itself. CC: Kay Sievers k...@vrfy.org Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/dmesg.py | 63

[Kgdb-bugreport] [PATCH v4 04/13] scripts/gdb: Add get_target_endianness helper

2013-01-21 Thread Jan Kiszka
Parse the target endianness from the output of show endian and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py | 17

[Kgdb-bugreport] [PATCH v4 02/13] scripts/gdb: Add container_of helper and convenience function

2013-01-21 Thread Jan Kiszka
Provide an internal helper with container_of semantics. As type lookups are very slow in gdb-python and we need a type long for this, cache the reference to this type object. Then export the helper also as a convenience function form use at the gdb command line. Signed-off-by: Jan Kiszka jan.kis

[Kgdb-bugreport] [PATCH v4 13/13] scripts/gdb: Add lx_current convenience function

2013-01-21 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu(current_task), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/percpu.py | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff

[Kgdb-bugreport] [PATCH v4 05/13] scripts/gdb: Add read_u16/32/64 helpers

2013-01-21 Thread Jan Kiszka
Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py | 18 ++ 1 files changed, 18 insertions(+), 0

[Kgdb-bugreport] [PATCH v4 03/13] scripts/gdb: Add lx-symbols command

2013-01-21 Thread Jan Kiszka
files found during lx-symbols execution. This way, breakpoints can be set to module initialization functions, and there is usually no need to explicitly call lx-symbols after (re-)loading a module. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/symbols.py | 153

[Kgdb-bugreport] [PATCH v4 08/13] scripts/gdb: Add helper and convenience function to look up tasks

2013-01-21 Thread Jan Kiszka
Add the helper task_by_pid that can look up a task by its PID. Also export it as a convenience function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/task.py| 29 + scripts/gdb/vmlinux-gdb.py |1 + 2 files changed, 30 insertions(+), 0

[Kgdb-bugreport] [PATCH v4 06/13] scripts/gdb: Add lx-dmesg command

2013-01-21 Thread Jan Kiszka
This pokes into the log buffer of the debugged kernel, dumping it to the gdb console. Helping in case the target should or can no longer execute dmesg itself. CC: Kay Sievers k...@vrfy.org Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/dmesg.py | 63

[Kgdb-bugreport] [PATCH v4 09/13] scripts/gdb: Add is_target_arch helper

2013-01-21 Thread Jan Kiszka
This helper caches to result of show architecture and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/utils.py b

[Kgdb-bugreport] [PATCH v3 01/13] scripts/gdb: Add infrastructure

2012-11-27 Thread Jan Kiszka
to pre-process the version string returned by gdb as some distros tend to prefix it with their name. This feature depends on CONFIG_DEBUG_INFO. CC: Michal Marek mma...@suse.cz CC: linux-kbu...@vger.kernel.org Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Makefile |5

[Kgdb-bugreport] [PATCH v3 13/13] scripts/gdb: Add lx_current convenience function

2012-11-27 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu(current_task), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/percpu.py | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff

[Kgdb-bugreport] [PATCH v3 05/13] scripts/gdb: Add read_u16/32/64 helpers

2012-11-27 Thread Jan Kiszka
Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py | 18 ++ 1 files changed, 18 insertions(+), 0

[Kgdb-bugreport] [PATCH v3 09/13] scripts/gdb: Add is_target_arch helper

2012-11-27 Thread Jan Kiszka
This helper caches to result of show architecture and matches the provided arch (sub-)string against that output. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/utils.py b

[Kgdb-bugreport] [PATCH v3 04/13] scripts/gdb: Add get_target_endianness helper

2012-11-27 Thread Jan Kiszka
Parse the target endianness from the output of show endian and cache the result to return it via the new helper get_target_endiannes. We will need it for reading integers from buffers that contain target memory. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py | 17

[Kgdb-bugreport] [PATCH v3 10/13] scripts/gdb: Add internal helper and convenience function to retrieve thread_info

2012-11-27 Thread Jan Kiszka
-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/task.py | 39 +++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/scripts/gdb/task.py b/scripts/gdb/task.py index 41d85cc..523e495 100644 --- a/scripts/gdb/task.py +++ b/scripts/gdb/task.py

[Kgdb-bugreport] [PATCH 05/13] scripts/gdb: Add read_u16/32/64 helpers

2012-11-05 Thread Jan Kiszka
Add helpers for reading integers from target memory buffers. Required when caching the memory access is more efficient than reading individual values via gdb. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/utils.py | 18 ++ 1 files changed, 18 insertions(+), 0

[Kgdb-bugreport] [PATCH 13/13] scripts/gdb: Add lx_current convenience function

2012-11-05 Thread Jan Kiszka
This is a shorthand for *$lx_per_cpu(current_task), i.e. a convenience function to retrieve the currently running task of the active context. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/percpu.py | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff

[Kgdb-bugreport] [PATCH 07/13] scripts/gdb: Add task iteration helper

2012-11-05 Thread Jan Kiszka
The internal helper for_each_task iterates over all tasks of the target, calling the provided function on each. For performance reasons, we cache a reference to the gdb type object of a task. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- scripts/gdb/task.py | 40

[Kgdb-bugreport] [PATCH 01/13] scripts/gdb: Add infrastructure

2012-11-05 Thread Jan Kiszka
. This feature depends on CONFIG_DEBUG_INFO. CC: Michal Marek mma...@suse.cz CC: linux-kbu...@vger.kernel.org Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Makefile |5 - scripts/Makefile |3 ++- scripts/gdb/Makefile |9 + scripts/gdb/vmlinux

  1   2   >