2 * Simulator of microcontrollers (cmd.src/info.cc)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
39 * INFO BREAKPOINTS command
43 //cl_info_bp_cmd::do_work(class cl_sim *sim,
44 // class cl_cmdline *cmdline, class cl_console_base *con)
45 COMMAND_DO_WORK_UC(cl_info_bp_cmd)
50 con->dd_printf("Num Type Disp Hit Cnt Address What\n");
51 for (i= 0; i < uc->fbrk->count; i++)
53 class cl_brk *fb= (class cl_brk *)(uc->fbrk->at(i));
54 s= uc->disass(fb->addr, NULL);
55 con->dd_printf("%-3d %-10s %s %-5d %-5d 0x%06x %s\n", fb->nr,
56 "fetch", (fb->perm==brkFIX)?"keep":"del ",
61 for (i= 0; i < uc->ebrk->count; i++)
63 class cl_ev_brk *eb= (class cl_ev_brk *)(uc->ebrk->at(i));
64 con->dd_printf("%-3d %-10s %s %-5d %-5d 0x%06x %s\n", eb->nr,
65 "event", (eb->perm==brkFIX)?"keep":"del ",
70 class cl_rom *r= (class cl_rom *)(sim->uc->mem(MEM_ROM));
71 for (a= 0; a < sim->uc->get_mem_size(MEM_ROM); a++)
73 if (r->bp_map->get(a))
74 con->dd_printf("0x%06x\n", a);
81 * INFO REGISTERS command
85 //cl_info_reg_cmd::do_work(class cl_sim *sim,
86 // class cl_cmdline *cmdline, class cl_console_base *con)
87 COMMAND_DO_WORK_UC(cl_info_reg_cmd)
99 //cl_info_hw_cmd::do_work(class cl_sim *sim,
100 // class cl_cmdline *cmdline, class cl_console_base *con)
101 COMMAND_DO_WORK_UC(cl_info_hw_cmd)
104 class cl_cmd_arg *params[4]= { cmdline->param(0),
109 if (cmdline->syntax_match(uc, HW)) {
110 hw= params[0]->value.hw;
114 con->dd_printf("%s\n", short_help?short_help:"Error: wrong syntax\n");
125 //cl_info_stack_cmd::do_work(class cl_sim *sim,
126 // class cl_cmdline *cmdline, class cl_console_base *con)
127 COMMAND_DO_WORK_UC(cl_info_stack_cmd)
131 cl_stack_op::info_head(con);
132 for (i= uc->stack_ops->count-1; i >= 0; i--)
134 class cl_stack_op *so= (class cl_stack_op *)(uc->stack_ops->at(i));
142 * INFO MMEORY command
143 *----------------------------------------------------------------------------
146 COMMAND_DO_WORK_UC(cl_info_memory_cmd)
150 con->dd_printf("Memory chips:\n");
151 for (i= 0; i < uc->memchips->count; i++)
153 class cl_memory_chip *m= (class cl_memory_chip *)(uc->memchips->at(i));
155 con->dd_printf(" 0x%06x-0x%06x %8d %s (%d,%s,%s)\n",
156 m->get_start_address(),
157 m->highest_valid_address(),
160 m->width, m->data_format, m->addr_format);
162 con->dd_printf("Address spaces:\n");
163 for (i= 0; i < uc->address_spaces->count; i++)
165 class cl_address_space *m=
166 (class cl_address_space *)(uc->address_spaces->at(i));
168 con->dd_printf(" 0x%06x-0x%06x %8d %s (%d,%s,%s)\n",
169 m->get_start_address(),
170 m->highest_valid_address(),
173 m->width, m->data_format, m->addr_format);
175 con->dd_printf("Address decoders:\n");
176 for (i= 0; i < uc->address_spaces->count; i++)
178 class cl_address_space *m=
179 (class cl_address_space *)(uc->address_spaces->at(i));
181 for (j= 0; j < m->decoders->count; j++)
183 class cl_address_decoder *d=
184 (class cl_address_decoder *)(m->decoders->at(j));
185 con->dd_printf("%2d ", j);
186 if (d->address_space)
188 con->dd_printf("%s ", d->address_space->get_name("unknown"));
189 con->dd_printf(d->address_space->addr_format, d->as_begin);
191 con->dd_printf(d->address_space->addr_format, d->as_end);
195 con->dd_printf(" -> ");
198 con->dd_printf("%s ", d->memchip->get_name("unknown"));
199 con->dd_printf(d->memchip->addr_format, d->chip_begin);
203 con->dd_printf(" %s\n", (d->activated)?"activated":"inactive");
210 /* End of cmd.src/info.cc */