[lldb-dev] Allocation memory is failing in PPC64le
Pavel Labath via lldb-dev
lldb-dev at lists.llvm.org
Tue Dec 5 04:13:00 PST 2017
On linux, we allocate memory by setting up the inferior registers to appear
as if the inferior called mmap(2) upon resume. This is done in
InferiorCallMmap. You should check whether this function sets up the
context correctly. Things to look at are:
- did it find the mmap address correctly?
- are the mmap flags correct
- is ABI correct (did it put the flags in the right registers)
- after mmap returns, it should jump to the process entry point (where we
have placed a breakpoint). Does this happen?
- do you correctly restore the original registers afterwards
Looking at the gdb-remote packet log should give you some insight there. If
you can send the relevant parts over, I can give you a rough answer as to
how far along did it progress before things broke down.
On 5 December 2017 at 11:54, Alexandre Yukio Yamashita via lldb-dev <
lldb-dev at lists.llvm.org> wrote:
> Hi,
>
> I am trying to implement the expression evaluation for PPC64le using JIT.
> But the LLDB is failling to allocate memory when it tries to evaluate an
> expression.
> A Thread Plan is being interrupted before LLDB tries to allocate memory.
> How could I check why this plan is not finishing?
> What functions should I implement to enable JIT?
> I am sending the logs of the issue below.
>
> Thanks.
> Alexandre.
> lldb 0x10013069c10: tid = 0x976: stop info = breakpoint 1.1
> (stop_id = 4)
> lldb Process::RunThreadPlan(): execution interrupted:
> 0x3fff70006ac0 Event: broadcaster = 0x100130167b8 (lldb.process), type =
> 0x00000001 (state-changed), data = { process = 0x10013016780 (pid = 2422),
> state = stopped} <1 threads> <0x0976 [ip 0x1000058c] breakpoint 1.1>
> lldb Process::RunThreadPlan: ExecutionInterrupted - discarding
> thread plans up to 0x10013076210.
> lldb Discarding thread plans for thread tid = 0x0976, up to
> 0x10013076210
> lldb 0x10013025c10 Broadcaster("lldb.process")::RestoreBroadcaster
> (about to pop listener("lldb.process.listener.run-thread-plan")=
> 0x10012f85810)
> lldb 0x10012f85810 Listener::Clear('lldb.process.
> listener.run-thread-plan')
> lldb 0x10012f85810 Listener::~Listener('lldb.
> process.listener.run-thread-plan')
> lldb ThreadPlanCallFunction(0x10013076210): DoTakedown called
> as no-op for thread 0x0976, m_valid: 1 complete: 1.
>
> lldb Target::RemoveBreakpointByID (break_id = -3, internal =
> yes)
>
> lldb Target::DisableBreakpointByID (break_id = -3, internal =
> yes)
>
> lldb GDBRemoteCommunicationClient::SendGDBStoppointTypePacket()
> remove at addr = 0x100003d0
> lldb 0x10013017168 Communication::Write (src = 0x10012e7d318,
> src_len = 17) connection = 0x1001302e610
> lldb 0x1001302e610 ConnectionFileDescriptor::Write (src =
> 0x10012e7d318, src_len = 17)
> lldb 0x1001302e610 ConnectionFileDescriptor::Write(fd = 7,
> src = 0x10012e7d318, src_len = 17) => 17 (error = (null))
> lldb this = 0x0000010013017168, dst = 0x00003FFFED125FC8,
> dst_len = 8192, timeout = 99999999000000 us, connection = 0x000001001302E610
> lldb this = 0x000001001302E610, timeout = 99999999000000 us
> lldb 0x1001302e610 ConnectionFileDescriptor::Read() fd = 7,
> dst = 0x3fffed125fc8, dst_len = 8192) => 6, error = (null)
> lldb ProcessGDBRemote::DoAllocateMemory no direct stub
> support for memory allocation, and InferiorCallMmap also failed - is stub
> missing register context save/restore capability?
> lldb Process::DoAllocateMemory (byte_size = 0x00001000,
> permissions = rwx) => 0xffffffffffffffff
> lldb AllocatedMemoryCache::AllocateMemory (byte_size =
> 0x00000008, permissions = rwx) => 0xffffffffffffffff
> lldb Process::CanJIT pid 2422 allocation test failed, CanJIT
> () is false: unable to allocate 4096 bytes of memory with permissions rwx
> lldb AllocatedMemoryCache::DeallocateMemory (addr =
> 0xffffffffffffffff) => 0
>
>
> --
> Alexandre Yukio Yamashita (DSB)
> Instituto de Pesquisas Eldorado
> www.eldorado.org.br
> +55 19 3757 3201 <+55%2019%203757-3201> / +55 19 9 8336 5553
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20171205/653e2881/attachment.html>
More information about the lldb-dev
mailing list