problem remote debugging

Paul Pluzhnikov ppluzhnikov@google.com
Wed Feb 25 06:07:00 GMT 2009


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



More information about the Gdb mailing list