<div dir="ltr"><span style="color:rgb(0,0,0);font-family:Times;font-size:14px;line-height:21px">Hi, Greg. </span><span style="color:rgb(0,0,0);font-family:Times;font-size:14px;line-height:21px">Sorry to bother you again.</span><div>
<font color="#000000" face="Times" size="4"><span style="line-height:21px"><br></span></font><div style="color:rgb(0,0,0);font-family:Times;font-size:14px;line-height:21px">I checked python API and found a path: SBDebugger -> SBTarget -> SBModule -> SBSection to retrieve data and text sections which need to be uploaded onto remote platform. The problem is I failed to figure out any method to perform uploading.</div>
<div style="color:rgb(0,0,0);font-family:Times;font-size:14px;line-height:21px">There is a python class named SBCommunication which I guess represents remote debug connection, but I was not able to find an accessor to obtain this object. Any clue?</div>
<div style="color:rgb(0,0,0);font-family:Times;font-size:14px;line-height:21px"><br></div><div style="color:rgb(0,0,0);font-family:Times;font-size:14px;line-height:21px">And Since there are lots of kinds of debug operations (like memory write, ...) prohibitted without a valid process, and program image is needed to launch a process, what is proper time to upload a image in your opinion?</div>
<div style="color:rgb(0,0,0);font-family:Times;font-size:14px;line-height:21px"><span style="font-size:10.5pt;line-height:1.5">(I have faked a process in debug server after process launch and before image uploading and I force it to ignore the first continue/step packet, thus it stops immediately when it lauches. I </span><span style="font-size:10.5pt;line-height:1.5">guess it will work, but lldb displays ugly information at its first stop because memoey is all null.)</span></div>
<div style="color:rgb(0,0,0);font-family:Times;font-size:14px;line-height:21px"><span style="font-size:10.5pt;line-height:1.5"><br></span></div><div style="color:rgb(0,0,0);font-family:Times;font-size:14px;line-height:21px">
Best regards!</div></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>