[Lldb-commits] [PATCH] D94672: Implement vAttachOrWait
Augusto Noronha via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Jan 14 06:07:32 PST 2021
augusto2112 added inline comments.
================
Comment at: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:377
+ // by the desired name.
+ auto should_exclude_process = [&exclusion_list, &process_name,
+ &name_with_slash](
----------------
labath wrote:
> augusto2112 wrote:
> > There was an oversight on my last patch, where we could attach to a different process if it ended with the name of the process we want to attach to. For example if we want to attach to "bar", it could also attach to "foobar". I changed it so we exclude processes whose names aren't a perfect match ("bar") or end with a slash + process name ("path/to/bar"). Is this enough, or could there be other false positives?
> That is odd, because `GetNameAsStringRef` should already strip the path:
> ```
> llvm::StringRef ProcessInfo::GetNameAsStringRef() const {
> return m_executable.GetFilename().GetStringRef();
> }
> ```
> If that's not working for you, then I guess you need to figure out why is that function failing.
Oh I see. I just assumed that it could potentially return the full path, my bad. I believe simply comparing `info_name != process_name` will be sufficient then.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94672/new/
https://reviews.llvm.org/D94672
More information about the lldb-commits
mailing list