[PATCH] D78179: [Darwin] Fix symbolization for recent simulator runtimes.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 13:27:35 PDT 2020


delcypher marked an inline comment as done.
delcypher added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp:102
+      // `atos_mach_port_env_var_entry_` variable with our current PID.
+      UpdateAtosEnvVar(pid_str_);
+    }
----------------
delcypher wrote:
> yln wrote:
> > If you remove the unnecessary call in the constructor, then this is the only usage of the function and we can inline it.
> @yln 
> 
> > If you remove the unnecessary call in the constructor, then this is the only usage of the function and we can inline it.
> 
> The call in the constructor is **essential**. When you call `putenv()` Darwin's LibC checks the data is well formed so we **have to initialize `atos_mach_port_env_var_entry_` before giving it to `putenv()`**.
> 
> Later on we need to modify `atos_mach_port_env_var_entry_`  again to have it contain the right PID so it made sense to refactor this repeated action into `UpdateAtosEnvVar()`.
@yln Sorry a little bit more on this. The call to `UpdateAtosEnvVar()` is essential but it doesn't actually need to be in the constructor. We could move it into `LateInitialize()` to set `atos_mach_port_env_var_entry_` just before we give it to `putenv()`. Is that what you'd prefer?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78179





More information about the llvm-commits mailing list