Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\debug\kdb\kdb_main.c Create Date:2022-07-28 11:41:07
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:The "str" argument may point to something like | grep xyz

Proto:static void parse_grep(const char *str)

Type:void

Parameter:

TypeParameterName
const char *str
825  cp = str
828  If cp != '|' Then Return
830  cp++
831  When Note: isspace() must return false for %NUL-terminator ( * cp) cycle
832  cp++
833  If Not str_has_prefix - Test if a string has a given prefix*@str: The string to test*@prefix: The string to see if @str starts with* A common way to test a prefix of a string is to do:* strncmp(str, prefix, sizeof(prefix) - 1)* But this can lead to bugs due to Then
834  kdb_printf("invalid 'pipe', see grephelp\n")
835  Return
837  cp += 5
838  When Note: isspace() must return false for %NUL-terminator ( * cp) cycle
839  cp++
840  cp2 = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
841  If cp2 Then cp2 = '\0'
843  len = strlen - Find the length of a string*@s: The string to be sized
844  If len == 0 Then
845  kdb_printf("invalid 'pipe', see grephelp\n")
846  Return
849  If cp == '"' Then
852  cp++
853  cp2 = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
854  If Not cp2 Then
855  kdb_printf("invalid quoted string, see grephelp\n")
856  Return
858  cp2 = '\0'
860  kdb_grep_leading = 0
861  If cp == '^' Then
862  kdb_grep_leading = 1
863  cp++
865  len = strlen - Find the length of a string*@s: The string to be sized
866  kdb_grep_trailing = 0
867  If *( cp + len - 1) == '$' Then
868  kdb_grep_trailing = 1
869  *( cp + len - 1) = '\0'
871  len = strlen - Find the length of a string*@s: The string to be sized
872  If Not len Then Return
874  If len >= KDB_GREP_STRLEN Then
875  kdb_printf("search string too long\n")
876  Return
878  strcpy(kdb_grep_string, cp)
879  kdb_grepping_flag++
880  Return
Caller
NameDescribe
kdb_parse