public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug dap/32133] New: gdb.error: Frame is invalid.
@ 2024-09-02  9:31 oleg.tolmatcev at gmail dot com
  2024-09-04 12:22 ` [Bug dap/32133] " tromey at sourceware dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: oleg.tolmatcev at gmail dot com @ 2024-09-02  9:31 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=32133

            Bug ID: 32133
           Summary: gdb.error: Frame is invalid.
           Product: gdb
           Version: 15.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: dap
          Assignee: unassigned at sourceware dot org
          Reporter: oleg.tolmatcev at gmail dot com
  Target Milestone: ---

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug dap/32133] gdb.error: Frame is invalid.
  2024-09-02  9:31 [Bug dap/32133] New: gdb.error: Frame is invalid oleg.tolmatcev at gmail dot com
@ 2024-09-04 12:22 ` tromey at sourceware dot org
  2024-09-23 18:07 ` oleg.tolmatcev at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2024-09-04 12:22 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=32133

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |tromey at sourceware dot org
   Last reconfirmed|                            |2024-09-04

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Big oversight!  Thanks for finding this.
I suspect expression evaluation will also need this fix.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug dap/32133] gdb.error: Frame is invalid.
  2024-09-02  9:31 [Bug dap/32133] New: gdb.error: Frame is invalid oleg.tolmatcev at gmail dot com
  2024-09-04 12:22 ` [Bug dap/32133] " tromey at sourceware dot org
@ 2024-09-23 18:07 ` oleg.tolmatcev at gmail dot com
  2024-12-04 16:06 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: oleg.tolmatcev at gmail dot com @ 2024-09-23 18:07 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=32133

--- Comment #2 from Oleg Tolmatcev <oleg.tolmatcev at gmail dot com> ---
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?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug dap/32133] gdb.error: Frame is invalid.
  2024-09-02  9:31 [Bug dap/32133] New: gdb.error: Frame is invalid oleg.tolmatcev at gmail dot com
  2024-09-04 12:22 ` [Bug dap/32133] " tromey at sourceware dot org
  2024-09-23 18:07 ` oleg.tolmatcev at gmail dot com
@ 2024-12-04 16:06 ` tromey at sourceware dot org
  2024-12-13 16:46 ` cvs-commit at gcc dot gnu.org
  2024-12-13 16:49 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2024-12-04 16:06 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=32133

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |16.1

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug dap/32133] gdb.error: Frame is invalid.
  2024-09-02  9:31 [Bug dap/32133] New: gdb.error: Frame is invalid oleg.tolmatcev at gmail dot com
                   ` (2 preceding siblings ...)
  2024-12-04 16:06 ` tromey at sourceware dot org
@ 2024-12-13 16:46 ` cvs-commit at gcc dot gnu.org
  2024-12-13 16:49 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-12-13 16:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=32133

--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=83c1269833c88608dac27edf78afc335ca8dbff1

commit 83c1269833c88608dac27edf78afc335ca8dbff1
Author: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
Date:   Mon Aug 26 23:11:36 2024 +0200

    gdb-dap: fix gdb.error: Frame is invalid.

    When you try to use a frame on one thread and it was created on
    another you get an error. I fixed it by creating a map from a frame ID
    to a thread ID. When a frame is created it is added to the map. When
    you try to find a frame for an id it checks if it is on the correct
    thread and if not switches to that thread. I had to store the frame id
    instead of the frame itself in a "_ScopeReference".

    Signed-off-by: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32133
    Approved-By: Tom Tromey <tom@tromey.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug dap/32133] gdb.error: Frame is invalid.
  2024-09-02  9:31 [Bug dap/32133] New: gdb.error: Frame is invalid oleg.tolmatcev at gmail dot com
                   ` (3 preceding siblings ...)
  2024-12-13 16:46 ` cvs-commit at gcc dot gnu.org
@ 2024-12-13 16:49 ` tromey at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2024-12-13 16:49 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=32133

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-13 16:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-02  9:31 [Bug dap/32133] New: gdb.error: Frame is invalid oleg.tolmatcev at gmail dot com
2024-09-04 12:22 ` [Bug dap/32133] " tromey at sourceware dot org
2024-09-23 18:07 ` oleg.tolmatcev at gmail dot com
2024-12-04 16:06 ` tromey at sourceware dot org
2024-12-13 16:46 ` cvs-commit at gcc dot gnu.org
2024-12-13 16:49 ` tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).