This works, i need the global command context to access this variable from c:
/* from openocd.c */
extern struct command_context *global_cmd_ctx;
/* get the interpreter */
Jim_Interp *interp = global_cmd_ctx->interp;
Jim_Obj * memspace = Jim_GetGlobalVariableStr(interp,"memspace", JIM_NONE);
if ( memspace)
{
printf("memspace: %s\n",Jim_GetString(memspace,NULL));
}
else
{
printf("memspace not found\n");
}
Am 18.02.2011 08:58, schrieb Øyvind Harboe:
>> Now i need to access this variable from c.
>
> Use a Tcl C function to read the contents of the variable?
>
> Jim_GetVariable - see jimtcl/jim.c
>
> I guess I don't know enough about the context to reply sensibly.
>
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development