Skip to content

Instantly share code, notes, and snippets.

@erisdev
Created April 6, 2012 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erisdev/2316067 to your computer and use it in GitHub Desktop.
Save erisdev/2316067 to your computer and use it in GitHub Desktop.
Turns TextMate bookmarks into lldb breakpoints. Inefficiently. Also hoses .lldbinit, so watch out!
#!/usr/bin/env ruby
require 'osx/plist'
require 'ffi-xattr'
File.open '.lldbinit', 'w' do |script|
Dir['./**/*.{c,cc,cpp,cxx,m,mm,h,hpp}'].each do |filename|
xattr = Xattr.new filename
source = File.basename filename
# convert bookmarks into breakpoints
if str = xattr['com.macromates.bookmarked_lines']
OSX::PropertyList.load(str).each do |bookmark|
script.puts "breakpoint set -f #{source} -l #{bookmark}"
end
end
end
end
exec 'lldb', *ARGV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment