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 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits