binutils-gdb/gdb/python
Tom de Vries 954a1f9183 [gdb/python] Avoid queue.SimpleQueue for python 3.6
On openSUSE Leap 15.4 with python 3.6, the gdb.dap/basic-dap.exp test-case
fails as follows:
...
ERROR: eof reading json header
    while executing
"error "eof reading json header""
    invoked from within
"expect {
-i exp19 -timeout 10
        -re "^Content-Length: (\[0-9\]+)\r\n" {
            set length $expect_out(1,string)
            exp_continue
        }
        -re "^(\[^\r\n\]+)..."
    ("uplevel" body line 1)
    invoked from within
"uplevel $body" NONE eof reading json header
UNRESOLVED: gdb.dap/basic-dap.exp: startup - initialize
...

Investigation using a "catch throw" shows that:
...
(gdb)
    at gdb/python/py-utils.c:396
396             error (_("Error occurred in Python: %s"), msg.get ());
(gdb) p msg.get ()
$1 = 0x2b91d10 "module 'queue' has no attribute 'SimpleQueue'"
...

The python class queue.SimpleQueue was introduced in python 3.7.

Fix this by falling back to queue.Queue for python <= 3.6.

Tested on x86_64-linux, by successfully running the test-case:
...
 # of expected passes            47
...
2023-01-05 17:35:41 +01:00
..
lib/gdb [gdb/python] Avoid queue.SimpleQueue for python 3.6 2023-01-05 17:35:41 +01:00
py-all-events.def Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-arch.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-auto-load.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-block.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-bpevent.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-breakpoint.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-cmd.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-connection.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-continueevent.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-dap.c Do not use PyObject_CallNoArgs 2023-01-03 07:13:01 -07:00
py-disasm.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-event-types.def Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-event.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-event.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-events.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-evtregistry.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-evts.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-exitedevent.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-finishbreakpoint.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-frame.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-framefilter.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-function.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-gdb-readline.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-inferior.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-infevents.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-infthread.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-instruction.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-instruction.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-lazy-string.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-linetable.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-membuf.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-micmd.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-newobjfileevent.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-objfile.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-param.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-prettyprint.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-progspace.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-record-btrace.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-record-btrace.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-record-full.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-record-full.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-record.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-record.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-ref.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-registers.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-signalevent.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-stopevent.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-stopevent.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-symbol.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-symtab.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-threadevent.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-tui.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-type.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-unwind.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-utils.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-value.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-varobj.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
py-xmethods.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
python-config.py gdb/python-config: replace deprecated distutils.sysconfig 2022-09-01 04:51:33 -04:00
python-internal.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
python.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
python.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00