1 /* This file is part of the program psim.
3 Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 int ppc_trace[nr_trace_options];
31 typedef struct _trace_option_descriptor {
34 const char *description;
35 } trace_option_descriptor;
37 static trace_option_descriptor trace_description[] = {
38 { trace_gdb, "gdb", "calls made by gdb to the sim_calls.c file" },
39 { trace_os_emul, "os-emul", "VEA mode sytem calls - like strace/spy" },
41 { trace_semantics, "semantics", "Instruction execution (issue)" },
42 { trace_idecode, "idecode", "instruction decode (when miss in cache)" },
43 { trace_alu, "alu", "results of integer ALU" },
44 { trace_load_store, "load-store", "transfers to from data registers" },
46 { trace_device_tree, "device-tree", },
47 { trace_devices, "devices" },
48 { trace_pass_device, "pass-device" },
49 { trace_console_device, "console-device" },
50 { trace_icu_device, "icu-device" },
51 { trace_halt_device, "halt-device" },
52 { trace_register_device, "register-device" },
53 { trace_vm_device, "vm-device" },
54 { trace_memory_device, "memory-device" },
55 { trace_htab_device, "htab-device" },
56 { trace_pte_device, "pte-device" },
57 { trace_binary_device, "binary-device" },
58 { trace_file_device, "file-device" },
59 { trace_core_device, "core-device" },
60 { trace_stack_device, "stack-device" },
63 { nr_trace_options, NULL },
67 trace_option(const char *option)
70 if (option[0] == '!') {
71 setting = 0; /* clear it */
74 if (strcmp(option, "all") == 0) {
76 for (i = 0; i < nr_trace_options; i++)
77 ppc_trace[i] = setting;
81 while (trace_description[i].option < nr_trace_options
82 && strcmp(option, trace_description[i].name) != 0)
84 if (trace_description[i].option < nr_trace_options)
85 ppc_trace[trace_description[i].option] = setting;
87 i = strtoul(option, 0, 0);
88 if (i > 0 && i < nr_trace_options)
89 ppc_trace[i] = setting;
91 error("Unknown trace option: %s\n", option);
101 const char *format = "\t%-18s%s\n";
103 printf_filtered("Possible <trace-option>s are:\n");
104 printf_filtered(format, "!<trace-option>", "Disable the specified option");
105 printf_filtered(format, "all", "enable all the trace options");
106 for (i = 0; trace_description[i].option < nr_trace_options; i++)
107 printf_filtered(format,
108 trace_description[i].name,
109 (trace_description[i].description
110 ? trace_description[i].description
114 #endif /* _DEBUG_C_ */