Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Dan Towner <dant@picochip.com>
Cc: gdb@sources.redhat.com
Subject: Re: The value of inferior_ptid for remote debugging targets
Date: Tue, 08 Oct 2002 10:36:00 -0000	[thread overview]
Message-ID: <20021008173659.GA16683@nevyn.them.org> (raw)
In-Reply-To: <3DA31691.5090207@picochip.com>

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


  reply	other threads:[~2002-10-08 17:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-08 10:30 Dan Towner
2002-10-08 10:36 ` Daniel Jacobowitz [this message]
2002-10-08 10:54   ` Dan Towner
2002-10-08 11:13     ` Daniel Jacobowitz
2002-10-11 17:51 ` core file Satya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021008173659.GA16683@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=dant@picochip.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox