I use gdb 15.1 with this DAP debugger extension on Windows https://github.com/oltolm/vscode-gdb. I get the "gdb.error: Frame is invalid." error. This happens because the frame was created on one thread but is used on another. This is the backtrace from the "scopes" request. The same happens for the "variables" request. READ: <<<{"command": "scopes", "arguments": {"frameId": 11}, "type": "request", "seq": 29}>>> Traceback (most recent call last): File "C:\msys64/mingw64/share/gdb/python\gdb\dap\server.py", line 157, in _handle_command body = _commands[params["command"]](**args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\msys64/mingw64/share/gdb/python\gdb\dap\server.py", line 300, in check return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\msys64/mingw64/share/gdb/python\gdb\dap\server.py", line 360, in sync_call return send_gdb_with_response(lambda: func(**args)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\msys64/mingw64/share/gdb/python\gdb\dap\server.py", line 514, in send_gdb_with_response raise val File "C:\msys64/mingw64/share/gdb/python\gdb\dap\server.py", line 470, in __call__ val = self.fn() ^^^^^^^^^ File "C:\msys64/mingw64/share/gdb/python\gdb\dap\server.py", line 360, in <lambda> return send_gdb_with_response(lambda: func(**args)) ^^^^^^^^^^^^ File "C:\msys64/mingw64/share/gdb/python\gdb\dap\startup.py", line 113, in ensure_gdb_thread return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\msys64/mingw64/share/gdb/python\gdb\dap\typecheck.py", line 86, in check_arguments return func(**kwargs) ^^^^^^^^^^^^^^ File "C:\msys64/mingw64/share/gdb/python\gdb\dap\scopes.py", line 151, in scopes args = tuple(frame.frame_args() or ()) ^^^^^^^^^^^^^^^^^^ File "C:\msys64/mingw64/share/gdb/python\gdb\FrameDecorator.py", line 102, in frame_args if self.__is_limited_frame(frame): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\msys64/mingw64/share/gdb/python\gdb\FrameDecorator.py", line 33, in __is_limited_frame sal = frame.find_sal() ^^^^^^^^^^^^^^^^ gdb.error: Frame is invalid. WROTE: <<<{"request_seq": 29, "type": "response", "command": "scopes", "success": false, "message": "Frame is invalid."}>>> I have a patch which fixes this problem for the "scopes" and "variables" requests. I am building a map from scope to thread or from variable to thread and switch to the correct thread in the request. I am not sure it is the best way but I can submit them.
Big oversight! Thanks for finding this. I suspect expression evaluation will also need this fix.
I posted a patch (https://sourceware.org/pipermail/gdb-patches/2024-September/211566.html) to the mailing list. Is it possible to get it in GDB 15.2?