�
�� 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
ValueErrortTruetgdbtlookup_typetvectortpointertreinterpret_casttdereference(Rtatbtlengthtbyte_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.pyt<module>s |