Created
April 6, 2012 02:19
-
-
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!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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