Function report |
Source Code:kernel\debug\kdb\kdb_main.c |
Create Date:2022-07-28 11:41:02 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:kdb_defcmd
Proto:static int kdb_defcmd(int argc, const char **argv)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
int | argc | |
const char ** | argv |
709 | save_defcmd_set = defcmd_set |
710 | If defcmd_in_progress Then |
711 | kdb_printf("kdb: nested defcmd detected, assuming missing endefcmd\n") |
713 | kdb_defcmd2("endefcmd", "endefcmd") |
715 | If argc == 0 Then |
717 | When s < defcmd_set + defcmd_set_count cycle |
718 | kdb_printf("defcmd %s \"%s\" \"%s\"\n", name, usage, help) |
722 | kdb_printf("endefcmd\n") |
724 | Return 0 |
726 | If argc != 3 Then Return KDB_ARGCOUNT |
728 | If in_dbg_master() Then |
729 | kdb_printf("Command only available during kdb_init()\n") |
730 | Return KDB_NOTIMP |
732 | defcmd_set = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). |
734 | If Not defcmd_set Then Go to fail_defcmd |
736 | No 3D Now!(defcmd_set, save_defcmd_set, defcmd_set_count * size of defcmd_set ) |
738 | s = defcmd_set + defcmd_set_count |
740 | usable = true |
741 | name = kdb_strdup(argv[1], GFP_KDB) |
744 | usage = kdb_strdup(argv[2], GFP_KDB) |
745 | If Not usage Then Go to fail_usage |
747 | help = kdb_strdup(argv[3], GFP_KDB) |
750 | If usage[0] == '"' Then |
752 | usage[strlen - Find the length of a string*@s: The string to be sized - 1] = '\0' |
754 | If help[0] == '"' Then |
756 | help[strlen - Find the length of a string*@s: The string to be sized - 1] = '\0' |
758 | ++defcmd_set_count |
759 | defcmd_in_progress = true |
760 | kfree(save_defcmd_set) |
761 | Return 0 |
762 | fail_help : |
764 | fail_usage : |
766 | fail_name : |
767 | kfree(defcmd_set) |
768 | fail_defcmd : |
769 | kdb_printf("Could not allocate new defcmd_set entry for %s\n", argv[1]) |
770 | defcmd_set = save_defcmd_set |
771 | Return KDB_NOTIMP |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |