-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts/gdb: provide linux constants
Some macro's and defines are needed when parsing memory, and without compiling the kernel as -g3 they are not available in the debug-symbols. We use the pre-processor here to extract constants to a dedicated module for the linux debugger extensions Top level Kbuild is used to call in and generate the constants file, while maintaining dependencies on autogenerated files in include/generated Link: http://lkml.kernel.org/r/bc3df9c25f57ea72177c066a51a446fc19e2c27f.1462865983.git.jan.kiszka@siemens.com Signed-off-by: Kieran Bingham <[email protected]> Signed-off-by: Jan Kiszka <[email protected]> Cc: Michal Marek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* gdb helper commands and functions for Linux kernel debugging | ||
* | ||
* Kernel constants derived from include files. | ||
* | ||
* Copyright (c) 2016 Linaro Ltd | ||
* | ||
* Authors: | ||
* Kieran Bingham <[email protected]> | ||
* | ||
* This work is licensed under the terms of the GNU GPL version 2. | ||
* | ||
*/ | ||
|
||
/* We need to stringify expanded macros so that they can be parsed */ | ||
#define STRING(x) #x | ||
#define XSTRING(x) STRING(x) | ||
|
||
#define LX_VALUE(x) LX_##x = x | ||
#define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x)) | ||
|
||
/* | ||
* IS_ENABLED generates (a || b) which is not compatible with python | ||
* We can only switch on configuration items we know are available | ||
* Therefore - IS_BUILTIN() is more appropriate | ||
*/ | ||
#define LX_CONFIG(x) LX_##x = IS_BUILTIN(x) | ||
|
||
/* The build system will take care of deleting everything above this marker */ | ||
<!-- end-c-headers --> | ||
|
||
import gdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ | |
import linux.cpus | ||
import linux.lists | ||
import linux.proc | ||
import linux.constants |