This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
RE: Developing for Insight
- From: Keith Seitz <keiths at redhat dot com>
- To: "Liang, James" <jliang at sandia dot gov>
- Cc: "insight at sources dot redhat dot com" <insight at sources dot redhat dot com>
- Date: 22 Apr 2003 14:47:10 -0700
- Subject: RE: Developing for Insight
- Organization:
- References: <71251C7D5FB1D2119C8F0008C7A44ED103792015@es07snlnt.sandia.gov>
On Tue, 2003-04-22 at 14:34, Liang, James wrote:
> I know it hits gdbtk_tcl_idle because I saw function calls with
> gdbtk_tcl_idle being sent to the Tcl/TK interpreter C code.
>
> the "tk gdb_target_has_execution" returns 0
That could be a problem. Insight doesn't think that you have an
inferior. I presume that doing "tk set ::gdb_running" returns 0 as well.
> How do I access that flag in C code?
You need to have a ptid set and target_has_execution must be set. Goofy,
but that's what gdb does. Here's the function from
gdbtk/generic/gdbtk-cmds.c:
static int
gdb_target_has_execution_command (ClientData clientData, Tcl_Interp
*interp,
int objc, Tcl_Obj *CONST objv[])
{
int result = 0;
if (target_has_execution && ! ptid_equal (inferior_ptid, null_ptid))
result = 1;
Tcl_SetBooleanObj (result_ptr->obj_ptr, result);
return TCL_OK;
}
Normally, target's will set inferior_ptid in their "create_inferior"
target method. When there is no such thing as a pid/tid, we make one up.
remote-sim.c, for example, does this:
inferior_ptid = pid_to_ptid (42);
Keith