[Lldb-commits] [PATCH] D62732: [RISCV] Add SystemV ABI

Tiancheng Zhang via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 3 17:14:08 PDT 2022


tzb99 added a comment.

In D62732#3681388 <https://reviews.llvm.org/D62732#3681388>, @jasonmolenda wrote:

> In D62732#3680154 <https://reviews.llvm.org/D62732#3680154>, @tzb99 wrote:
>
>> In D62732#2790160 <https://reviews.llvm.org/D62732#2790160>, @sven wrote:
>>
>>> 
>
>
>
>>> But the unwind can not work on my machine, the issue is similar to which @jade reported
>>>
>>>   (lldb) bt
>>>   * thread #1, stop reason = breakpoint 1.1
>>>     * frame #0: 0x0000000080000022 kern`fn3 at start.c:7:8
>>>
>>> Can you reproduce this problem? Or please show me how you fix the issue, thanks very much.
>>
>> Hi: I encountered the similar issue with the frame address showing all 1s. I tried to install libxml2-dev and wanted to recompile lldb. How did you recompile lldb? Do you cross compile or compile inside the qemu environment? If you do cross-compile, would you mind show the arguments of cmake? Thank you very much!
>>
>> PS: I use cmake arguments and followed the instructions on the lldb website to do the LLVM in-tree build. I will encounter errors if I set enable xml2 to be ON:
>>
>> /usr/include/libxml2/libxml/encoding.h:31:10: fatal error: unicode/ucnv.h: No such file or directory
>>
>>   31 | #include <unicode/ucnv.h>
>>      |          ^~~~~~~~~~~~~~~~
>>
>> compilation terminated.



In D62732#3681388 <https://reviews.llvm.org/D62732#3681388>, @jasonmolenda wrote:

> In D62732#3680154 <https://reviews.llvm.org/D62732#3680154>, @tzb99 wrote:
>
>> In D62732#2790160 <https://reviews.llvm.org/D62732#2790160>, @sven wrote:
>>
>>> 
>
>
>
>>> But the unwind can not work on my machine, the issue is similar to which @jade reported
>>>
>>>   (lldb) bt
>>>   * thread #1, stop reason = breakpoint 1.1
>>>     * frame #0: 0x0000000080000022 kern`fn3 at start.c:7:8
>>>
>>> Can you reproduce this problem? Or please show me how you fix the issue, thanks very much.
>>
>> Hi: I encountered the similar issue with the frame address showing all 1s. I tried to install libxml2-dev and wanted to recompile lldb. How did you recompile lldb? Do you cross compile or compile inside the qemu environment? If you do cross-compile, would you mind show the arguments of cmake? Thank you very much!
>>
>> PS: I use cmake arguments and followed the instructions on the lldb website to do the LLVM in-tree build. I will encounter errors if I set enable xml2 to be ON:
>>
>> /usr/include/libxml2/libxml/encoding.h:31:10: fatal error: unicode/ucnv.h: No such file or directory
>>
>>   31 | #include <unicode/ucnv.h>
>>      |          ^~~~~~~~~~~~~~~~
>>
>> compilation terminated.

Thank you! I checked the DefaultUnwindPlan on the ABISysV_riscv and found it is not called at all in the lldb-server process. Could this patch not work on the qemu system mode? I am currently using the qemu system mode. In qemu, it allows me to install GDB and GDB works well. However, the lldb cannot stop on the breakpoint and the lldb-server returns the stack frame with all 1s. By taking further investigation, the GetExpeditedRegisters does not work well, since it cannot identify the sp, fp, ra, pc registers. The fucntions called Handle_qMemoryRegionInfo and Handle_Memory_Read don't get called, either. So my suspicion might fall on either the cross-compilation issue or the insufficiency of the current patch. Could someone show the cross-compilation recipe, or help with my issue? I would really appreciate that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62732/new/

https://reviews.llvm.org/D62732



More information about the lldb-commits mailing list