* The value of inferior_ptid for remote debugging targets
@ 2002-10-08 10:30 Dan Towner
2002-10-08 10:36 ` Daniel Jacobowitz
2002-10-11 17:51 ` core file Satya
0 siblings, 2 replies; 5+ messages in thread
From: Dan Towner @ 2002-10-08 10:30 UTC (permalink / raw)
To: gdb
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: The value of inferior_ptid for remote debugging targets
2002-10-08 10:30 The value of inferior_ptid for remote debugging targets Dan Towner
@ 2002-10-08 10:36 ` Daniel Jacobowitz
2002-10-08 10:54 ` Dan Towner
2002-10-11 17:51 ` core file Satya
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2002-10-08 10:36 UTC (permalink / raw)
To: Dan Towner; +Cc: gdb
On Tue, Oct 08, 2002 at 06:32:01PM +0100, Dan Towner wrote:
> 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...
Are you hitting the code in remote_open_1:
/* Without this, some commands which require an active target (such
as kill) won't work. This variable serves (at least) double duty
as both the pid of the target process (if it has such), and as a
flag indicating that a target is active. These functions should
be split out into seperate variables, especially since GDB will
someday have a notion of debugging several processes. */
inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);
?
Or, it sounds like you're using your own remote protocol module. If so
that's probably the bit you're missing.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: The value of inferior_ptid for remote debugging targets
2002-10-08 10:36 ` Daniel Jacobowitz
@ 2002-10-08 10:54 ` Dan Towner
2002-10-08 11:13 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Dan Towner @ 2002-10-08 10:54 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
> Are you hitting the code in remote_open_1:
No.
> Or, it sounds like you're using your own remote protocol module. If so
> that's probably the bit you're missing.
I copied it from remote_e7000.c. Would it be missing from that as well?
Do I have to explicitly set inferior_ptid with some sensible values?
Dan.
=============================================================================
Daniel Towner
picoChip Designs Ltd., Riverside Buildings, 108, Walcot Street, BATH,
BA1 5BG
dant@picochip.com
07786 702589
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: The value of inferior_ptid for remote debugging targets
2002-10-08 10:54 ` Dan Towner
@ 2002-10-08 11:13 ` Daniel Jacobowitz
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2002-10-08 11:13 UTC (permalink / raw)
To: Dan Towner; +Cc: gdb
On Tue, Oct 08, 2002 at 06:55:41PM +0100, Dan Towner wrote:
> >Are you hitting the code in remote_open_1:
>
> No.
>
> >Or, it sounds like you're using your own remote protocol module. If so
> >that's probably the bit you're missing.
>
> I copied it from remote_e7000.c. Would it be missing from that as well?
> Do I have to explicitly set inferior_ptid with some sensible values?
Bad choice of example code. I recommend you read through remote_open_1
in remote.c. Yes, you do.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread
* core file
2002-10-08 10:30 The value of inferior_ptid for remote debugging targets Dan Towner
2002-10-08 10:36 ` Daniel Jacobowitz
@ 2002-10-11 17:51 ` Satya
1 sibling, 0 replies; 5+ messages in thread
From: Satya @ 2002-10-11 17:51 UTC (permalink / raw)
To: gdb
Hi,
I am getting a segmentation fault in my multi threaded program when
i am running it under gdb. I want to obtain the core dump of the file. Can
any one tell me how i can do this. (I do not get the segmenatation fault
when i run the program outide gdb).
Thanks,
Satya
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-10-12 0:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-08 10:30 The value of inferior_ptid for remote debugging targets Dan Towner
2002-10-08 10:36 ` Daniel Jacobowitz
2002-10-08 10:54 ` Dan Towner
2002-10-08 11:13 ` Daniel Jacobowitz
2002-10-11 17:51 ` core file Satya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox