Tom de Vries
4cd214dce4
[gdb/python] Fix gdb.python/py-disasm.exp on arm-linux
...
After fixing test-case gdb.python/py-disasm.exp to recognize the arm nop:
...
nop {0}
...
we run into:
...
disassemble test^M
Dump of assembler code for function test:^M
0x004004d8 <+0>: push {r11} @ (str r11, [sp, #-4]!)^M
0x004004dc <+4>: add r11, sp, #0^M
0x004004e0 <+8>: nop {0}^M
=> 0x004004e4 <+12>: Python Exception <class 'ValueError'>: Buffer \
returned from read_memory is sized 0 instead of the expected 4^M
^M
unknown disassembler error (error = -1)^M
(gdb) FAIL: $exp: global_disassembler=ShowInfoRepr: disassemble test
...
This is caused by this code in gdbpy_disassembler::read_memory_func:
...
gdbpy_ref<> result_obj (PyObject_CallMethod ((PyObject *) obj,
"read_memory",
"KL", len, offset));
...
where len has type "unsigned int", while "K" means "unsigned long long" [1].
Fix this by using "I" instead, meaning "unsigned int".
Also, offset has type LONGEST, which is typedef'ed to int64_t, while "L" means
"long long".
Fix this by using type gdb_py_longest for offset, in combination with format
character "GDB_PY_LL_ARG". Likewise in disasmpy_info_read_memory.
Tested on arm-linux.
Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com >
Approved-By: Tom Tromey <tom@tromey.com >
PR python/31845
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31845
[1] https://docs.python.org/3/c-api/arg.html
2024-06-10 17:53:30 +02:00
..
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-06-04 10:54:18 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-19 10:55:32 +01:00
2024-02-19 10:55:32 +01:00
2024-02-19 14:08:31 +01:00
2024-02-19 10:55:32 +01:00
2024-03-29 22:28:44 +00:00
2024-02-19 14:08:31 +01:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-06-10 17:53:30 +02:00
2024-06-10 17:53:30 +02:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-26 21:22:48 +01:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-07 19:52:06 +01:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-04-02 11:21:39 -06:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2023-07-19 14:10:19 +01:00
2024-04-26 21:22:48 +01:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-03-19 11:34:16 +00:00
2024-03-19 11:34:16 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-05-03 15:07:33 +02:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-03-19 16:03:34 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-03-22 17:29:47 -07:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-04-02 11:21:39 -06:00
2024-06-03 17:23:26 +02:00
2024-06-03 17:23:26 +02:00
2024-01-12 15:49:57 +00:00
2024-06-03 17:18:30 +02:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-04-02 11:21:39 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00
2024-03-18 07:20:14 -06:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-01-12 15:49:57 +00:00
2024-02-27 09:46:31 -07:00
2024-02-27 09:46:31 -07:00
2024-01-12 15:49:57 +00:00