This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] Fix that different function breakpoints are set at same pc address (PR gdb/12703)
- From: "Terry Guo" <terry dot guo at arm dot com>
- To: "'Yao Qi'" <yao at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>, <pedro at codesourcery dot com>
- Date: Wed, 29 Jun 2011 15:00:04 +0800
- Subject: RE: [PATCH] Fix that different function breakpoints are set at same pc address (PR gdb/12703)
- References: <000901cc34bc$fd1aa6a0$f74ff3e0$@guo@arm.com> <000101cc35fb$8d45ff60$a7d1fe20$@guo@arm.com> <4E0AB9B3.8060104@codesourcery.com>
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 ();
}