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:40:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kdbgetaddrarg - This function is responsible for parsing an* address-expression and returning the value of the expression,* symbol name, and offset to the caller

Proto:int kdbgetaddrarg(int argc, const char **argv, int *nextarg, unsigned long *value, long *offset, char **name)

Type:int

Parameter:

TypeParameterName
intargc count of arguments in argv
const char **argv argument vector
int *nextarg
unsigned long *value
long *offset
char **name
499  off = 0
502  found = 0
504  symbol = '\0'
513  If Not Check whether the flags of the current command and the permissions* of the kdb console has allow a command to be run. Then Return KDB_NOPERM
525  If nextarg > count of arguments in argv Then Return KDB_ARGCOUNT
528  symname = argument vector[ * nextarg]
536  cp = strpbrk - Find the first occurrence of a set of characters*@cs: The string to be searched*@ct: The characters to search for
537  If (cp != NULL) Then
538  symbol = cp
539  cp++ = '\0'
542  If symname[0] == '$' Then
543  diag = kdbgetulenv - This function will return the value of an unsigned* long-valued environment variable.* Parameters:* match A character string representing a numeric value* Outputs:* *value the unsigned long represntation of the env variable 'match'* Returns:
544  If diag Then Return diag
546  Else if symname[0] == '%' Then
547  diag = kdb_check_regs()
548  If diag Then Return diag
553  Return KDB_NOTIMP
554  Else
555  found = kdbgetsymval - Return the address of the given symbol
556  If found Then
557  addr = sym_start
558  Else
560  If diag Then Return diag
565  If Not found Then found = kdbnearsym - Return the name of the symbol with the nearest address* less than 'addr'
568  nextarg++
570  If name Then name = symname
572  If value Then value = addr
574  If offset && name && name Then offset = addr - sym_start
577  If nextarg > count of arguments in argv && symbol == '\0' Then Return 0
585  If symbol == '\0' Then
586  If argument vector[ * nextarg][0] != '+' && argument vector[ * nextarg][0] != '-' Then
591  Return 0
592  Else
593  positive = argument vector[ * nextarg][0] == '+'
594  nextarg++
596  Else positive = symbol == '+'
602  If nextarg > count of arguments in argv && symbol == '\0' Then
604  Return KDB_INVADDRFMT
607  If Not symbol Then
608  cp = argument vector[ * nextarg]
609  nextarg++
612  diag = kdbgetularg - This function will convert a numeric string into an* unsigned long value.* Parameters:* arg A character string representing a numeric value* Outputs:* *value the unsigned long represntation of arg.* Returns:
613  If diag Then Return diag
616  If Not positive Then off = -off
619  If offset Then offset += off
622  If value Then value += off
625  Return 0
Caller
NameDescribe
kdb_parse
kdb_md
kdb_mmkdb_mm - This function implements the 'mm' command.* mm address-expression new-value* Remarks:* mm works on machine words, mmW works on bytes.
kdb_gokdb_go - This function implements the 'go' command.* go [address-expression]
kdb_efkdb_ef - This function implements the 'regs' (display exception* frame) command. This command takes an address and expects to* find an exception frame at that address, formats and prints* it.* regs address-expression* Remarks:* Not done yet.
kdb_per_cpukdb_per_cpu - This function implements the 'per_cpu' command.
kdb_bt
kdb_bpkdb_bp* Handle the bp commands