[lldb-dev] Detect executable archs before CreateTarget

Sebastien Metrot meeloo at gmail.com
Sat Jun 29 08:03:45 PDT 2013


Actually this was pretty easy to do, so here is a patch with the new public API I propose:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: GetAvailableArchsFromFile.diff
Type: application/octet-stream
Size: 2357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130629/627b2102/attachment.obj>
-------------- next part --------------


I have tested it on my machine (MacOSX 10.8) with a couple of bundles and it works fine. Let me know what you think.

Cheers,

S.


On Jun 29, 2013, at 16:00 , Sebastien Metrot <meeloo at gmail.com> wrote:

> Hello,
> 
> As I haven't found a way to scan available architectures from executables I'd like to add that to the API. For now the only way to do somehow do that is to loop over all known archs and try to create the SBTarget. Depending on its success I mark the arch as valid or not. As you can guess this is very slow and stupid as lldb already has all the code needed to get this information without loading the full target. 
> 
> The public API for this could be added to SBDebugger:
> static lldb::SBStringList lldb::SBDebugger::GetAvailableArchsFromFile(const char* filename);
> 
> I'm currently scouting the code to find the right elements in order to propose an implementation, any pointers and help is welcome.
> 
> Cheers,
> 
> S.
> 
> 
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev



More information about the lldb-dev mailing list