[Lldb-commits] [PATCH] D100146: [lldb] [gdb-remote client] Refactor handling qSupported

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 13 02:19:30 PDT 2021

mgorny marked 2 inline comments as done.
mgorny added inline comments.

Comment at: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:375
+    for (auto x : server_features) {
+      if (x == "qXfer:auxv:read+")
labath wrote:
> mgorny wrote:
> > labath wrote:
> > > not a big deal, but this probably shouldn't be auto.
> > Could you explain a bit? I thought `auto` is convenient here since the actual type is visible three lines higher.
> Well.. my reasoning was something like this:
> - llvm guidelines say that auto should be used (only?) when the type is obvious from context
> - "context" is not exactly specified, but I would take that to mean the enclosing expression/statement (not the statement two lines up). The use of `cast<Foo>` in the example supports this.
> - the actual type is not that complicated (llvm::StringRef), so it e.g. won't cause the line to be split in two
> - given the above, and the generally cautious approach to auto in llvm, its better to err on the side of spelling out the type
> But like I said, it's not a big deal...
Yeah, this makes sense.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list