Hi LLDB devs,<div><br></div><div>I have almost finished porting LLDB to my architecture, now LLDB communicates well with my GDB stub of my simulator and can do debugging actions like breakpoint, continue, step, reading memory, reading<font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"> registers and so on. Thanks to all of your kind advice~<br></font></div><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><div style="display: block; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;"><br></div><div style="display: block; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;">Now I consider adding disassemble function. Our compiler is LLVM(of course after porting it to our new architecture) and a LLVM disassembler has already been implemented, which can do great objdump from the ELF file that LLVM generates, creating a .map file containing disassemble. LLDB leverages the disassembler from LLVM, so our LLDB can easily use that <font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1">disassembler plug-in. Here comes problems:</font></div><div style="display: block; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1">I found that when LLDB deals with command "</font><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1">disassemble/dis/di", it would detect the current frame, confirm the disassemble address range, send a "m" packet to read the corresponding memory to get the program, and use LLVM </font><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1">disassembler plug-in to disassemble the code, which I would like to call it "dynamic disassembling". But in our architecture, program and data are in separated memory which have the same address space. When reading memory, we just read the data memory not the program memory, in other words, program/code cannot be accessed from processor, only from ELF file(program/code won't be altered during run time, we use hardware breakpoint). <br></font></font></div><div style="display: block; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><br></font></font></div><div style="display: block; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1">So:</font></font></div><div style="display: block; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1">Can LLDB do "static </font></font><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1"><font style="display: inline; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;" __editorwarp__="1">disassembling</font></font></font>"? (which just uses program/code from the ELF executable file without reading memory from the processor during run time)<br></font></font></div><br><div style="display: block; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;">Kind regards,</div><div style="display: block; font-size: 14px; font-family: Verdana; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0); font-weight: 400; font-style: normal;">Rui</div></font><div><br></div>