<div dir="ltr">Hi all,<div><br></div><div>I'm trying to read the value of an environment variable that a process was launched with but to which lldb attached to after it launched. SBEnvironment looked interesting but I tried using </div><div>```</div><div>script print(lldb.debugger.GetSelectedTarget().GetEnvironment().Get("PRINT_ME")</div><div>```</div><div>and that prints 'None'. </div><div><br></div><div>I am able to get the value using</div><div>```</div><div>script addr = lldb.debugger.GetSelectedTarget().EvaluateExpression("(char *)getenv(\"PRINT_ME\")").GetValueAsUnsigned()<br></div><div>script err = lldb.SBError()<br></div><div>script print(lldb.debugger.GetSelectedTarget().GetProcess().ReadCStringFromMemory(addr, 1024, err))<br></div><div>```</div><div>but that seems like overkill for reading an environment variable. Is there a better way to do this that I'm missing?<br></div><div><br></div><div>I'm using the following program to quickly test things:</div><div>```</div><div>#include <stdio.h><br>#include <signal.h><br>#include <stdlib.h><br>int main() {<br>  raise(SIGSTOP);<br>  printf("%s\n", getenv("PRINT_ME"));<br>}<br></div><div>```<br></div></div>