Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Lawrence Lee (Shanghai)" <LawrenceLee@viatech.com.cn>
To: 'Kevin Buettner' <kevinb@redhat.com>
Cc: gdb <gdb@sources.redhat.com>
Subject: RE: The question about the relation between gdb and the programme debugged
Date: Tue, 11 Jun 2002 22:30:00 -0000	[thread overview]
Message-ID: <C373923C3B6ED611874200010250D52E0CA70A@exchsh01.viatech.com.cn> (raw)

Thank you very much!!  ^_^


-----Original Message-----
From: Kevin Buettner [mailto:kevinb@redhat.com]
Sent: Wednesday, June 12, 2002 12:26 AM
To: Lawrence Lee (Shanghai); gdb
Subject: Re: The question about the relation between gdb and the
programme debugged


On Jun 11,  9:33am, Lawrence Lee (Shanghai) wrote:

> But how does the gdb process access the memory spaces in the program being
> debugged?

It depends.  For a "native" debugger, the operating system's kernel
provides an interface by which the debugger can read/write the memory
of the process being debugged.  On GNU/Linux (and many other unices),
ptrace() is the interface by which the debugger accesses and controls
memory, registers, and other aspects of the inferior program.  "Pure"
SVR4 systems use the use the /proc filesystem for this interface.

For a remote debugger, the target machine has a debugging "stub"
running on it which provides access to memory, registers, etc.  (GDB
communicates with the stub via a serial port, ethernet, usb, etc.) The
stub may use the same type of interface as described above for a
native debugger to access memory, registers, etc.  Or, if the OS on
the target in question is not very sophisticated, it may simply access
memory directly.

> If the object program uses ioperm and iopl to get the permission to
> read(write) IO port, can the gdb access the IO port also?

Again, it depends.  On most unix systems, this sort of thing is
a security hole and is usually disallowed.  But when using a "cross"
debugger with a remote board, it may be that the OS of the board will
allow access it IO ports.

Kevin


             reply	other threads:[~2002-06-12  5:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-11 22:30 Lawrence Lee (Shanghai) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-10 18:30 FW: " Lawrence Lee (Shanghai)
2002-06-11  9:25 ` Kevin Buettner

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=C373923C3B6ED611874200010250D52E0CA70A@exchsh01.viatech.com.cn \
    --to=lawrencelee@viatech.com.cn \
    --cc=gdb@sources.redhat.com \
    --cc=kevinb@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