public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response
@ 2023-07-22 23:49 vmakaev at gmail dot com
  2023-07-23  0:21 ` [Bug gdb/30665] " vmakaev at gmail dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: vmakaev at gmail dot com @ 2023-07-22 23:49 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30665
           Summary: DAP Server: Relative paths in stacktrace response
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vmakaev at gmail dot com
  Target Milestone: ---

Created attachment 14996
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14996&action=edit
Log files and main.rs

When debugging with newly added DAP server my VSCode shows me and error 

"Could not load source 'main.rs': 'source'."

The same binary debugged with LLDB DAP works correctly. Most likely the issue
is due to some responses from DAP having relative path instead of absolute path

Attaching logs from debugging session with gdb and lldb and also a main.rs
program.


(to compile I used "rustc -g main.rs")

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

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

* [Bug gdb/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
@ 2023-07-23  0:21 ` vmakaev at gmail dot com
  2023-07-23  0:42 ` [Bug dap/30665] " vmakaev at gmail dot com
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: vmakaev at gmail dot com @ 2023-07-23  0:21 UTC (permalink / raw)
  To: gdb-prs

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

Vladimir Makaev <vmakaev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org,
                   |                            |vmakaev at gmail dot com

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
  2023-07-23  0:21 ` [Bug gdb/30665] " vmakaev at gmail dot com
@ 2023-07-23  0:42 ` vmakaev at gmail dot com
  2023-07-23 14:57 ` vmakaev at gmail dot com
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: vmakaev at gmail dot com @ 2023-07-23  0:42 UTC (permalink / raw)
  To: gdb-prs

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

Vladimir Makaev <vmakaev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|gdb                         |dap

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
  2023-07-23  0:21 ` [Bug gdb/30665] " vmakaev at gmail dot com
  2023-07-23  0:42 ` [Bug dap/30665] " vmakaev at gmail dot com
@ 2023-07-23 14:57 ` vmakaev at gmail dot com
  2023-07-23 17:48 ` tromey at sourceware dot org
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: vmakaev at gmail dot com @ 2023-07-23 14:57 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Vladimir Makaev <vmakaev at gmail dot com> ---
Created attachment 14997
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14997&action=edit
patch

Added proposed patch

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (2 preceding siblings ...)
  2023-07-23 14:57 ` vmakaev at gmail dot com
@ 2023-07-23 17:48 ` tromey at sourceware dot org
  2023-07-23 17:48 ` tromey at sourceware dot org
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-23 17:48 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
The gdb log has:

4:38:59 PM  <-- stackTrace
{"request_seq":11,"type":"response","command":"stackTrace","body":{"stackFrames":[{"id":0,"name":"main::main","line":3,"column":0,"instructionPointerReference":"0x555555408175","source":{"name":"main.rs","path":"main.rs","sourceReference":0}}]},"success":true,"seq":37}

... whereas the lldb log uses "path":"/home/vmakaev/gdb-test/main.rs".

gdb also sends this "path" value in other spots, so it seems specific
to stack trace.

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (3 preceding siblings ...)
  2023-07-23 17:48 ` tromey at sourceware dot org
@ 2023-07-23 17:48 ` tromey at sourceware dot org
  2023-07-24 14:56 ` tromey at sourceware dot org
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-23 17:48 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
That patch would work except we recently changed this code to use
frame filters.
Perhaps FrameDecorator needs to change.

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (4 preceding siblings ...)
  2023-07-23 17:48 ` tromey at sourceware dot org
@ 2023-07-24 14:56 ` tromey at sourceware dot org
  2023-07-24 15:00 ` tromey at sourceware dot org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-24 14:56 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
I think it's kind of difficult to write a test for this
that can live in-tree, due to how the test suite works.
Anyway I have a patch you can try, will upload shortly.

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (5 preceding siblings ...)
  2023-07-24 14:56 ` tromey at sourceware dot org
@ 2023-07-24 15:00 ` tromey at sourceware dot org
  2023-07-24 15:02 ` tromey at sourceware dot org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-24 15:00 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
Maybe the testing could be done by also implementing 'cwd'
in the launch request, a la
https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/issues/90

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (6 preceding siblings ...)
  2023-07-24 15:00 ` tromey at sourceware dot org
@ 2023-07-24 15:02 ` tromey at sourceware dot org
  2023-07-24 16:26 ` tromey at sourceware dot org
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-24 15:02 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #14997|0                           |1
        is obsolete|                            |

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
Created attachment 15006
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15006&action=edit
patch

Could you try this patch in your setup?

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (7 preceding siblings ...)
  2023-07-24 15:02 ` tromey at sourceware dot org
@ 2023-07-24 16:26 ` tromey at sourceware dot org
  2023-07-24 17:20 ` vmakaev at gmail dot com
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-24 16:26 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
The "cwd" thing is super wrong because what really matters is
passing a relative file name to gcc.

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (8 preceding siblings ...)
  2023-07-24 16:26 ` tromey at sourceware dot org
@ 2023-07-24 17:20 ` vmakaev at gmail dot com
  2023-07-24 18:23 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: vmakaev at gmail dot com @ 2023-07-24 17:20 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from Vladimir Makaev <vmakaev at gmail dot com> ---
I've updated my remote branch to point to the latest code (I think I had some
mirror before which wasn't updated). 

After applying the patch I confirm the issue is fixed. Thanks for looking into
it!

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (9 preceding siblings ...)
  2023-07-24 17:20 ` vmakaev at gmail dot com
@ 2023-07-24 18:23 ` tromey at sourceware dot org
  2023-07-25 13:50 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-24 18:23 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-07-24

--- Comment #9 from Tom Tromey <tromey at sourceware dot org> ---
Mine.

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (10 preceding siblings ...)
  2023-07-24 18:23 ` tromey at sourceware dot org
@ 2023-07-25 13:50 ` tromey at sourceware dot org
  2023-07-26 15:58 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-25 13:50 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2023-July/201097.html

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (11 preceding siblings ...)
  2023-07-25 13:50 ` tromey at sourceware dot org
@ 2023-07-26 15:58 ` tromey at sourceware dot org
  2023-08-01 18:55 ` cvs-commit at gcc dot gnu.org
  2023-08-01 18:56 ` tromey at sourceware dot org
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-07-26 15:58 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.1

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (12 preceding siblings ...)
  2023-07-26 15:58 ` tromey at sourceware dot org
@ 2023-08-01 18:55 ` cvs-commit at gcc dot gnu.org
  2023-08-01 18:56 ` tromey at sourceware dot org
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-01 18:55 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #11 from cvs-commit at gcc dot gnu.org <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=65403bd0ed22f7c26f972449403c97ff5e998b04

commit 65403bd0ed22f7c26f972449403c97ff5e998b04
Author: Tom Tromey <tromey@adacore.com>
Date:   Mon Jul 24 08:48:00 2023 -0600

    Full paths in DAP stackTrace responses

    Vladimir Makaev noticed that, in some cases, a DAP stackTrace response
    would include a relative path name for the "path" component.

    This patch changes the frame decorator code to add a new DAP-specific
    decorator, and changes the DAP entry point to frame filters to use it.
    This decorator prefers the symtab's full name, and does not fall back
    to the solib's name.

    I'm not entirely happy with this patch, because if a user frame filter
    uses FrameDecorator, it may still do the wrong thing.  It would be
    better to have frame filters return symtab-like objects instead, or to
    have a separate method to return the full path to the source file.

    I also tend to think that the solib fallback behavior of
    FrameDecorator is a mistake.  If this is ever needed, it seems to me
    that it should be a separate method.

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

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

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

* [Bug dap/30665] DAP Server: Relative paths in stacktrace response
  2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
                   ` (13 preceding siblings ...)
  2023-08-01 18:55 ` cvs-commit at gcc dot gnu.org
@ 2023-08-01 18:56 ` tromey at sourceware dot org
  14 siblings, 0 replies; 16+ messages in thread
From: tromey at sourceware dot org @ 2023-08-01 18:56 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #12 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] 16+ messages in thread

end of thread, other threads:[~2023-08-01 18:56 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-22 23:49 [Bug gdb/30665] New: DAP Server: Relative paths in stacktrace response vmakaev at gmail dot com
2023-07-23  0:21 ` [Bug gdb/30665] " vmakaev at gmail dot com
2023-07-23  0:42 ` [Bug dap/30665] " vmakaev at gmail dot com
2023-07-23 14:57 ` vmakaev at gmail dot com
2023-07-23 17:48 ` tromey at sourceware dot org
2023-07-23 17:48 ` tromey at sourceware dot org
2023-07-24 14:56 ` tromey at sourceware dot org
2023-07-24 15:00 ` tromey at sourceware dot org
2023-07-24 15:02 ` tromey at sourceware dot org
2023-07-24 16:26 ` tromey at sourceware dot org
2023-07-24 17:20 ` vmakaev at gmail dot com
2023-07-24 18:23 ` tromey at sourceware dot org
2023-07-25 13:50 ` tromey at sourceware dot org
2023-07-26 15:58 ` tromey at sourceware dot org
2023-08-01 18:55 ` cvs-commit at gcc dot gnu.org
2023-08-01 18:56 ` 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).