[lldb-dev] Misinterpreting Symbols Issue since LLDB-310

Lei Shi cosmo.shih at gmail.com
Wed Jan 21 23:13:17 PST 2015


My current solution is change the code from this:

void
Target::SetExecutableModule (ModuleSP& executable_sp, bool
get_dependent_files)
{
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TARGET));
    ClearModules(false);

    if (executable_sp.get())
    {
        ...
    }
    ...
}

 to this:

void
Target::SetExecutableModule (ModuleSP& executable_sp, bool
get_dependent_files)
{
    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TARGET));
    //ClearModules(false);
    ModulesDidUnload (m_images, false);
    //m_section_load_history.Clear();
    m_images.Clear();
    m_scratch_ast_context_ap.reset();
    m_scratch_ast_source_ap.reset();
    m_ast_importer_ap.reset();

    if (executable_sp.get())
    {
        ...
    }
    ...
}

It's work, although, it isn't the right way.

I think these code needs refine by someone who familiar with lldb codebase.
Hope the issue would be fixed in the next Xcode release.

Best Wishes,
Lei Shi

On Tue, Jan 20, 2015 at 8:20 AM, Greg Clayton <gclayton at apple.com> wrote:

>
> > On Jan 18, 2015, at 6:38 PM, Lei Shi <cosmo.shih at gmail.com> wrote:
> >
> > Hi, everyone
> >
> > The Target::SetExecutableModule invoke Target::ClearModules at the very
> beginning. Target::ClearModules clears the m_section_load_histroy which
> maintains the section list of the target. the following symbol parsing
> phase needs section list of the executable. Empty section list will leads
> to Misinterpreting various symbol data including Function Starts.
>
> How are you setting up your symbols prior to setting the target
> executable? Or is the dynamic loader plug-in doing this? Either way the
> target's main executable should be set, then the sections should be setup.
>
> How are you getting this to happen?
>
> >
> > I've tried to fix the issue by avoiding clear the m_section_history in
> Target::SetExecutableModule. It's work, but I not show weather it's a
> proper way to fix the issue.
>
> This isn't the right way to do things. Let me know how you are getting
> Target::SetExecutableModule() to be called and I might be able to tell you
> more.
>
> >
> > Hope someone can review the fix.
> >
> > Best,
> > Lei Shi
> > _______________________________________________
> > lldb-dev mailing list
> > lldb-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150122/4da58992/attachment.html>


More information about the lldb-dev mailing list