<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/76332>76332</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLDB ignores breakpoints set in lib loaded using dlopen
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mehlian
      </td>
    </tr>
</table>

<pre>
    Hello, I have difficulty setting the lldb debugger correctly to be able to set breakpoints and stopping the program in a library loaded dynamically from the code using the dlopen function.

Here is my setup:
- in Windows 10 I compile the code into two libraries: libmain.so and libsup.so
- in both cases the code is compiled as follows:
> clang++ [sourceCodePath] --target=aarch64-linux-androideabi26 -shared -v -g -fPIC -fstack-protector-strong -Werror -Wl,--no-undefined-version -Wl,-undefined,error -Wl,--error-unresolved-symbols -Wl,--no-undefined -Wl,-error-limit=0 -mno-relax -static-libstdc++ -landroid -llog -lEGL -lGLESv3 -lm -o [outputDirPath]/lib[libname].so

- next, an APK package for Android is created and the libmain.so library is added to it
- APK is installed on Android 10 device using ADB
- the Android application installs and runs correctly
- debugging this application using lldb also works correctly (you can set breakpoints and the source code is displayed when the program stops at this breakpoint)

- then second compiled library libsup.so is sent to the device via ADB to the directory created after installing application (/data/data/com.company.testapp/)
- in the libmain.so library there is a piece of code that dynamically loads the libsup.so library

```
auto supModule = dlopen("/data/data/com.company.testapp/libsup.so", RTLD_NOW);
if(supModule)
{
     LOGV("Module found");
     auto supFunc = (void (*)())dlsym(supModule, "supModuleFunction");
 if(supFunc)
     {
         LOGV("Sup function found");
 supFunc();
     }
}
```

- the "supModuleFunction" function in libsup.so is a regular function that logs a string to the console.

This setup works - the "supModuleFunction" function is found and called correctly. The problem is that I cannot set a breakpoint inside the "supModuleFunction" function, and when I try to enter this function using the "step-into" command, the debbuger behaves as if I had entered the "continue" command, ignoring the contents of the libsup.so library.

Using 'image list' command doesn't help - there is no 'libsup.so' on the list but 'libmain.so' was found.

Any advice?

Systems and tools:
Windows 10
Android 10
clang++ 14.0.6
lldb 17.0.0-custom rust-enabled
lldb-server 14.0.6git (revision 4c603efb0cca074e9238af8b4106c30add4418f6)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVl2P4joS_TXmpWQUHBrCAw_dMMxtbe_e0c7szuPKsSvBO44d-YMe_v3KTkLgbo80rRaQ2FV1XFXnuLj3qjWIe_L0Qp6OCx7D2bp9h2etuFnUVl73f6DWlrADvMKZXxCkaholog5X8BiCMi2EM4LWsgaJdWxbdCCscyiCvkKwUCPwWmP66TFA7ZD_6K0ywQM3EnywfT-56Z1tHe9AGeCgVe24u4K2XKIEeTW8U4JrfYXG2S4bCCsRop_spbY9GmiiEUFZsyTFkRTPw-cf6BCUhy4jjz0pxwWawn1XRtp3D6sCXkHYrlcJ8hRBmWAhvNsRk0JPyuf00HFllt7mk2hV-9gvvb1zW9twBsE9-jtnfgoggXtorNb23d_gkPITCM1NS9gLYS9Anl68jU7gwUr8wsOZPB2B0sBdi4GUR86dOG_WVCsTf1JupLNKIq8V2wD1Z-5QAr0AbYE2X14PQBsfuPhBe2cDimAd9cFZ0wL9js5ZB_S7JuxAqbE0GomNMijpBZ1X1kyLtwXCDo9W-YlG49BbfUFJ_bWrrfYfup1eDkZadSqdqADaGUsdav4TqA88KEFTdoMUY1KoHg8KVGvbAtWfPr8B1Z_fPn29lEB1B9Sm1NkY-hiOyo2ZI-ykVU2eXrSqDe-QPB1vFZvqZvBnSC3PDTx_-Rv0XPzgLUJjHTyPUVMNHfKQSmjkQIG5G6bOVR64TL0bLKgwuU8-lQdlfOA6NYE1N7-rAiRelJia-vn4MpmlGNM23vdaCZ56fPIzsMlF42f6TaYDMQeSJEx31kOYTF-uvYV3637ceQDCqquNILj5kL0J1NCdt96WyveaX1HC-xnNA60T1z3wMMCYfRG2e6xASJYehTVy5spNDyaepWgeTUjpzewfMndRP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