Step-in for shared library code not working

Hi, I’m trying to get lldb to step into a function which is defined within a shared library. Instead of stepping into the function, lldb always steps over it. Gdb behaves correctly. I can reproduce this using llvm 14 on a x86-64 Linux Mint 21 as well as on a aarch64 termux install.

Minimal repo:

lib.h:
class LibClass
{
public:
void PrintName();
};

lib.cpp:
#include “lib.h”

#include <stdio.h>

void LibClass::PrintName()
{
printf(“LibClass”);
}

app.cpp:
#include “lib.h”

int main(int argc, char** argv)
{
LibClass c;
c.PrintName();
}

compile with:
clang++ lib.cpp -shared -fPIC -o lib.so -g
clang++ app.cpp lib.so -g -o app

Then:
LD_LIBRARY_PATH=. lldb ./app
b app.cpp:6
r
s

Instead of stepping into PrintName lldb steps over it, while gdb behaves correctly.

Am I doing something wrong, or is this a bug? Any help in resolving this issue would be greatly appreciated.

It turns out that this is a bug that was introduced during llvm-14. It was fixed in llvm-15.
See lldb cannot step into a function if it existed in another shared library · Issue #54250 · llvm/llvm-project · GitHub