All of lore.kernel.org
 help / color / mirror / Atom feed
* + scripts-gdb-fix-issue-with-dmesgpy-and-python-3x.patch added to -mm tree
@ 2016-05-10 19:34 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-05-10 19:34 UTC (permalink / raw)
  To: buzdelabuz2+git, jan.kiszka, kieran, mm-commits


The patch titled
     Subject: scripts/gdb: fix issue with dmesg.py and python 3.X
has been added to the -mm tree.  Its filename is
     scripts-gdb-fix-issue-with-dmesgpy-and-python-3x.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/scripts-gdb-fix-issue-with-dmesgpy-and-python-3x.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/scripts-gdb-fix-issue-with-dmesgpy-and-python-3x.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Dom Cote <buzdelabuz2+git@gmail.com>
Subject: scripts/gdb: fix issue with dmesg.py and python 3.X

When built against Python 3, GDB differs in the return type for its
read_memory function, causing the lx-dmesg command to fail.

Now that we have an improved read_16() we can use the new read_memoryview()
abstraction to make lx-dmesg return valid data on both current Python APIs

Tested with python 3.4 and 2.7
Tested with gdb 7.7

Link: http://lkml.kernel.org/r/28477b727ff7fe3101fd4e426060e8a68317a639.1462865983.git.jan.kiszka@siemens.com
Signed-off-by: Dom Cote <buzdelabuz2+git@gmail.com>
[kieran@bingham.xyz: Adjusted commit log to better reflect code changes]
Tested-by: Kieran Bingham <kieran@bingham.xyz> (Py2.7,Py3.4,GDB10)
Signed-off-by: Kieran Bingham <kieran@bingham.xyz>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 scripts/gdb/linux/dmesg.py |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff -puN scripts/gdb/linux/dmesg.py~scripts-gdb-fix-issue-with-dmesgpy-and-python-3x scripts/gdb/linux/dmesg.py
--- a/scripts/gdb/linux/dmesg.py~scripts-gdb-fix-issue-with-dmesgpy-and-python-3x
+++ a/scripts/gdb/linux/dmesg.py
@@ -33,11 +33,12 @@ class LxDmesg(gdb.Command):
         if log_first_idx < log_next_idx:
             log_buf_2nd_half = -1
             length = log_next_idx - log_first_idx
-            log_buf = inf.read_memory(start, length)
+            log_buf = utils.read_memoryview(inf, start, length).tobytes()
         else:
             log_buf_2nd_half = log_buf_len - log_first_idx
-            log_buf = inf.read_memory(start, log_buf_2nd_half) + \
-                inf.read_memory(log_buf_addr, log_next_idx)
+            a = utils.read_memoryview(inf, start, log_buf_2nd_half)
+            b = utils.read_memoryview(inf, log_buf_addr, log_next_idx)
+            log_buf = a.tobytes() + b.tobytes()
 
         pos = 0
         while pos < log_buf.__len__():
_

Patches currently in -mm which might be from buzdelabuz2+git@gmail.com are

scripts-gdb-improve-types-abstraction-for-gdb-python-scripts.patch
scripts-gdb-fix-issue-with-dmesgpy-and-python-3x.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-10 19:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10 19:34 + scripts-gdb-fix-issue-with-dmesgpy-and-python-3x.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.