[Lldb-commits] [PATCH] Add -exec-arguments command

Greg Clayton clayborg at gmail.com
Wed Jan 21 17:04:29 PST 2015

I would vote for a different approach altogether which would be a cleaner all around implementation:

Have the lldb-mi have a variable whose type is: lldb::SBLaunchInfo.

  lldb::SBLaunchInfo m_launch_info;

And somehow you make a function that all command can access this launch info with like:

  lldb::SBLaunchInfo &GetGlobalLaunchInfo();

This probably should be an instance variable that is part of the global MI interpreter.

Any calls to things like:

  -file-exec-and-symbols ~/p/hello

Would do:

  bool add_as_first_arg = true;
  GetGlobalLaunchInfo().SetExecutableFile(lldb::SBFileSpec("~/p/hello"), add_as_first_arg);


  -exec-arguments foo bar

would do:

  const bool append_args = true;
  GetGlobalLaunchInfo().SetArguments(argv, append_args);

And then:

  -interpreter-exec command "r"

would do:

  lldb::SBProcess process = target.Launch (GetGlobalLaunchInfo(), error);

This give you the most flexibility to set/change stuff before you launch, and setting up SBLaunchInfo is the current best practices way to launch a process.



More information about the lldb-commits mailing list