This is the mail archive of the gdb@sourceware.org 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]

Re: problem remote debugging


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


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