mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
scripts/gdb: fix lx-timerlist for Python3
Below incompatibilities between Python2 and Python3 made lx-timerlist fail to run under Python3. o xrange() is replaced by range() in Python3 o bytes and str are different types in Python3 o the return value of Inferior.read_memory() is memoryview object in Python3 akpm: cc stable so that older kernels are properly debuggable under newer Python. Link: https://lkml.kernel.org/r/TYCP286MB2146EE1180A4D5176CBA8AB2C6819@TYCP286MB2146.JPNP286.PROD.OUTLOOK.COM Signed-off-by: Peng Liu <liupeng17@lenovo.com> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Kieran Bingham <kbingham@kernel.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
747cd84f67
commit
7362042f35
2 changed files with 7 additions and 2 deletions
|
@ -88,7 +88,10 @@ def get_target_endianness():
|
|||
|
||||
|
||||
def read_memoryview(inf, start, length):
|
||||
return memoryview(inf.read_memory(start, length))
|
||||
m = inf.read_memory(start, length)
|
||||
if type(m) is memoryview:
|
||||
return m
|
||||
return memoryview(m)
|
||||
|
||||
|
||||
def read_u16(buffer, offset):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue