Hello,
|
importcmd.diff
Description: Binary data
Attached is an updated patch file which uses os.sep as suggested, and uses the new examples/customization directory to store the example import command (plus a README). If you feel any more changes are required before this is ready for commit, let me know.
My personal preference would be to pass the SBDebugger instead. From the SBDebugger one can go to the associated SBCommandInterpreter, but doing the reverse is not possible as far as I can tell. Is there anything sensible that one could do with the Debugger in this scenario other than just grab the SBCommandInterpreter and run a few "command script add" commands? While I cannot think about any obvious example, having access to the list of targets seems valuable..
Would this command read like "import a file named my_script.py from a folder name ~/.lldb_python?" I was thinking about something like command script import ~/myfile.py which would automatically check whether ~ is in sys.path and if not append it, and then import myfile Most probably, it makes sense to delegate this to the ScriptInterpreterPython for actual implementation, and if LLDB script language is set to anything different, just reject the command "sorry, do not know how to import for your current script language" (much like we do for command script add currently)
I would go for adding the example script for the time being. I can definitely work on "command script import", but it is going to take a few days, so I guess having the Pythonic example there won't hurt. Once I get to implementing the new command, I will also rework the test case to test that one instead of the script. I will keep you up to date on progress there. As usual, if you have any feedback or suggestions, let me know.
- Enrico |
_______________________________________________ lldb-dev mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
