This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

The value of inferior_ptid for remote debugging targets


Hi all,

I am porting gdb so that it can be used to debug remote debugging targets, which are embedded processors. gdb communicates with the remote target using a monitor program, running on the same machine as gdb. Gdb invokes the monitor program using `serial_open', and uses pipes to communicate with it.

I am encountering a problem when I try to use watchpoints. Whenever I set a watchpoint, the variable goes out of scope immediately I begin continuing the program being debugged. I have determined that the cause is the following code, which appears in blockframe.c:reinit_frame_cache

/* FIXME: The inferior_ptid test is wrong if there is a corefile. */
if (PIDGET (inferior_ptid) != 0)
{
select_frame (get_current_frame (), 0);
}

The inferior_ptid is 0 when this is called, hence the current frame is never selected. This in turn means that the current scope cannot be determined, and hence watchpoints don't work.

What is the correct value of inferior_ptid for remote targets, and why shouldn't the above code be called when a remote target is active? Should the inferior_ptid be setup so that the above code doesn't fail?

any help greatly appreciated...

dan.

=============================================================================
Daniel Towner
picoChip Designs Ltd., Riverside Buildings, 108, Walcot Street, BATH, BA1 5BG
dant@picochip.com
07786 702589



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]