ó ›à Rc@s¢dZddlZddlZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZd ejfd „ƒYZeƒeƒeƒeƒdS( s#$_memeq, $_strlen, $_streq, $_regexiÿÿÿÿNt_MemEqcBs eZdZd„Zd„ZRS(sy$_memeq - compare bytes of memory Usage: $_memeq(a, b, len) Returns: True if len bytes at a and b compare equally. cCstt|ƒjdƒdS(Nt_memeq(tsuperRt__init__(tself((s,/usr/share/gdb/python/gdb/function/strfns.pyR scCs‡|dkrtdƒ‚n|dkr+tStjdƒj|dƒ}|jƒ}|j|ƒ}|j|ƒ}|jƒ|jƒkS(Nislength must be non-negativetchari(t ValueErrortTruetgdbt lookup_typetvectortpointertreinterpret_castt dereference(Rtatbtlengtht byte_vectortptr_byte_vectorta_ptrtb_ptr((s,/usr/share/gdb/python/gdb/function/strfns.pytinvoke#s   (t__name__t __module__t__doc__RR(((s,/usr/share/gdb/python/gdb/function/strfns.pyRs t_StrLencBs eZdZd„Zd„ZRS(s‡$_strlen - compute string length Usage: $_strlen(a) Returns: Length of string a, assumed to be a string in the current language. cCstt|ƒjdƒdS(Nt_strlen(RRR(R((s,/usr/share/gdb/python/gdb/function/strfns.pyR9scCs|jƒ}t|ƒS(N(tstringtlen(RRts((s,/usr/share/gdb/python/gdb/function/strfns.pyR<s (RRRRR(((s,/usr/share/gdb/python/gdb/function/strfns.pyR0s t_StrEqcBs eZdZd„Zd„ZRS(sÛ$_streq - check string equality Usage: $_streq(a, b) Returns: True if a and b are identical strings in the current language. Example (amd64-linux): catch syscall open cond $bpnum $_streq((char*) $rdi, "foo") cCstt|ƒjdƒdS(Nt_streq(RRR(R((s,/usr/share/gdb/python/gdb/function/strfns.pyRNscCs|jƒ|jƒkS(N(R(RRR((s,/usr/share/gdb/python/gdb/function/strfns.pyRQs(RRRRR(((s,/usr/share/gdb/python/gdb/function/strfns.pyRAs  t_RegExcBs eZdZd„Zd„ZRS(s»$_regex - check if a string matches a regular expression Usage: $_regex(string, regex) Returns: True if string str (in the current language) matches the regular expression regex. cCstt|ƒjdƒdS(Nt_regex(RR R(R((s,/usr/share/gdb/python/gdb/function/strfns.pyR_scCs4|jƒ}tj|jƒƒ}t|j|ƒƒS(N(Rtretcompiletbooltmatch(RRtregexRtr((s,/usr/share/gdb/python/gdb/function/strfns.pyRbs (RRRRR(((s,/usr/share/gdb/python/gdb/function/strfns.pyR Us  (RRR"tFunctionRRRR (((s,/usr/share/gdb/python/gdb/function/strfns.pyts