Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Fwd: Backtrace stopped: frame did not save the PC
       [not found] <CAESop7Uxpo46gbxiPU9-RnvcEbnzNEOsupuWQCotE0Ev9ha_RQ@mail.gmail.com>
@ 2013-08-19  7:15 ` sravan megan
  2013-08-19 23:33   ` Michael Eager
  0 siblings, 1 reply; 4+ messages in thread
From: sravan megan @ 2013-08-19  7:15 UTC (permalink / raw)
  To: gdb

Hi All,

I am working on Microblaze GDB (7.4.50) version.

GDB is throwing "frame did not save the PC" error if the program is
not compiled with "-g" (debugging info)

Below is a small program I tried to do a back trace at abc function
void abc()
{
printf("Hello World\n\r");
}
void abc1()
{
abc();
}
int main()
{
abc1();
return 0;
}

(gdb) b abc
Breakpoint 1 at 0x80010f94
(gdb) c
Continuing.
Breakpoint 1, 0x80010f94 in abc ()
(gdb) bt
#0 0x80010f94 in abc ()
#1 0x80010fdc in abc1 ()
Backtrace stopped: frame did not save the PC

I know that without debugging information GDB will not give complete
trace information but with out debugging info GDB should atleast give
the function names.

Can anyone please let me know where to look in to GDB code so that
GDBcan store information of main frame details and execute backtrace
correctly.

Thanks,
Sravan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fwd: Backtrace stopped: frame did not save the PC
  2013-08-19  7:15 ` Fwd: Backtrace stopped: frame did not save the PC sravan megan
@ 2013-08-19 23:33   ` Michael Eager
  2013-08-20  6:24     ` sravan megan
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Eager @ 2013-08-19 23:33 UTC (permalink / raw)
  To: gdb, sravan22021987

On 08/19/13 00:15, sravan megan wrote:
> Hi All,
>
> I am working on Microblaze GDB (7.4.50) version.
>
> GDB is throwing "frame did not save the PC" error if the program is not compiled with "-g"
> (debugging info)


> I know that without debugging information GDB will not give complete trace information but with
> out debugging info GDB should atleast give the function names.

As far as I can see from your example, gdb did print the function
names.

You don't indicate what options were used when you compile.
When you compile without optimization, MicroBlaze stores
the previous frame pointer in the stack frame.  With -O1,
MicroBlaze does not save the frame pointer in the stack frame.

> Can anyone please let me know where to look in to GDB code so that GDBcan store information of
> main frame details and execute backtrace correctly.

You can take a look at microblaze_analyze_prologue() in
gdb/microblaze-tdep.c.

The error is issued in get_prev_frame_1() in frame.c.

-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fwd: Backtrace stopped: frame did not save the PC
  2013-08-19 23:33   ` Michael Eager
@ 2013-08-20  6:24     ` sravan megan
  2013-08-20 16:54       ` Michael Eager
  0 siblings, 1 reply; 4+ messages in thread
From: sravan megan @ 2013-08-20  6:24 UTC (permalink / raw)
  To: Michael Eager; +Cc: gdb

Hello Mike,

  Thanks for the reply.

On Tue, Aug 20, 2013 at 5:03 AM, Michael Eager <eager@eagerm.com> wrote:
> On 08/19/13 00:15, sravan megan wrote:
>>
>> Hi All,
>>
>> I am working on Microblaze GDB (7.4.50) version.
>>
>> GDB is throwing "frame did not save the PC" error if the program is not
>> compiled with "-g"
>> (debugging info)
>
>
>
>> I know that without debugging information GDB will not give complete trace
>> information but with
>> out debugging info GDB should atleast give the function names.
>
>
> As far as I can see from your example, gdb did print the function
> names.
>
> You don't indicate what options were used when you compile.
> When you compile without optimization, MicroBlaze stores
> the previous frame pointer in the stack frame.  With -O1,
> MicroBlaze does not save the frame pointer in the stack frame.

    I have used the XSDK to build my application. Below are the compiler flags

Building file: ../src/helloworld.c
Invoking: MicroBlaze gcc compiler
mb-gcc -Wall -O0 -c -fmessage-length=0
-I../../hello_bsp/microblaze_1/include -mlittle-endian
-mxl-pattern-compare -mno-xl-soft-div -mcpu=v8.00.b -mno-xl-soft-mul
-Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP
-MF"src/helloworld.d" -MT"src/helloworld.d" -o "src/helloworld.o"
"../src/helloworld.c"
Finished building: ../src/helloworld.c

Building file: ../src/platform.c
Invoking: MicroBlaze gcc compiler
mb-gcc -Wall -O0 -c -fmessage-length=0
-I../../hello_bsp/microblaze_1/include -mlittle-endian
-mxl-pattern-compare -mno-xl-soft-div -mcpu=v8.00.b -mno-xl-soft-mul
-Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP
-MF"src/platform.d" -MT"src/platform.d" -o "src/platform.o"
"../src/platform.c"
Finished building: ../src/platform.c

Building target: hello.elf
Invoking: MicroBlaze gcc linker
mb-gcc -Wl,-T -Wl,../src/lscript.ld -L../../hello_bsp/microblaze_1/lib
-mlittle-endian -mxl-pattern-compare -mno-xl-soft-div -mcpu=v8.00.b
-mno-xl-soft-mul -Wl,--no-relax -Wl,--gc-sections -o "hello.elf"
./src/helloworld.o ./src/platform.o
-Wl,--start-group,-lxil,-lgcc,-lc,--end-group
Finished building target: hello.elf

I have set the debugging level to none in xsdk i.e no "-g" option in
compilation.
>
>
>> Can anyone please let me know where to look in to GDB code so that GDBcan
>> store information of
>> main frame details and execute backtrace correctly.
>
>
> You can take a look at microblaze_analyze_prologue() in
> gdb/microblaze-tdep.c.
>
> The error is issued in get_prev_frame_1() in frame.c.
>

I looked at them they seem to be good but I have doubt on
"microblaze_frame_prev_register" function.
This function seems to always return r15/r1 registers as regnum for
"trad_frame_get_prev_register" function for any frame in my case. Is
this behaviour correct??

> --
> Michael Eager    eager@eagercon.com
> 1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

Regards,
Sravan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fwd: Backtrace stopped: frame did not save the PC
  2013-08-20  6:24     ` sravan megan
@ 2013-08-20 16:54       ` Michael Eager
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Eager @ 2013-08-20 16:54 UTC (permalink / raw)
  To: sravan megan; +Cc: gdb

On 08/19/13 23:24, sravan megan wrote:

>> You don't indicate what options were used when you compile.
>> When you compile without optimization, MicroBlaze stores
>> the previous frame pointer in the stack frame.  With -O1,
>> MicroBlaze does not save the frame pointer in the stack frame.
>
>      I have used the XSDK to build my application. Below are the compiler flags

You should contact Xilinx technical support for help with
gdb distributed in the Xilinx SDK.  There are differences between
FSF gcc/gdb sources and the sources used to build the SDK.

If you are using a tool chain built with the FSF sources,
I'm better able to help you.

> Building file: ../src/helloworld.c
> Invoking: MicroBlaze gcc compiler
> mb-gcc -Wall -O0 -c -fmessage-length=0
> -I../../hello_bsp/microblaze_1/include -mlittle-endian
> -mxl-pattern-compare -mno-xl-soft-div -mcpu=v8.00.b -mno-xl-soft-mul
> -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP
> -MF"src/helloworld.d" -MT"src/helloworld.d" -o "src/helloworld.o"
> "../src/helloworld.c"
> Finished building: ../src/helloworld.c

You can check the generated code (either assembly or by using objdump)
to confirm that a frame pointer is being saved.

> I looked at them they seem to be good but I have doubt on
> "microblaze_frame_prev_register" function.
> This function seems to always return r15/r1 registers as regnum for
> "trad_frame_get_prev_register" function for any frame in my case. Is
> this behaviour correct??

It depends on whether microblaze_analyze_prologue() determines
if there is a frame or not.  If it believes that there is no
frame, then it always returns R15/R1 for PC/SP.


-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-20 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAESop7Uxpo46gbxiPU9-RnvcEbnzNEOsupuWQCotE0Ev9ha_RQ@mail.gmail.com>
2013-08-19  7:15 ` Fwd: Backtrace stopped: frame did not save the PC sravan megan
2013-08-19 23:33   ` Michael Eager
2013-08-20  6:24     ` sravan megan
2013-08-20 16:54       ` Michael Eager

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox