[Lldb-commits] [PATCH] D107780: [lldb] [gdb-remote] Implement fallback to vFile:stat for GetFileSize()

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 8 04:17:32 PDT 2021


labath added inline comments.


================
Comment at: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h:56-70
+struct GDBRemoteFStatData {
+  uint32_t gdb_st_dev;
+  uint32_t gdb_st_ino;
+  uint32_t gdb_st_mode;
+  uint32_t gdb_st_nlink;
+  uint32_t gdb_st_uid;
+  uint32_t gdb_st_gid;
----------------
If we're going to have a struct for this anyway, then I think we should definitely use llvm's endian-specific types here. Then, instead of playing with DataExtractors, we can just memcpy the data here (the memcpy could go away as well with some changes to the StringExtractorGDBRemote interface)..


================
Comment at: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h:396
+
+  llvm::Optional<GDBRemoteFStatData> Stat(const FileSpec &file_spec);
+
----------------
If you make a note here that this is only a convenience wrapper around FStat (which opens the file in read mode), then the other comments are probably unnecessary...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107780/new/

https://reviews.llvm.org/D107780



More information about the lldb-commits mailing list