Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Pluzhnikov <ppluzhnikov@google.com>
To: Brendan Miller <catphive@catphive.net>
Cc: gdb@sourceware.org
Subject: Re: problem remote debugging
Date: Wed, 25 Feb 2009 06:07:00 -0000	[thread overview]
Message-ID: <8ac60eac0902242207i491f699dud53c36a20bd61095@mail.gmail.com> (raw)
In-Reply-To: <ef38762f0902241151y756a0177x3f06eda60941a11b@mail.gmail.com>

On Tue, Feb 24, 2009 at 11:51 AM, Brendan Miller <catphive@catphive.net> wrote:

> Intuitively that seemed wrong to me because if a breakpoint is in the
> wrong place, or outside the text segment, then I'd just expect it to
> break in a different place, or not at all.

What if a "breakpoint" is set in read-only data or .bss of the program?
Imagine that an arbitrary data byte in your program is replaced with 0xCC.
Will your program surivive any such replacement?

For example:

  size_t foo()
  {
    static char *p = NULL;
    if (!p) { p = strdup("Hello"); }
    return strlen(p);
  }

What will this routine return if "p" is overwritten by 0x000000CC
by GDB before the execution starts?

Cheers,
-- 
Paul Pluzhnikov


      reply	other threads:[~2009-02-25  6:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24  0:59 Brendan Miller
2009-02-24  2:25 ` teawater
2009-02-24  2:33 ` Daniel Jacobowitz
2009-02-24 17:01   ` Brendan Miller
2009-02-24 17:08     ` Daniel Jacobowitz
2009-02-24 19:52       ` Brendan Miller
2009-02-25  6:07         ` Paul Pluzhnikov [this message]

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=8ac60eac0902242207i491f699dud53c36a20bd61095@mail.gmail.com \
    --to=ppluzhnikov@google.com \
    --cc=catphive@catphive.net \
    --cc=gdb@sourceware.org \
    /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