简体   繁体   English

使用lldb进行调试时,无法将较高的行号解析为断点

[英]Higher line numbers are unresolved as breakpoints when debugging using lldb

I am trying to set breakpoints in a MIPS32r6 program that computes the Mandelbrot Set in Brainfsck. 我试图在计算Brainfsck中的Mandelbrot集的MIPS32r6程序中设置断点。 The program itself is written in C++, compiled with Clang, and I am debugging with LLDB. 该程序本身是用C ++编写的,使用Clang编译,而我正在使用LLDB进行调试。

The issue that I am having is that when in LLDB, I can set certain breakpoints, mainly on lower line numbers, with no issues. 我遇到的问题是,在LLDB中时,我可以设置某些断点,主要是在较低的行号上,没有问题。 However, after Line #70 in Main.cpp, the breakpoints are coming up as 'unresolved' (even though executing breakpoint list shows them with completely reasonable addresses). 但是,在Main.cpp中的第70行之后,断点显示为“未解决”(即使执行断点列表显示它们具有完全合理的地址)。 That is to say, all breakpoints that I try to set after Line #70 are coming up as unresolved, and all reasonable breakpoints before Line #70 resolve without issue. 也就是说,我尝试在70号线之后设置的所有断点都没有解决,而70号线之前的所有合理断点可以解决而没有问题。

I've placed a copy of the binary that I've linked here: http://filebin.ca/2tJzo2LLBJWO/MipsTest.bin 我已经在这里链接了二进制文件的副本: http : //filebin.ca/2tJzo2LLBJWO/MipsTest.bin

And a copy of Main.cpp here: https://paste.ee/p/WYs8Y 还有Main.cpp的副本: https ://paste.ee/p/WYs8Y

I am building with the following options: 我正在使用以下选项进行构建:

clang -mcompact-branches=always -fasynchronous-unwind-tables -funwind-tables -fexceptions -fcxx-exceptions -mips32r6 -O0 -g -glldb ...

lld --discard-none -znorelro --eh-frame-hdr ...

At this point, I am unsure as to what might be causing this issue. 在这一点上,我不确定是什么导致了此问题。

I'd try doing target modules dump line-table Main.cpp in lldb to see what lldb thinks the line table looks like. 我会尝试将target modules dump line-table Main.cpp到lldb中的target modules dump line-table Main.cpp中,以查看lldb认为该行表是什么样子。 Then look at the binary's DWARF line table with something like readelf --debug-dump=decodedline MipsTest.bin (I think that's right - I'm looking at a readelf main page on the web). 然后使用诸如readelf --debug-dump=decodedline MipsTest.bin类的东西查看二进制文件的DWARF线表(我认为是对的-我正在查看Web上的readelf主页)。

Using your sample binary, I get: 使用示例二进制文件,我得到:

(lldb) b s -l 72
Breakpoint 1: where = MipsTest.bin`main + 544 at Main.cpp:72, address = 0x000134a0

So we found an address for the breakpoint. 因此,我们找到了该断点的地址。 If it is unresolved when you run, that means we weren't able to implement the breakpoint at that address (eg for some reason couldn't write the trap into the program memory there.) 如果在运行时无法解决该问题,则意味着我们无法在该地址处实现断点(例如,由于某种原因无法将陷阱写入那里的程序存储器中。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM