[lldb-dev] [Bug 25806] New: Can't set breakpoint in static initializer

via lldb-dev lldb-dev at lists.llvm.org
Fri Dec 11 08:17:13 PST 2015


            Bug ID: 25806
           Summary: Can't set breakpoint in static initializer
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: tberghammer at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

LLDB don't detect the loading of a shared object file linked against the main
executable before the static initializers are executed for the given module.
Because of this it is not possible to get breakpoint hits in these static
initializers and to display proper debug info in case of a crash in these
codes. (The issue isn't happening for dlopen-ed libraries.)

The issue is demonstrated in TestLoadUnlod.py
LoadUnloadTestCase.test_static_init_during_load test case.

My current understanding of the problem:

The problem is that DynamicLoaderPOSIXDYLD first set a breakpoint on the entry
of the main executable based on the content of auxv (it will be libc.so'_start)
and then set the rendezvous breakpoint when the entry breakpoint is hit. The
static initializers are running before libc.so'_start is called so at this
point we haven't loaded the library list and haven't set the rendezvous
breakpoint either.

I think the correct solution to the problem is to change DynamicLoaderPOSIXDYLD
to set the (current) entry breakpoint at a location what is hit before any code
is executed, but I don't know what is the reasonable location for the
(something what works on all platforms).

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20151211/bd53af8f/attachment.html>

More information about the lldb-dev mailing list