public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0.
@ 2023-09-04  8:34 artem.sokolovskii at qt dot io
  2023-09-04  8:36 ` [Bug dap/30821] DAP GDB: " artem.sokolovskii at qt dot io
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: artem.sokolovskii at qt dot io @ 2023-09-04  8:34 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30821
           Summary: "this" have no children. It comes with
                    "variablesReference" 0.
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: dap
          Assignee: unassigned at sourceware dot org
          Reporter: artem.sokolovskii at qt dot io
  Target Milestone: ---

I request variables for scope and get "this" in the list but it has
variablesReference = 0. It means that the variable has no children.
https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
I have a simple class and I should see "i" variable as a child of "this". At
least I see it like this in not DAP GDB version.

class myClass
{
public:
   void increment()
   {
      ++i;
   }

private:
   int i = 0;
};

Log:
qtc.dbg.dapengine: dap response
QJsonObject({"body":{"variables":[{"name":"this","value":"0x7fffffffda40","variablesReference":0},{"name":"i","value":"0","variablesReference":0}]},"command":"variables","request_seq":29,"seq":208,"success":true,"type":"response"})

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
@ 2023-09-04  8:36 ` artem.sokolovskii at qt dot io
  2023-09-04 17:58 ` tromey at sourceware dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: artem.sokolovskii at qt dot io @ 2023-09-04  8:36 UTC (permalink / raw)
  To: gdb-prs

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

Artem Sokolovskii <artem.sokolovskii at qt dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|"this" have no children. It |DAP GDB: "this" have no
                   |comes with                  |children. It comes with
                   |"variablesReference" 0.     |"variablesReference" 0.

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
  2023-09-04  8:36 ` [Bug dap/30821] DAP GDB: " artem.sokolovskii at qt dot io
@ 2023-09-04 17:58 ` tromey at sourceware dot org
  2023-09-05 13:11 ` tromey at sourceware dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-09-04 17:58 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Yes, pointers ought to have a single child.

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
  2023-09-04  8:36 ` [Bug dap/30821] DAP GDB: " artem.sokolovskii at qt dot io
  2023-09-04 17:58 ` tromey at sourceware dot org
@ 2023-09-05 13:11 ` tromey at sourceware dot org
  2023-09-05 13:53 ` artem.sokolovskii at qt dot io
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-09-05 13:11 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
I'm not really sure how references ought to behave.
My current patch treats them identically to pointers,
where a reference has a single child, which is the value.
But maybe they should just be completely invisible?

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
                   ` (2 preceding siblings ...)
  2023-09-05 13:11 ` tromey at sourceware dot org
@ 2023-09-05 13:53 ` artem.sokolovskii at qt dot io
  2023-09-05 15:18 ` tromey at sourceware dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: artem.sokolovskii at qt dot io @ 2023-09-05 13:53 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Artem Sokolovskii <artem.sokolovskii at qt dot io> ---
I don't fully understand your question. From my side, I just should get a tree
kind of thing.

I sent you the wrong response in the bug sorry. I'm getting this:
qtc.dbg.dapengine: "Content-Length: 186\r\n\r\n{\"request_seq\": 36, \"type\":
\"response\", \"command\": \"variables\", \"body\": {\"variables\":
[{\"variablesReference\": 0, \"name\": \"this\", \"value\":
\"0x7fffffffdab8\"}]}, \"success\": true, \"seq\": 87}"

So I'm getting "this" and the variablesReference is 0. So it means that it has
no children. But it has "i". So I should get "this" with variablesReference e.g
1. And then I could request variables for this variablesReference like this:
"Content-Length:
86\r\n\r\n{\"arguments\":{\"variablesReference\":1},\"command\":\"variables\",\"seq\":50,\"type\":\"request\"}"
And should get a list with "i" inside.

So for gdb without DAP it sends it this way("i" is a child of "this").

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
                   ` (3 preceding siblings ...)
  2023-09-05 13:53 ` artem.sokolovskii at qt dot io
@ 2023-09-05 15:18 ` tromey at sourceware dot org
  2023-09-05 19:47 ` tromey at sourceware dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-09-05 15:18 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
I have a patch for this but it should probably wait for this series:

https://sourceware.org/pipermail/gdb-patches/2023-August/201771.html

My current patch regresses gdb.dap/scopes.exp, because it expects
the 'char *' variable not to have structure.
I'm not totally sure if the above series handles that well, but
it seems like it would be necessary infrastructure for it at least.

Hmm, it's been 2 weeks, perhaps I'll put that in.

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
                   ` (4 preceding siblings ...)
  2023-09-05 15:18 ` tromey at sourceware dot org
@ 2023-09-05 19:47 ` tromey at sourceware dot org
  2023-09-06  8:52 ` artem.sokolovskii at qt dot io
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-09-05 19:47 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2023-September/202169.html

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
                   ` (5 preceding siblings ...)
  2023-09-05 19:47 ` tromey at sourceware dot org
@ 2023-09-06  8:52 ` artem.sokolovskii at qt dot io
  2023-09-07 14:46 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: artem.sokolovskii at qt dot io @ 2023-09-06  8:52 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Artem Sokolovskii <artem.sokolovskii at qt dot io> ---
Can I somehow check the patch? As far as I understood it is not merged yet.

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
                   ` (6 preceding siblings ...)
  2023-09-06  8:52 ` artem.sokolovskii at qt dot io
@ 2023-09-07 14:46 ` tromey at sourceware dot org
  2023-09-19 19:34 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-09-07 14:46 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Artem Sokolovskii from comment #6)
> Can I somehow check the patch? As far as I understood it is not merged yet.

You can download it from the mailing list (I use "b4" for this kind
of thing) or get it from my github:
https://github.com/tromey/gdb/commits/dap-30821-pointers

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
                   ` (7 preceding siblings ...)
  2023-09-07 14:46 ` tromey at sourceware dot org
@ 2023-09-19 19:34 ` cvs-commit at gcc dot gnu.org
  2023-09-19 19:34 ` tromey at sourceware dot org
  2023-09-20  9:25 ` artem.sokolovskii at qt dot io
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-19 19:34 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 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=a56e5dce69bfad45ee6977a916ccea283e087e8b

commit a56e5dce69bfad45ee6977a916ccea283e087e8b
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Sep 5 09:13:14 2023 -0600

    Handle pointers and references correctly in DAP

    A user pointed out that the current DAP variable code does not let the
    client deference a pointer.  Oops!

    Fixing this oversight is simple enough -- adding a new no-op
    pretty-printer for pointers and references is quite simple.

    However, doing this naive caused a regession in scopes.exp, which
    expected there to be no children of a 'const char *' variable.  This
    problem was fixed by the preceding patches in the series, which ensure
    that a C type of this kind is recognized as a string.

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

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

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
                   ` (8 preceding siblings ...)
  2023-09-19 19:34 ` cvs-commit at gcc dot gnu.org
@ 2023-09-19 19:34 ` tromey at sourceware dot org
  2023-09-20  9:25 ` artem.sokolovskii at qt dot io
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2023-09-19 19:34 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.1
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

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

* [Bug dap/30821] DAP GDB: "this" have no children. It comes with "variablesReference" 0.
  2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
                   ` (9 preceding siblings ...)
  2023-09-19 19:34 ` tromey at sourceware dot org
@ 2023-09-20  9:25 ` artem.sokolovskii at qt dot io
  10 siblings, 0 replies; 12+ messages in thread
From: artem.sokolovskii at qt dot io @ 2023-09-20  9:25 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from Artem Sokolovskii <artem.sokolovskii at qt dot io> ---
Thank you!

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

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

end of thread, other threads:[~2023-09-20  9:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04  8:34 [Bug dap/30821] New: "this" have no children. It comes with "variablesReference" 0 artem.sokolovskii at qt dot io
2023-09-04  8:36 ` [Bug dap/30821] DAP GDB: " artem.sokolovskii at qt dot io
2023-09-04 17:58 ` tromey at sourceware dot org
2023-09-05 13:11 ` tromey at sourceware dot org
2023-09-05 13:53 ` artem.sokolovskii at qt dot io
2023-09-05 15:18 ` tromey at sourceware dot org
2023-09-05 19:47 ` tromey at sourceware dot org
2023-09-06  8:52 ` artem.sokolovskii at qt dot io
2023-09-07 14:46 ` tromey at sourceware dot org
2023-09-19 19:34 ` cvs-commit at gcc dot gnu.org
2023-09-19 19:34 ` tromey at sourceware dot org
2023-09-20  9:25 ` artem.sokolovskii at qt dot io

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).