From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25067 invoked by alias); 20 Aug 2013 06:24:53 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 25047 invoked by uid 89); 20 Aug 2013 06:24:52 -0000 X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.2 Received: from mail-la0-f54.google.com (HELO mail-la0-f54.google.com) (209.85.215.54) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 20 Aug 2013 06:24:51 +0000 Received: by mail-la0-f54.google.com with SMTP id ea20so8399lab.13 for ; Mon, 19 Aug 2013 23:24:48 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.152.18.201 with SMTP id y9mr33199lad.57.1376979888883; Mon, 19 Aug 2013 23:24:48 -0700 (PDT) Received: by 10.114.27.34 with HTTP; Mon, 19 Aug 2013 23:24:48 -0700 (PDT) In-Reply-To: <5212AB55.9050203@eagerm.com> References: <5212AB55.9050203@eagerm.com> Date: Tue, 20 Aug 2013 06:24:00 -0000 Message-ID: Subject: Re: Fwd: Backtrace stopped: frame did not save the PC From: sravan megan To: Michael Eager Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-08/txt/msg00075.txt.bz2 Hello Mike, Thanks for the reply. On Tue, Aug 20, 2013 at 5:03 AM, Michael Eager 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