-/* $OpenBSD: db_interface.c,v 1.27 2022/04/12 19:44:31 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.28 2022/04/14 19:47:10 naddy Exp $ */
/* $NetBSD: db_interface.c,v 1.8 1999/10/12 17:08:57 jdolecek Exp $ */
/*
void db_mach_cpu(db_expr_t, int, db_expr_t, char *);
#endif
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
#if defined(MULTIPROCESSOR)
{ "ddbcpu", db_mach_cpu, 0, NULL },
#endif
-/* $OpenBSD: db_interface.c,v 1.38 2022/04/12 19:44:31 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.39 2022/04/14 19:47:10 naddy Exp $ */
/* $NetBSD: db_interface.c,v 1.1 2003/04/26 18:39:27 fvdl Exp $ */
/*
#endif /* MULTIPROCESSOR */
#if NACPI > 0
-struct db_command db_acpi_cmds[] = {
+const struct db_command db_acpi_cmds[] = {
{ "disasm", db_acpi_disasm, CS_OWN, NULL },
{ "showval", db_acpi_showval, CS_OWN, NULL },
{ "tree", db_acpi_tree, 0, NULL },
};
#endif /* NACPI > 0 */
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
#ifdef MULTIPROCESSOR
{ "cpuinfo", db_cpuinfo_cmd, 0, 0 },
{ "startcpu", db_startproc_cmd, 0, 0 },
-/* $OpenBSD: db_interface.c,v 1.18 2022/04/12 19:44:31 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.19 2022/04/14 19:47:10 naddy Exp $ */
/* $NetBSD: db_interface.c,v 1.34 2003/10/26 23:11:15 chris Exp $ */
/*
asm(".word 0xe7ffffff");
}
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
{ "frame", db_show_frame_cmd, 0, NULL },
#ifdef ARM32_DB_COMMANDS
ARM32_DB_COMMANDS,
-/* $OpenBSD: db_interface.c,v 1.11 2022/04/12 19:44:31 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.12 2022/04/14 19:47:11 naddy Exp $ */
/* $NetBSD: db_interface.c,v 1.34 2003/10/26 23:11:15 chris Exp $ */
/*
}
#endif
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
#ifdef MULTIPROCESSOR
{ "cpuinfo", db_cpuinfo_cmd, 0, NULL },
{ "startcpu", db_startproc_cmd, 0, NULL },
-/* $OpenBSD: db_interface.c,v 1.43 2022/04/12 19:44:31 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.44 2022/04/14 19:47:11 naddy Exp $ */
/* $NetBSD: db_interface.c,v 1.22 1996/05/03 19:42:00 christos Exp $ */
/*
#endif /* MULTIPROCESSOR */
#if NACPI > 0
-struct db_command db_acpi_cmds[] = {
+const struct db_command db_acpi_cmds[] = {
{ "disasm", db_acpi_disasm, CS_OWN, NULL },
{ "showval", db_acpi_showval, CS_OWN, NULL },
{ "tree", db_acpi_tree, 0, NULL },
};
#endif /* NACPI > 0 */
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
{ "sysregs", db_sysregs_cmd, 0, 0 },
#ifdef MULTIPROCESSOR
{ "cpuinfo", db_cpuinfo_cmd, 0, 0 },
-/* $OpenBSD: db_interface.c,v 1.27 2022/04/12 19:44:31 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.28 2022/04/14 19:47:11 naddy Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
/* COMMAND TABLE / INIT */
/************************/
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
#ifdef MULTIPROCESSOR
{ "ddbcpu", m88k_db_cpu_cmd, 0, NULL },
#endif
-/* $OpenBSD: db_machdep.c,v 1.58 2022/04/12 19:44:32 naddy Exp $ */
+/* $OpenBSD: db_machdep.c,v 1.59 2022/04/14 19:47:11 naddy Exp $ */
/*
* Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se)
}
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
{ "tlb", db_dump_tlb_cmd, 0, NULL },
{ "trap", db_trap_trace_cmd, 0, NULL },
#ifdef MULTIPROCESSOR
-/* $OpenBSD: db_interface.c,v 1.9 2022/04/12 19:44:32 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.10 2022/04/14 19:47:11 naddy Exp $ */
/* $NetBSD: db_interface.c,v 1.12 2001/07/22 11:29:46 wiz Exp $ */
/*
}
#endif
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
#ifdef MULTIPROCESSOR
{ "cpuinfo", db_cpuinfo_cmd, 0, NULL },
{ "startcpu", db_startproc_cmd, 0, NULL },
-/* $OpenBSD: db_interface.c,v 1.5 2022/04/12 19:44:32 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.6 2022/04/14 19:47:11 naddy Exp $ */
/* $NetBSD: db_interface.c,v 1.12 2001/07/22 11:29:46 wiz Exp $ */
/*
#endif
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
#ifdef MULTIPROCESSOR
{ "cpuinfo", db_cpuinfo_cmd, 0, NULL },
{ "startcpu", db_startproc_cmd, 0, NULL },
-/* $OpenBSD: db_interface.c,v 1.7 2022/04/12 19:44:32 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.8 2022/04/14 19:47:11 naddy Exp $ */
/*
* Copyright (c) 1996 Scott K. Stevens
}
#endif
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
#ifdef MULTIPROCESSOR
{ "cpuinfo", db_cpuinfo_cmd, 0, NULL },
{ "startcpu", db_startproc_cmd, 0, NULL },
-/* $OpenBSD: db_interface.c,v 1.14 2022/04/12 19:44:32 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.15 2022/04/14 19:47:11 naddy Exp $ */
/* $NetBSD: db_interface.c,v 1.37 2006/09/06 00:11:49 uwe Exp $ */
/*-
void __db_print_symbol(db_expr_t);
char *__db_procname_by_asid(int);
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
{ "tlb", db_tlbdump_cmd, 0, NULL },
{ "cache", db_cachedump_cmd, 0, NULL },
{ "frame", db_frame_cmd, 0, NULL },
-/* $OpenBSD: db_interface.c,v 1.57 2022/04/12 19:44:32 naddy Exp $ */
+/* $OpenBSD: db_interface.c,v 1.58 2022/04/14 19:47:12 naddy Exp $ */
/* $NetBSD: db_interface.c,v 1.61 2001/07/31 06:55:47 eeh Exp $ */
/*
extern void db_esp(db_expr_t, int, db_expr_t, char *);
#endif
-struct db_command db_machine_command_table[] = {
+const struct db_command db_machine_command_table[] = {
{ "ctx", db_ctx_cmd, 0, 0 },
{ "dtlb", db_dump_dtlb, 0, 0 },
{ "dtsb", db_dump_dtsb, 0, 0 },
-/* $OpenBSD: db_command.c,v 1.93 2022/04/12 19:44:32 naddy Exp $ */
+/* $OpenBSD: db_command.c,v 1.94 2022/04/14 19:47:12 naddy Exp $ */
/* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */
/*
vaddr_t db_next; /* next address to be examined
or written */
-int db_cmd_search(char *, struct db_command *, struct db_command **);
-void db_cmd_list(struct db_command *);
+int db_cmd_search(char *, const struct db_command *,
+ const struct db_command **);
+void db_cmd_list(const struct db_command *);
void db_ctf_pprint_cmd(db_expr_t, int, db_expr_t,char *);
void db_map_print_cmd(db_expr_t, int, db_expr_t, char *);
void db_buf_print_cmd(db_expr_t, int, db_expr_t, char *);
* Search for command prefix.
*/
int
-db_cmd_search(char *name, struct db_command *table, struct db_command **cmdp)
+db_cmd_search(char *name, const struct db_command *table,
+ const struct db_command **cmdp)
{
- struct db_command *cmd;
+ const struct db_command *cmd;
int result = CMD_NONE;
for (cmd = table; cmd->name != 0; cmd++) {
}
void
-db_cmd_list(struct db_command *table)
+db_cmd_list(const struct db_command *table)
{
- struct db_command *cmd;
+ const struct db_command *cmd;
for (cmd = table; cmd->name != 0; cmd++) {
db_printf("%-12s", cmd->name);
}
void
-db_command(struct db_command **last_cmdp, struct db_command *cmd_table)
+db_command(const struct db_command **last_cmdp,
+ const struct db_command *cmd_table)
{
- struct db_command *cmd;
+ const struct db_command *cmd;
char modif[TOK_STRING_SIZE];
db_expr_t addr, count;
int t, result, have_addr = 0;
* 'show' commands
*/
-struct db_command db_show_all_cmds[] = {
+const struct db_command db_show_all_cmds[] = {
{ "procs", db_show_all_procs, 0, NULL },
{ "callout", db_show_callout, 0, NULL },
{ "pools", db_show_all_pools, 0, NULL },
{ NULL, NULL, 0, NULL }
};
-struct db_command db_show_cmds[] = {
+const struct db_command db_show_cmds[] = {
{ "all", NULL, 0, db_show_all_cmds },
{ "bcstats", db_bcstats_print_cmd, 0, NULL },
{ "breaks", db_listbreak_cmd, 0, NULL },
{ NULL, NULL, 0, NULL }
};
-struct db_command db_boot_cmds[] = {
+const struct db_command db_boot_cmds[] = {
{ "sync", db_boot_sync_cmd, 0, 0 },
{ "crash", db_boot_crash_cmd, 0, 0 },
{ "dump", db_boot_dump_cmd, 0, 0 },
{ NULL, }
};
-struct db_command db_command_table[] = {
+const struct db_command db_command_table[] = {
#ifdef DB_MACHINE_COMMANDS
/* this must be the first entry, if it exists */
{ "machine", NULL, 0, db_machine_command_table },
{ NULL, NULL, 0, NULL }
};
-struct db_command *db_last_command = NULL;
+const struct db_command *db_last_command = NULL;
void
db_help_cmd(db_expr_t addr, int haddr, db_expr_t count, char *modif)
-/* $OpenBSD: db_command.h,v 1.34 2022/04/12 19:44:32 naddy Exp $ */
+/* $OpenBSD: db_command.h,v 1.35 2022/04/14 19:47:12 naddy Exp $ */
/* $NetBSD: db_command.h,v 1.8 1996/02/05 01:56:55 christos Exp $ */
/*
void db_error(char *);
void db_skip_to_eol(void);
void db_command_loop(void);
-void db_command(struct db_command **, struct db_command *);
+void db_command(const struct db_command **, const struct db_command *);
extern vaddr_t db_dot, db_last_addr, db_prev, db_next;
#define CS_MORE 0x2 /* standard syntax, but may have other
words at end */
#define CS_SET_DOT 0x100 /* set dot after command */
- struct db_command *more; /* another level of command */
+ const struct db_command *more; /* another level of command */
};
#ifdef DB_MACHINE_COMMANDS
-extern struct db_command db_machine_command_table[];
+extern const struct db_command db_machine_command_table[];
#endif