FueledByPizza
FueledByPizza

Reputation: 55

Attach lldb debugger to the compiled program's executable when the main executable is not the compiled program

I am building an MPI C project in Xcode. In order to do run it, I had to:

  1. Specify /path/to/mpiexec in Edit Scheme -> Run -> Info -> Executable, instead of the "default" one, say myprogram if my target is called myprogram.
  2. Specify the following arguments in Edit Scheme -> Run -> Arguments -> Arguments Passed On Launch: -np 4, ${BUILT_PRODUCTS_DIR}/${EXECUTABLE_NAME}

This is clearly analogous to a mpiexec -np 4 a.out command launched on terminal.

The problem is, when I want to debug my application, the execution doesn't "stop" on the breakpoints.
I instantly thought that it is because of the check box Debug Executable in Edit Scheme -> Run -> Info -> Executable. Indeed (as I have just said), the Executable specified in there is mpiexec and not myprogram.

Thus, is there an option or some command I could set in Xcode to attach the lldb to myprogram?

Upvotes: 1

Views: 43

Answers (0)

Related Questions