2013-05-08 3 views

답변

3

당신이 LLDB에서 help -a를 입력하면 사용자가 내장 별칭이 나열됩니다하라는 메시지 :이에 대한 입력을 일치 시키려고 LLDB 명령의 형태는 정규식 명령에 대한 별칭이다

b   -- ('_regexp-break') Set a breakpoint using a regular expression to specify the location, where <linenum> is in decimal and <address> is in hex. 

하나 이상의 정규 표현식을 사용하고 해당 일치에 따라 확장을 수행합니다. 당신이 걱정하는 것입니다 예를 _regexp_break, 들어

:

_regexp-break  -- Set a breakpoint using a regular expression to specify the location, where <linenum> is in decimal and <address> is in hex. 

나는 LLDB 현재 정규 표현식 명령의 "내용"을 참조 할 수있는 방법이 있지만, 생각하지 않는다 그것은 오픈 소스이기 때문에 프로젝트, 당신은 소스를보고 그것을 알아낼 수 있습니다

const char *break_regexes[][2] = {{"^(.*[^[:space:]])[[:space:]]*:[[:space:]]*([[:digit:]]+)[[:space:]]*$", "breakpoint set --file '%1' --line %2"}, 
            {"^([[:digit:]]+)[[:space:]]*$", "breakpoint set --line %1"}, 
            {"^\\*?(0x[[:xdigit:]]+)[[:space:]]*$", "breakpoint set --address %1"}, 
            {"^[\"']?([-+]?\\[.*\\])[\"']?[[:space:]]*$", "breakpoint set --name '%1'"}, 
            {"^(-.*)$", "breakpoint set %1"}, 
            {"^(.*[^[:space:]])`(.*[^[:space:]])[[:space:]]*$", "breakpoint set --name '%2' --shlib '%1'"}, 
            {"^\\&(.*[^[:space:]])[[:space:]]*$", "breakpoint set --name '%1' --skip-prologue=0"}, 
            {"^(.*[^[:space:]])[[:space:]]*$", "breakpoint set --name '%1'"}}; 

이 문자열 쌍의 배열이며, 각 쌍은 정규 표현식과 일치시 해당 확장을 정의합니다. (참조 용으로,이 코드는 lldb/source/Interpreter/CommandInterpreter.cpp입니다.)

자신 만의 정의가 끝나고 항상 사용하기를 원한다면, 각 세션에서 수정 된 명령은 ~/.lldbinit입니다.