锘??xml version="1.0" encoding="utf-8" standalone="yes"?> 姣旇緝鑰岃█錛孭remake4姣攃make榪樻槸鎰熻綆鍗曚竴鐐癸紝鑷沖皯lua璇硶綆鍗曪紝premake4鐨勯厤緗枃浠舵瘮杈冪畝鍗曟槗璇伙紝鑰宑make鐨勯厤緗枃浠跺氨姣旇緝澶嶆潅錛岃屼笖鍙堟槸鑷繁瀹氫箟鐨勪竴濂椾笢瑗匡紝鐢ㄨ搗鏉ュ疄鍦ㄦ瘮杈冪儲銆?/p>
Premake4榪樻湁涓涓瘮杈冨ソ鐢ㄧ殑鐗規э紝鍙互鐩存帴鐢?**/*.cpp 鎸囧畾欏圭洰鍖呭惈鎵鏈夌洰褰曚笅鐨刢pp鏂囦歡錛岃屼笉鐢ㄥ崟涓寚瀹氥傝繖鏍鋒瘡嬈″鍔犱竴涓枃浠朵笉鐢ㄨ佺瓑緙栬瘧浜嗘墠鎯寵搗鏉ュ繕璁頒簡澧炲姞鏂囦歡鍒伴厤緗腑銆傜畻鏄粰鎳掍漢鐨勪竴涓鍒╁惂銆?/p>
褰撶劧錛孭remake4涔熸湁鑷繁鐨勭己闄鳳紝鐩墠榪樹笉鏀寔鑷畾涔夎鍒欙紝鎵浠ュ鏋滈」鐩腑鏈夌敤鍒頒粈涔堣嚜鍔ㄧ敓鎴愭簮鏂囦歡鐨勭壒鎬у氨姣旇緝楹葷儲浜嗭紝姣斿榪欐璇村埌鐨刾rotobuf瑕佺敤protoc緙栬瘧.proto鏂囦歡鐢熸垚.pb.cc鍜?pb.h鏂囦歡錛屽彟澶朡T涔熸湁綾諱技鐨勯渶姹傦紝灝辨垜涔嬪墠鏌愰」鐩腑錛屼篃浣跨敤浜唗olua++鐢熸垚榪嘽++鐨刲ua鎺ュ彛鏂囦歡銆?/p>
浣嗘槸錛孭remake4铏界劧榪樹笉鏀寔鑷畾涔夎鍒欙紝浣嗘槸鎬葷畻鏈変竴涓猵rebuildcommands鍙互鐢紝浜庢槸鐮旂┒浜嗕竴涓嬶紝鑷埗浜嗕竴涓?proto鏂囦歡鐨?緙栬瘧瑙勫垯": 浣跨敤鏂規硶鍛紝灝辨槸鎶婁笂闈㈢殑浠g爜淇濆瓨鍒皃rotobuf.lua閲岄潰錛岀劧鍚庡湪premake4.lua鏈寮濮嬬殑鏃跺欙紝璋冪敤 鐒跺悗鍦ㄩ」鐩畾涔夌殑鏃跺欙紝浣跨敤 灝卞彲浠ヤ簡銆?/p>
聽 褰撶劧錛岃繕鏈変竴鐐硅娉ㄦ剰鐨勶紝鎴戠殑緋葷粺鏄痬ac錛屼絾鑴氭湰鍦╨inux涓嬪簲璇ヤ篃鑳藉悓鏍瘋繍琛岋紝浣嗘槸windows涓嬮潰鐨勮瘽錛屽彲鑳藉氨闇瑕佸仛涓鐐規敼鍔ㄤ簡銆?/p> 瑕佹兂璋冭瘯紼嬪簭錛岀洿鎺db鍊掍篃鍙互錛屼笉榪囧氨鏄壘浠g爜寰堣垂鍔涳紝榪欏氨瑕佺湅Pyclewn浜嗐?/p>
涓嬭澆錛屽畨瑁咃紝涓鍒囦技涔庨兘姝e父銆?/p>
鍙槸鍚姩pyclewn浠ュ悗錛屽彂鐜癵db鐨勫懡浠ゆ病鏈夎緭鍑哄埌buffer錛熸庝箞鎼烇紵 鍘熸潵pyclewn鐢ㄧ殑榪樻槸緋葷粺鑷甫鐨刧db錛屾檿錛岀増鏈ソ鑰佷簡銆?/p>
鍦?vimrc閲岄潰鍔犱笂 鎸囧畾浣跨敤macports鐨刧db錛岃繖灝辮浜嗐?/p>
ps. MacVim 鐨剆napshot 64鐗堟湰鐨刡alloon鏄劇ず涓嶅嚭鏉ワ紝涓嶇煡閬撴庝箞鍥炰簨銆?/p>
鍗囩駭鍒皊napshot 65灝眔k浜嗐?/p> ok錛屾垜浠敤GDB璋冭瘯錛屾病鏈夐棶棰樸?br />浣嗘槸濡傛灉鎴戜滑鍒嗕袱姝ワ紝緙栬瘧鍜岃繛鎺ュ垎寮鐨勮瘽錛?/p>
榪欐鎴戜滑gdb test鍐嶈皟璇曪紝浼氬彂鐜癎DB鎵句笉鍒拌皟璇曠鍙蜂俊鎭紒 鍐嶇劧鍚庯紝灝卞彲浠ョ敤GDB欏哄埄璋冭瘯浜嗐?br />function protobufs(pat)
local list = {}
if type(pat) == "string" then
list[1] = pat;
elseif type(pat) == "table" then
list = pat;
end
local proj = project();
for _,pat in ipairs(list) do
local protofiles = os.matchfiles(pat);
for _,protofile in ipairs(protofiles) do
local basename = path.getbasename(protofile);
local sourcedir = proj.basedir.."/"..path.getdirectory(protofile);
local sourcefile = proj.basedir.."/"..protofile;
local targetdir = "$(OBJDIR)/proto/"..path.getdirectory(protofile);
local targetfile = targetdir.."/"..basename..".pb.cc";
prebuildcommands {
"@mkdir -p "..targetdir,
"@test "..sourcefile.." \\\n"
.."\t\t\t -ot "..targetfile.." || \\\n"
.."\t\t( echo protoc "..protofile.." && \\\n"
.."\t\tprotoc --cpp_out "..targetdir.."\\\n"
.."\t\t\t"..sourcefile.."\\\n"
.."\t\t\t".." -I"..sourcedir.." ) \\\n"
}
files {
path.join(targetdir, basename..".pb.h"),
path.join(targetdir, basename..".pb.cc"),
}
includedirs { targetdir }
end
end
enddofile "protobuf.lua"
protobufs { "**/*.proto" }
set pyclewn_args='-p ggdb'
鍦↙inux鎴栬匴indows涓嬮潰錛屽啓濂戒唬鐮侊紝g++緙栬瘧錛岃繛鎺ワ紝璋冭瘯錛屼竴鍒囧緢欏虹晠銆?br />
浣嗘槸鍦∕ac涓嬮潰錛屾湁鐐瑰皬闂銆?br />
鎴戜滑濡傛灉鏄洿鎺ョ紪璇戠敓鎴愬彲鎵ц鏂囦歡錛?/p>
g++ test.cpp -g -o test
g++ test.cpp -g -c -o test.o
g++ -o test test.o
涓ゆ鐢熸垚鏈変粈涔堜笉鍚屽憿錛?br />涓嬈$紪璇戠敓鎴愮殑test錛屾梺杈規湁涓涓猼est.dSYM錛岃屽崟鐙繛鎺ョ殑test錛屾病鏈夎繖涓?br />
test.dSYM灝辨槸璋冭瘯絎﹀彿淇℃伅銆?br />瑕佹兂鐢熸垚榪欎釜涓滆タ錛屼篃綆鍗曪紝榪愯dsymutil灝卞彲浠ヤ簡錛毬?/p>
dsymutil test
g++鐩存帴鐢熸垚鍙墽琛屾枃浠剁殑鏃跺欙紝浼氬府鎴戜滑璋冪敤涓嬈symutil錛屼絾鏄崟鐙繛鎺ョ殑鏃跺欏嵈涓嶄細鍋氳繖涓紝榪欏氨鏄犳垚宸埆鐨勫師鍥犮?/p>
鍙槸涓鐩翠互鏉ラ兘娌℃湁瑙佸埌榪欎釜涓滆タ璧蜂綔鐢紝鏈榪戝氨鐮旂┒浜嗕竴涓嬨?/p>
鎴戠殑鐜鏄疢ac Mountain Lion + macports錛孏CC 4.7錛孏DB 7.5
棣栧厛錛屾寜鐓?/p>
http://sourceware.org/gdb/wiki/STLSupport
涓嬭澆checkout STL鐨刾retty printer銆?/p>
璁劇疆濂?gdbinit浠ュ悗錛岃繍琛屽憡鐭ュ凡緇忔敞鍐岋紝涓嶈兘閲嶅娉ㄥ唽銆?/p>
$locate printers.py
鍙戠幇鍦?opt/local/share/gcc-4.7/gcc-4.7.1/python/libstdcxx/v6宸茬粡鏈変竴浠界幇鎴愮殑浜嗐?/p>
濂藉惂錛屾垜浠氨浣跨敤鐜版湁鐨勫ソ浜嗐?/p>
鍐欎釜紼嬪簭錛岃皟璇曪紝print錛屾庝箞鍥炰簨錛熻繕鏄笉鎴愶紵
澶存檿浜嗗ソ涔咃紝濂藉湪python鐨勬簮鐮佹槸鍙互闅忎究鐪嬮殢渚挎敼鐨勶紝浜庢槸鍦╬rinters.py閲岄潰鏀規潵鏀瑰幓錛岃皟璇曚簡鍗婂ぉ錛屽彂鐜幫細
榪欎釜printers.py娉ㄥ唽浜嗗ソ澶歴tl綾誨瀷鐨刾rinter錛屾墦鍗板嚭鏉ユ湁浠ヤ笅榪欎簺錛?/p>
std::__cxx1998::__7::unordered_multiset
std::tr1::unordered_multiset
std::unordered_set
std::tr1::unordered_multimap
std::tr1::__7::weak_ptr
std::__7::bitset
std::__cxx1998::multiset
std::bitset
std::forward_list
std::__7::forward_list
std::__cxx1998::forward_list
std::__7::_Rb_tree_iterator
std::__7::list
std::__debug::unordered_multimap
__gnu_cxx::slist
std::__7::priority_queue
std::__debug::map
std::_List_const_iterator
std::__debug::unordered_map
__gnu_cxx::_Slist_iterator
std::set
std::__cxx1998::__7::_Deque_const_iterator
std::__7::_List_const_iterator
std::__7::multiset
std::shared_ptr
std::__7::queue
std::__cxx1998::_List_iterator
std::tr1::unordered_map
std::__7::vector
std::__debug::queue
std::__norm::_Deque_const_iterator
std::__7::unordered_set
std::__norm::_Deque_iterator
std::__cxx1998::_Deque_iterator
__gnu_cxx::__7::_Slist_iterator
std::__cxx1998::list
std::__cxx1998::__7::list
std::unordered_multimap
std::__cxx1998::unordered_multiset
std::__cxx1998::__7::_List_iterator
std::__7::map
std::__debug::vector
std::tr1::__7::unordered_set
std::__7::basic_string
std::weak_ptr
std::__7::set
std::__7::unordered_multiset
__gnu_cxx::__7::__normal_iterator
std::__cxx1998::__7::vector
std::unordered_map
std::list
std::tr1::__7::unordered_map
std::__7::unordered_multimap
std::vector
std::tr1::unordered_set
std::_List_iterator
std::__7::_Deque_iterator
std::__cxx1998::map
std::__cxx1998::bitset
std::__7::weak_ptr
std::__cxx1998::vector
std::__cxx1998::unordered_set
std::priority_queue
__gnu_cxx::__7::slist
std::__7::_Rb_tree_const_iterator
std::_Deque_const_iterator
std::__7::deque
std::__cxx1998::set
std::__cxx1998::__7::bitset
__gnu_debug::_Safe_iterator
std::tr1::__7::unordered_multimap
__gnu_cxx::__normal_iterator
std::__cxx1998::__7::multiset
std::__cxx1998::__7::unordered_map
std::__debug::unique_ptr
std::__cxx1998::_List_const_iterator
std::_Deque_iterator
std::tr1::__7::unordered_multiset
std::unordered_multiset
std::__cxx1998::__7::unordered_multimap
std::__debug::multiset
std::tr1::weak_ptr
std::__cxx1998::_Deque_const_iterator
std::__cxx1998::unordered_map
std::__7::unique_ptr
std::__debug::list
std::__debug::unordered_multiset
std::__cxx1998::deque
std::_Rb_tree_const_iterator
std::__debug::bitset
std::queue
std::tr1::__7::shared_ptr
std::__debug::unordered_set
std::tr1::shared_ptr
std::__cxx1998::__7::_List_const_iterator
std::__cxx1998::__7::_Deque_iterator
std::__cxx1998::__7::map
std::__7::stack
std::unique_ptr
std::__cxx1998::__7::deque
std::map
std::__7::multimap
std::stack
std::__debug::stack
std::_Rb_tree_iterator
std::multimap
std::__norm::_List_const_iterator
std::__debug::multimap
std::__norm::_List_iterator
std::deque
std::tuple
std::__cxx1998::unordered_multimap
std::basic_string
std::__7::tuple
std::__debug::deque
std::__debug::priority_queue
std::__7::_Deque_const_iterator
std::__7::shared_ptr
std::__cxx1998::__7::multimap
std::__debug::forward_list
std::__7::unordered_map
std::__debug::set
std::__cxx1998::__7::unordered_set
std::__cxx1998::__7::set
std::__7::_List_iterator
std::__cxx1998::multimap
std::__cxx1998::__7::forward_list
std::multiset:
鐒跺悗錛屾垜浠殑涓涓畝鍗曠殑string綾誨瀷錛屼紶鍏ュ埌python鐨刲ookup閲岄潰鏌ユ壘錛屾壘涓嶅埌錛?/p>
鏈鍚庡彂鐜幫紝string綾誨瀷浼犲叆python浠ュ悗鐨刡asename鏄痓asic_string錛屾病鏈夊墠闈㈢殑namespace錛?/p>
浜庢槸錛屽湪Printer綾葷殑add_version鍑芥暟閲岄潰錛屽鍔犱竴琛?/p>
self.add(name, function)
淇濆瓨錛岄噸鏂版墦寮GDB錛岃皟璇曠▼搴忥紝OK浜嗭細
(gdb) p s
$1 = "great"
(gdb) p v
$2 = vector of length 5, capacity 8 = {"a1", "a2", "a2", "a3", "a4"}