"Dr. David Alan Gilbert" <[email protected]> writes:

> * Markus Armbruster ([email protected]) wrote:
>> Philippe Mathieu-Daudé <[email protected]> writes:
>> 
>> > From "monitor/hmp-target.h", only the MonitorDef structure
>> > is target specific (by using the 'target_long' type). All
>> > the rest (even target_monitor_defs and target_get_monitor_def)
>> > can be exposed to target-agnostic units, allowing to build
>> > some of them in meson common source set.
>> >
>> > Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
>> 
>> The only use of the ->get_value() callback I can see is in
>> get_monitor_def(), to implement HMP's $register feature.  I can't see
>> the callback being set.  Is it dead?
>
> I think I see that being used in ppc;
> target/ppc/ppc-qmp-cmds.c
>
> const MonitorDef monitor_defs[] = {
>     { "fpscr", offsetof(CPUPPCState, fpscr) },
>     /* Next instruction pointer */
>     { "nip|pc", offsetof(CPUPPCState, nip) },
>     { "lr", offsetof(CPUPPCState, lr) },
>     { "ctr", offsetof(CPUPPCState, ctr) },
>     { "decr", 0, &monitor_get_decr, },
>     { "ccr|cr", 0, &monitor_get_ccr, },
>     /* Machine state register */
>     { "xer", 0, &monitor_get_xer },
>     { "msr", offsetof(CPUPPCState, msr) },
>     { "tbu", 0, &monitor_get_tbu, },
> #if defined(TARGET_PPC64)
>     { "tb", 0, &monitor_get_tbl, },
> #else
>     { "tbl", 0, &monitor_get_tbl, },
> #endif
>     { NULL },
> };
>
> those monitor_get_* functions are that get_value() aren't they?

You're right.

target/sparc/monitor.c and target/i386/monitor.c have more.

I prefer .member = initial-value when member is optional.

Thanks!


Reply via email to