osx - How debug non-xcode process with XCode 4.6.2 and lldb? -
i have process running (not app) built gnu make, clang, etc. full debug info. want attach lldb , gui debugger shows me source code, variable bindings etc.
is there way lldb on os x 10.8 xcode 4.6.2 or other tool (e.g. working lldb mode emacs)?
i tried attaching xcode 4.6.2 shows disassembly , found no way tell source code. on suggested editing scheme , setting custom working directory folder selection icon disabled. suggested add files ... did not help.
attaching terminal.app plain lldb shows line numbers , source file names (but not pathnames). not find way tell lldb source code either.
in gbd, on command line, can use dir command tell source located , makes list command work. makes xcode show source if tell xcode use gbd (still possible, "attach process/by process identifier (pid) or name" menu), gdb support being removed xcode method stop working.
you can use target.source-map setting in lldb provide mapping. if built program on own system, i'm not sure why necessary -- comes if build program source code in 1 location (/tmp/original-directory) , move source different location (/tmp/new-directory) , try debug. more commonly comes if you're building on 1 system , move on second system debugging don't copy source files same location.
anyway, http://lldb.llvm.org/lldb-gdb.html shows example of how used in short,
(lldb) settings set target.source-map /buildbot/path /my/path would tell lldb substitute occurrences of /buildbot/path /my/path when looking source code files. can put setting in ~/.lldbinit file make persist.
there not direct equivalence of gdb's dir command yet can accomplish same thing enough way.
ah wait saw xcode 4.2.3 bit... that's old version of lldb. recommend upgrading xcode 4.6 if you're going use lldb - don't remember lldb in xcode 4.2 well...
Comments
Post a Comment