[lldb-dev] Why is function not present in target?

Pavel Labath via lldb-dev lldb-dev at lists.llvm.org
Fri Feb 10 04:51:54 PST 2017


On 10 February 2017 at 12:30, Ramkumar Ramachandra via lldb-dev
<lldb-dev at lists.llvm.org> wrote:
> Hi,
>
> This has been the source of much frustration, but I can't quite figure out
> why my toString() member function is not present in the target, according to
> lldb. The other functions in the compile unit are used and present, so the
> linker couldn't have eliminated the compile unit. Nor could the function
> have been inlined, because it is not used anywhere (it's written solely for
> the purpose of being used within lldb), so there's nowhere to inline into.
>
> So where is my function? And why isn't lldb picking it up?


Hi,

a have couple of question to better understand the situation:
- what is the system you are trying this out on (OS, arch, ...)?
- are you using any funny compiler options that you think we should
know about ? (e.g. if you're using -ffunction-sections
-Wl,--gc-sections, then the function could have been removed even if
the parts of the compile unit stay)
- how exactly is your function declared? (e.g. if it's declared as
inline, or a template and unused then the compiler might not bother
emitting it)
- could you verify (e.g. by running "objdump -t") that your function
is indeed present in the resulting binary?

cheers,
pavel


More information about the lldb-dev mailing list