Commit Graph

15 Commits

Author SHA1 Message Date
Jason Molenda 9b1cb0e171 Platform gdb RSP packet doc fixes based on implementation behavior
Reviewing some recent fixes to the platform packet implementations
in lldb, I saw the docs were out of sync in a few spots.  Updated them.

Differential Revision: https://reviews.llvm.org/D118842
2022-02-07 23:51:46 -08:00
Michał Górny 9929cfbcd5 [lldb] [gdb-remote] Use hexadecimal numbers in vFile packats for GDB compliance
Use hexadecimal numbers rather than decimal in various vFile packets
in order to fix compatibility with gdbserver.  This also changes the few
custom LLDB packets -- while technically they do not have to be changed,
it is easier to use the same syntax consistently across LLDB.

Differential Revision: https://reviews.llvm.org/D107475
2021-08-09 12:07:33 +02:00
Michał Górny 8bbef4f9af [lldb] [gdb-remote] Sync vFile:open mode constants with GDB
Sync the mode constants used to drive vFile:open requests with these
used by GDB and defined for the gdb remote protocol.  This makes it
possible to use 'platform file open' after connecting to gdbremote
server (and to some degree to operate on the open file modulo other
incompatibilities).

Differential Revision: https://reviews.llvm.org/D106985
2021-08-09 12:07:18 +02:00
Michał Górny 14735cab65 [lldb] [gdb-remote] Add eOpenOptionReadWrite for future gdb compat
Modify OpenOptions enum to open the future path into synchronizing
vFile:open bits with GDB.  Currently, LLDB and GDB use different flag
models effectively making it impossible to match bits.  Notably, LLDB
uses two bits to indicate read and write status, and uses union of both
for read/write.  GDB uses a value of 0 for read-only, 1 for write-only
and 2 for read/write.

In order to future-proof the code for the GDB variant:

1. Add a distinct eOpenOptionReadWrite constant to be used instead
   of (eOpenOptionRead | eOpenOptionWrite) when R/W access is required.

2. Rename eOpenOptionRead and eOpenOptionWrite to eOpenOptionReadOnly
   and eOpenOptionWriteOnly respectively, to make it clear that they
   do not mean to be combined and require update to all call sites.

3. Use the intersection of all three flags when matching against
   the three possible values.

This commit does not change the actual bits used by LLDB.

Differential Revision: https://reviews.llvm.org/D106984
2021-08-09 12:06:59 +02:00
Kazu Hirata 4fd3347d6e [lldb] Fix typos in documentation (NFC) 2021-03-01 23:40:29 -08:00
David Spickett f8a3b9b06c [lldb] Correct vFile:pread/pwrite packet docs
The statement that lldb-server can handle
decimal and hex numbers is misleading.
(it can only handle hex with 0x prefix)

Mentioning non decimal numbers at all
is just creating more confusion for anyone
who tries to use them with lldb-server.

Differential Revision: https://reviews.llvm.org/D89383
2020-10-27 11:47:35 +00:00
David Spickett 2d1ee7cae9 [lldb] Note difference in vFile:pread/pwrite format for lldb
https://sourceware.org/gdb/current/onlinedocs/gdb/Host-I_002fO-Packets.html

States that all numbers should be hexidecimal but lldb
uses decimals in vFile:pread and vFile:pwrite.

lldb-server can accept either since it ends up using
strtoull which will detect the base being used.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D89227
2020-10-12 15:09:49 +01:00
Gongyu Deng 3cd8d7b172 [lldb] Remote disk file/directory completion for platform commands
1. Extended the gdb-remote communication related classes with disk file/directory
   completion functions;
2. Added two common completion functions RemoteDiskFiles and
   RemoteDiskDirectories based on the functions above;
3. Added completion for these commands:
   A. platform get-file <remote-file> <local-file>;
   B. platform put-file <local-file> <remote-file>;
   C. platform get-size <remote-file>;
   D. platform settings -w <remote-dir>;
   E. platform open file <remote-file>.
4. Added related tests for client and server;
5. Updated docs/lldb-platform-packets.txt.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D85284
2020-08-24 17:55:54 +02:00
Kazuaki Ishizaki e9264b746b [lldb] NFC: Fix trivial typo in comments, documents, and messages
Differential Revision: https://reviews.llvm.org/D77460
2020-04-07 01:06:16 +09:00
Jason Molenda 984d08c680 Expand on the qfProcessInfo documentation, add examples from
lldb-gdb-remote.txt and text explaining the no-criteria mode.

llvm-svn: 373789
2019-10-04 21:01:52 +00:00
Jason Molenda c14a6ae4a7 Add a description of the similar packets defined in the
gdb-remote serial protocol documentation, call out the 
incompatability of lldb's vFile:open: packet as it stands
today.  Need to think about whether to change lldb's
enum values (breaking any existing lldb-server's out there)
or create a different packet and abandon vFile:open: at
least for a while.

llvm-svn: 349316
2018-12-16 18:44:54 +00:00
Jason Molenda 65b60ba8b2 Clarify a few minor details.
llvm-svn: 349313
2018-12-16 18:33:58 +00:00
Jason Molenda fbdb8b2e1c Update the vFile:open: description to note that the flags
in the packet are lldb enum values, not the open(2) oflags -- 
forgot about that wrinkle.  Also added a comment to File.h 
noting that the existing values cannot be modified or we'll
have a compatibilty break with any alternative platform
implementations, or older versions of lldb-server.

llvm-svn: 349282
2018-12-15 18:40:38 +00:00
Jason Molenda 4e67b0a61a Ah, forgot qModuleInfo. Need to look that one up
and finish filling this in.

llvm-svn: 349232
2018-12-15 02:51:01 +00:00
Jason Molenda f1127d5224 A brief outline of the packets that need to be implemented
to write an lldb platform server that doesn't link against
LLDB.framework to be able to fully run the lldb testsuite
on a remote system.  The platform packets weren't covered 
in the existing lldb-gdb-remote.txt doc, so I wanted to 
jot them down in one place.

llvm-svn: 349231
2018-12-15 02:36:39 +00:00