<div dir="ltr">Thank you very much, Greg. I will try the python-way first.<div><br></div><div>Regards.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-07 7:01 GMT+08:00 Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">"image load" is for telling LLDB where a module is loaded. For example if you have an image foo.elf and you wanted to let LLDB know to set the load address for the image you could do:<br>
<br>
% lldb foo.elf --arch x86_64-unknown-unknown<br>
(lldb) image load foo.elf --slide 0<br>
<br>
this would cause LLDB to set all of the "load" addresses to match their "file" virtual addresses in the image, but it doesn't cause the image to be downloaded.<br>
<br>
When LLDB is connected, it can write memory using a file:<br>
<br>
(lldb) memory --infile /tmp/foo.elf 0x10000<br>
<br>
This would write the entire file into memory, which probably isn't what you want. You probably want to obey the program headers in the ELF file and only load certain parts. You could certainly do this with a python command. See the "CREATE A NEW LLDB COMMAND USING A PYTHON FUNCTION" section on the <a href="http://lldb.llvm.org/python-reference.html" target="_blank">http://lldb.llvm.org/python-reference.html</a> web page for more details. But basically you could make a python command that would look at an ELF file and load it into a target at a given address.<br>
<br>
Or you could modify LLDB to add a command that would do this. If you want to go this route let me know as I will need to explain what would need to be done.<br>
<br>
Greg<br>
<div><div class="h5"><br>
On Mar 5, 2014, at 6:54 PM, 杨勇勇 <<a href="mailto:triple.yang@gmail.com">triple.yang@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
> I ported lldb to debug on a remote bare-metal platform, and it basically works now.<br>
> But I do not find a way to load a program image to the remote bare-metal platform (just like "load" in gdb).<br>
><br>
> lldb has "image load" command but it does not work as expected since there is not any process<br>
> running.<br>
><br>
> Any suggestions?<br>
> Thanks in advance!<br>
><br>
> --<br>
> 杨勇勇 (Yang Yong-Yong)<br>
><br>
</div></div>> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>杨勇勇 (Yang Yong-Yong)
</div>