This is the mail archive of the gdb-patches@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: [PATCH] Fix that different function breakpoints are set at same pc address (PR gdb/12703)


Hi,

Here is my case. As for stack backtrace, I wonder whether it works for the function that only contains one single instruction and function that doesn't even has a valid prologue. I also saw that current prologue analyzer cannot handle all cases, so I try to avoid this in a more general way.

unsigned long _etext;
unsigned long _data;
unsigned long _edata;
register unsigned long guard asm("r5");

void bar (void);
void test (void) __attribute__((naked));

void
foo (void)
{
  while(1)
    {
    }
} /* End of function foo.  */

void
test (void)
{
  guard = 10;
}

void
bar (void)
{
    unsigned long *pulSrc, *pulDest;

    pulSrc = &_etext;

    for (pulDest = &_data; pulDest < &_edata;)
      {
         *pulDest++ = *pulSrc++;
      }

    if (*pulSrc > guard)
      guard = 0;
    else
      guard = 1;
}

void
main (int argc, char **argv)
{
  test ();
}




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