Re: [Lldb-commits] [PATCH] D62221: [lldb-server][LLGS] Support 'g' packets

2019-10-04 Thread Guilherme Andrade via lldb-commits
Thank you for the suggestion, Jason! The feature is like this
https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-use-the-registers-window?view=vs-2019
- the user can select the register sets they want to see. There's an extra
complication, though. I am using the C++ API, so I actually get the
registers by calling SBFrame::GetRegisters(), and as I start retrieving
their fields, the `p` packets are lazily exchanged. Do you know if there is
a way to get their values up front from that API, or a way to modify that
lazy behavior?

On Wed, May 22, 2019 at 8:59 PM Jason Molenda via Phabricator <
revi...@reviews.llvm.org> wrote:

> jasonmolenda added a comment.
>
> Does your feature print *all* the registers including floating
> point/vector registers?  Or just the main general purpose registers?  In
> debugserver, we expedite the register values for the stopping thread:
>
> 1558572448.355979919 < 624> read packet:
> $T05thread:3ef471;threads:3ef471;thread-pcs:10001e939;00:d803;01:0080536cff7f;02:d803;03:b0e0bfeffe7f;04:;05:2900;06:a0e2bfeffe7f;07:a8e0bfeffe7f;08:;09:;0a:;0b:;0c:00e2bfeffe7f;0d:b0e2bfeffe7f;0e:;0f:2900;10:39e901000100;11:4602;12:2b00;13:;14:;metype:6;mecount:2;medata:2;medata:0;memory:0x7ffeefbfe2a0=10e7bfeffe7f06528a6dff7f;memory:0x7ffeefbfe710=40e7bfeffe7f86838b6dff7f;#00
>
> because the cost of sending all the register values every time is
> miniscule.  When we are at a "public stop" (visible to the user), we may
> need to get information about *all* the threads - for this, we use the
> JSON-formatted jThreadsInfo packet which gives you the GPR register values
> for every thread (in this example, there is only one thread) -
>
> 1558572448.379079103 <  16> send packet: $jThreadsInfo#c1
> 1558572448.379371881 <1609> read packet:
> $[{"tid":4125809,"metype":6,"medata":[2,0],"reason":"exception","qaddr":4295855808,"associated_with_dispatch_queue":true,"dispatch_queue_t":140735794523072,"qname":"com.apple.main-thread","qkind":"serial","qserialnum":1,"registers":{"0":"","1":"c0f9bfeffe7f","2":"0200","3":"1000","4":"0006","5":"d34c566cff7f","6":"50e5bfeffe7f","7":"f8e4bfeffe7f","8":"4400","9":"4002","10":"0300","11":"4602","12":"583a566cff7f","13":"753a566cff7f","14":"","15":"","16":"66b7a56dff7f","17":"4602","18":"2b00","19":"","20":""}],"memory":[{"address":140732920751440,"bytes":"80e5bfeffe7f32d0846dff7f"}],{"address":140732920751488,"bytes":"a0e5bfeffe7ff490856dff7f"}],{"address":140732920751520,"bytes":"d0e5bfeffe7f91e7766aff7f"}],{"address":140732920751568,"bytes":"70e6bfeffe7ffe15896dff7f"}],{"address":140732920751728,"bytes":"b0e6bfeffe7fde14896dff7f"}],{"address":140732920751792,"bytes":"10e7bfeffe7ffd7e8a6dff7f"}],{"address":140732920751888,"bytes":"40e7bfeffe7fcf838b6dff7f"}],{"address":140732920751936,"bytes":"d0edbfeffe7f986901000100"}],{"address":140732920753616,"bytes":"40f7bfeffe7f3a4001000100"}],{"address":140732920756032,"bytes":"60f8bfeffe7f27e20100"}],{"address":140732920756320,"bytes":"88f8bfeffe7f25e00100"}],{"address":140732920756360,"bytes":"0100"}]]}]]#00
>
> I think for your use case, having lldb-server provide all the values up
> front (if it isn't already) is the approach you should take.
>
> (the only thing that's might be unexpected is that the register values &
> memory data are sent as *strings* - JSON only represents numbers in base10;
> this is sending the register & memory data in target-endian order, little
> endian here, in the hex-bytes strings.)
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D62221/new/
>
> https://reviews.llvm.org/D62221
>
>
>
> --
Guilherme Andrade | Software Engineer | guiandr...@google.com | Google
Waterloo, Canada 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D62931: [lldb-server] Add setting to force 'g' packet use

2019-11-08 Thread Guilherme Andrade via lldb-commits
Hey Jason,

Sorry, I think I ended up accidentally dropping the verification in the
final version (
https://github.com/llvm/llvm-project/blob/b1b70f6761266c3eecaf8bd71529eaf51994207b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp#L307).
I had
implemented GDBRemoteCommunicationClient::GetgPacketSupported previously,
though (https://reviews.llvm.org/D62931?id=226779). So maybe we could just
hook that up again? I.e., read_all_registers_at_once = !pSupported ||
(gdb_process->m_use_g_packet_for_reading && gSupported).

Thanks!

On Fri, Nov 8, 2019 at 7:15 PM Jason Molenda  wrote:

> A heads-up - lldb is failing to detect the case where the remote gdb RSP
> stub does not support the 'g' packet.  I found this while doing some bare
> board debugging; g fails and doesn't fall back to fetching register values
> individually.
>
> I wrote a test TestNoGPacketSupported.py to show this behavior - it's
> currently marked as @expectedFailureAll.  If I add the
> plugin.process.gdb-remote.use-g-packet-for-reading = false setting, the
> test case passes, but of course we can't require people to use that.  lldb
> has to be adaptive to the packets that the remote stub supports.
>
>
> I'll try to look at the updating the changes to work correctly in this
> environment, but I wanted to raise the issue more widely in case anyone has
> a chance before me.
>
>
> J
>
>
> > On Oct 30, 2019, at 9:30 AM, Guilherme Andrade via Phabricator <
> revi...@reviews.llvm.org> wrote:
> >
> > guiandrade added a comment.
> >
> > In D62931#1726865 , @labath
> wrote:
> >
> >> This looks fine to me. Thanks for your patience. Do you still need
> someone to commit this for you?
> >
> >
> > Np. Yes, I do. Could you please do it for me?
> >
> > Thanks!
> >
> >
> > Repository:
> >  rG LLVM Github Monorepo
> >
> > CHANGES SINCE LAST ACTION
> >  https://reviews.llvm.org/D62931/new/
> >
> > https://reviews.llvm.org/D62931
> >
> >
> >
>
>

--
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits