<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
FYI,<br>
<br>
I found the solution to the problem:<br>
DYLD_* env variables are purged from the environment due to SIP in
El Capitan.<br>
It is necessary to set any DYLD_* variable settings within (lldb)<br>
<br>
e.g.<br>
<pre>lldb -f DARWIN_X64/test_app
(lldb) target create "DARWIN_X64/test_app"
Current executable set to 'DARWIN_X64/test_app' (x86_64).
(lldb) env DYLD_LIBRARY_PATH=<directory where lib lives>
(lldb) r
then the shared lib is honored as expected inside lldb.
</pre>
<div class="moz-forward-container">-------- Forwarded Message
--------
<table class="moz-email-headers-table" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject:
</th>
<td>lldb with app using shared lib not working</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
<td>Thu, 19 Nov 2015 13:24:46 +0100</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
<td>Andre Alefeld <a class="moz-txt-link-rfc2396E" href="mailto:aalefeld@univa.com"><aalefeld@univa.com></a></td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
<td><a class="moz-txt-link-abbreviated" href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>Hi,
if I try to debug an application from the terminal that is using a
shared lib lldb complains always about not finding the library even
though everything is loading correctly when starting the app directly
from the same terminal:
echo $DYLD_LIBRARY_PATH/
<some path>
running with debugger, shared lib can be loaded:
test_app
otool -L DARWIN_X64/test_app
DARWIN_X64/test_app:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 1225.1.1)
libmyapp.dylib (compatibility version 0.0.0, current version 0.0.0)
lldb -f DARWIN_X64/test_app
(lldb) target create "DARWIN_X64/test_app"
Current executable set to 'DARWIN_X64/test_app' (x86_64).
(lldb) r
Process 32234 launched: '/Users/xxx/yyy/zzz/source/DARWIN_X64/test_app'
(x86_64)
dyld: Library not loaded: libmyapp.dylib
Referenced from: /Users/xxx/yyy/zzz/source/DARWIN_X64/test_app
Reason: image not found
Process 32234 stopped
* thread #1: tid = 0x85c524, 0x00007fff5fc01075 dyld`dyld_fatal_error +
1, stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
frame #0: 0x00007fff5fc01075 dyld`dyld_fatal_error + 1
dyld`dyld_fatal_error:
-> 0x7fff5fc01075 <+1>: nop
dyld`dyldbootstrap::start:
0x7fff5fc01076 <+0>: pushq %rbp
0x7fff5fc01077 <+1>: movq %rsp, %rbp
0x7fff5fc0107a <+4>: pushq %r15
how can I achieve that the shared lib is used in the debugger correctly,
do I have to set some additional environment variables. Is there a
special r (process launch) syntax that I need to use ?
in gdb it used to work like a charm...
thanks for any help you can deliver in advance,
Andre
</pre>
<br>
</div>
<br>
</body>
</html>