blob: 7986f4e0da123a240eeca854666dd3cfac86d69b [file] [log] [blame]
Kieran Binghamf197d752016-05-23 16:24:40 -07001/*
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
Kieran Binghamc1a15392016-05-23 16:24:59 -070015#include <linux/fs.h>
16#include <linux/mount.h>
17
Kieran Binghamf197d752016-05-23 16:24:40 -070018/* We need to stringify expanded macros so that they can be parsed */
Kieran Binghamc1a15392016-05-23 16:24:59 -070019
Kieran Binghamf197d752016-05-23 16:24:40 -070020#define STRING(x) #x
21#define XSTRING(x) STRING(x)
22
23#define LX_VALUE(x) LX_##x = x
24#define LX_GDBPARSED(x) LX_##x = gdb.parse_and_eval(XSTRING(x))
25
26/*
27 * IS_ENABLED generates (a || b) which is not compatible with python
28 * We can only switch on configuration items we know are available
29 * Therefore - IS_BUILTIN() is more appropriate
30 */
31#define LX_CONFIG(x) LX_##x = IS_BUILTIN(x)
32
33/* The build system will take care of deleting everything above this marker */
34<!-- end-c-headers -->
35
36import gdb
Kieran Binghamc1a15392016-05-23 16:24:59 -070037
38/* linux/fs.h */
39LX_VALUE(MS_RDONLY)
40LX_VALUE(MS_SYNCHRONOUS)
41LX_VALUE(MS_MANDLOCK)
42LX_VALUE(MS_DIRSYNC)
43LX_VALUE(MS_NOATIME)
44LX_VALUE(MS_NODIRATIME)
45
46/* linux/mount.h */
47LX_VALUE(MNT_NOSUID)
48LX_VALUE(MNT_NODEV)
49LX_VALUE(MNT_NOEXEC)
50LX_VALUE(MNT_NOATIME)
51LX_VALUE(MNT_NODIRATIME)
52LX_VALUE(MNT_RELATIME)