On Mon, Nov 2, 2009 at 11:12 AM, David Brownell <davi...@pacbell.net> wrote:
> On Sunday 01 November 2009, Øyvind Harboe wrote:
>> static int arm11_simulate_step(target_t *target, uint32_t *dry_run_pc)
>> {
>>         struct arm_sim_interface sim;
>>
>>         sim.user_data=target->arch_info;
>>         sim.get_reg=&arm11_sim_get_reg;
>>         sim.set_reg=&arm11_sim_set_reg;
>>         sim.get_reg_mode=&arm11_sim_get_reg;
>>         sim.set_reg_mode=&arm11_sim_set_reg;
>>         sim.get_cpsr=&arm11_sim_get_cpsr;
>>         sim.get_mode=&arm11_sim_get_mode;
>>         sim.get_state=&arm11_sim_get_state;
>>         sim.set_state=&arm11_sim_set_state;
>>
>>         return arm_simulate_step_core(target, dry_run_pc, &sim);
>>
>> }
>
> That is, encapsulate the "step" (or disassemble, etc)
> logic in an object that's distinct from the target.
>
> That's a good general technique.  It's wrong to have
> stuffed *everything* in the target class hierarchy;
> there are other kinds of entities, which should be
> loosely coupled to targets (not *tightly* as now).

So in any decent OO system, it's possible to optionally implement
interfaces such as the above...


-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to