Re: [PATCH] Fix that different function breakpoints are set at same pc address (PR gdb/12703)

Yao Qi
2011-06-29T08:00:38Z

On 06/29/2011 03:00 PM, Terry Guo wrote:
> 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.
>

> register unsigned long guard asm("r5");
>
> void bar (void);
> void test (void) __attribute__((naked));

attribute naked on the ARM, AVR, MCORE, RX and SPU ports indicates that
the specified function does not need prologue/epilogue sequences
generated by the compiler, so there is no prologue in function test. Of
course, prologue analyzer can't help here.

However, this test case is not a correct program, because code after
"test" is unknown. If you put correct epilogue in "test" to make it
either return to main, or jump to bar, prologue analyzer can handle it
correctly.

Looks this test case is invalid. We have to find a valid/correct case
to show gdb's bug on setting breakpoint, and your patch could fix this bug.

--
Yao (é½å°§)