Kieran Bingham | f197d75 | 2016-05-23 16:24:40 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * gdb helper commands and functions for Linux kernel debugging |
| 3 | * |
| 4 | * Kernel constants derived from include files. |
| 5 | * |
| 6 | * Copyright (c) 2016 Linaro Ltd |
| 7 | * |
| 8 | * Authors: |
| 9 | * Kieran Bingham <kieran.bingham@linaro.org> |
| 10 | * |
| 11 | * This work is licensed under the terms of the GNU GPL version 2. |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | /* We need to stringify expanded macros so that they can be parsed */ |
| 16 | #define STRING(x) #x |
| 17 | #define XSTRING(x) STRING(x) |
| 18 | |
| 19 | #define LX_VALUE(x) LX_##x = x |
| 20 | #define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x)) |
| 21 | |
| 22 | /* |
| 23 | * IS_ENABLED generates (a || b) which is not compatible with python |
| 24 | * We can only switch on configuration items we know are available |
| 25 | * Therefore - IS_BUILTIN() is more appropriate |
| 26 | */ |
| 27 | #define LX_CONFIG(x) LX_##x = IS_BUILTIN(x) |
| 28 | |
| 29 | /* The build system will take care of deleting everything above this marker */ |
| 30 | <!-- end-c-headers --> |
| 31 | |
| 32 | import gdb |