gpt4 book ai didi

android - 如何将 C++ 源代码解析为 obj?

转载 作者:行者123 更新时间:2023-11-28 03:16:27 26 4
gpt4 key购买 nike

我有源代码:

RenderPart* Frame::ownerRenderer() const
{
HTMLFrameOwnerElement* ownerElement = m_ownerElement;
if (!ownerElement)
return 0;
RenderObject* object = ownerElement->renderer();
if (!object)
return 0;
// FIXME: If <object> is ever fixed to disassociate itself from frames
// that it has started but canceled, then this can turn into an ASSERT
// since m_ownerElement would be 0 when the load is canceled.
// https://bugs.webkit.org/show_bug.cgi?id=18585
if (!object->isRenderPart())
return 0;
return toRenderPart(object);
}

和对象转储:

00143408 <_ZNK7WebCore5Frame13ownerRendererEv>:
143408: b510 push {r4, lr}
14340a: f8d0 32f0 ldr.w r3, [r0, #752]
14340e: b14b cbz r3, 143424 <_ZNK7WebCore5Frame13ownerRendererEv+0x1c>
143410: 6a1c ldr r4, [r3, #32]
143412: b13c cbz r4, 143424 <_ZNK7WebCore5Frame13ownerRendererEv+0x1c>
143414: 6820 ldr r0, [r4, #0]
143416: f8d0 30b0 ldr.w r3, [r0, #176]
14341a: 4620 mov r0, r4
14341c: 4798 blx r3
14341e: b108 cbz r0, 143424 <_ZNK7WebCore5Frame13ownerRendererEv+0x1c>
143420: 4620 mov r0, r4
143422: e000 b.n 143426 <_ZNK7WebCore5Frame13ownerRendererEv+0x1e>
143424: 2000 movs r0, #0
143426: bd10 pop {r4, pc}

现在我想知道哪一行源代码可以编译成143416行?

最佳答案

我相信它本质上是 ownerElement->renderer

142312是最后一个if(!object)(return 0在143424-143426处down),那么143414-14341a正在准备函数调用 ownerElement->renderer():

143414 正在将 ownerElement 放入 r0

143416 正在将 renderer() 的偏移量获取到 r3

14341a 实质上是将 this ptr 设置为在 renderer()(即 ownerElement)中使用

14341c实际上跳转到renderer()

关于android - 如何将 C++ 源代码解析为 obj?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16727361/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com