From: John Ogness <john.ogness@linutronix.de>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Baoquan He <bhe@redhat.com>, Dave Young <dyoung@redhat.com>,
Vivek Goyal <vgoyal@redhat.com>, Jonathan Corbet <corbet@lwn.net>,
Kieran Bingham <kbingham@kernel.org>,
Petr Mladek <pmladek@suse.com>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Nick Desaulniers <ndesaulniers@google.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2][next] scripts/gdb: add utils.read_ulong()
Date: Fri, 14 Aug 2020 23:31:24 +0206 [thread overview]
Message-ID: <20200814212525.6118-2-john.ogness@linutronix.de> (raw)
In-Reply-To: <20200814212525.6118-1-john.ogness@linutronix.de>
Add a function for reading unsigned long values, which vary in size
depending on the architecture.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
based on next-20200814
scripts/gdb/linux/utils.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/gdb/linux/utils.py b/scripts/gdb/linux/utils.py
index ea94221dbd39..ff7c1799d588 100644
--- a/scripts/gdb/linux/utils.py
+++ b/scripts/gdb/linux/utils.py
@@ -123,6 +123,13 @@ def read_u64(buffer, offset):
return read_u32(buffer, offset + 4) + (read_u32(buffer, offset) << 32)
+def read_ulong(buffer, offset):
+ if get_long_type().sizeof == 8:
+ return read_u64(buffer, offset)
+ else:
+ return read_u32(buffer, offset)
+
+
target_arch = None
--
2.20.1
next prev parent reply other threads:[~2020-08-14 21:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-14 21:25 [PATCH 0/2][next] update gdb scripts for lockless printk ringbuffer John Ogness
2020-08-14 21:25 ` John Ogness [this message]
2020-08-14 22:29 ` [PATCH 1/2][next] scripts/gdb: add utils.read_ulong() Nick Desaulniers
2020-08-14 21:25 ` [PATCH 2/2][next] scripts/gdb: update for lockless printk ringbuffer John Ogness
2020-08-14 22:24 ` [PATCH 0/2][next] update gdb scripts " Nick Desaulniers
2020-08-21 8:08 ` Petr Mladek
2020-08-21 8:55 ` Jan Kiszka
2020-08-24 9:20 ` Kieran Bingham
2020-08-25 12:35 ` Petr Mladek
2020-08-25 13:53 ` Jan Kiszka
2020-08-26 0:17 ` Andrew Morton
2020-09-01 12:31 ` Petr Mladek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200814212525.6118-2-john.ogness@linutronix.de \
--to=john.ogness@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=corbet@lwn.net \
--cc=dyoung@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=jan.kiszka@siemens.com \
--cc=kbingham@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=sergey.senozhatsky@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).