Detect executable archs before CreateTarget

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.

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

GetAvailableArchsFromFile.diff (2.3 KB)