Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* "cannot find bounds of current function"
@ 2006-10-16  1:05 Turny Dávid
  2006-10-16  9:16 ` Daniel Jacobowitz
  2006-10-17  2:37 ` Michael Snyder
  0 siblings, 2 replies; 6+ messages in thread
From: Turny Dávid @ 2006-10-16  1:05 UTC (permalink / raw)
  To: gdb

Hi,

I like to debug a C program which I compile using gcc for
ARM target. I use these arguments:
-march=armv4t -mcpu=arm7tdmi -g -gdwarf-2 -EL
When I try to execute the "step" or the "next" instruction
with the gdb, then I got this message:
"cannot find bounds of current function"
There is no function in my program except the main().
The "list" instruction is OK. I can see my C code.
How can I execute the next instruction? What I have to do?
Please somebody help me! Thanks!

David

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


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

* Re: "cannot find bounds of current function"
  2006-10-16  1:05 "cannot find bounds of current function" Turny Dávid
@ 2006-10-16  9:16 ` Daniel Jacobowitz
  2006-10-17  2:37 ` Michael Snyder
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2006-10-16  9:16 UTC (permalink / raw)
  To: Turny Dávid; +Cc: gdb

On Mon, Oct 16, 2006 at 03:05:19AM +0200, Turny Dávid wrote:
> I like to debug a C program which I compile using gcc 
> for
> ARM target. I use these arguments:
> -march=armv4t -mcpu=arm7tdmi -g -gdwarf-2 -EL
> When I try to execute the "step" or the "next" 
> instruction
> with the gdb, then I got this message:
> "cannot find bounds of current function"
> There is no function in my program except the main().
> The "list" instruction is OK. I can see my C code.
> How can I execute the next instruction? What I have to 
> do?

This means you are not yet in a function the debugger knows about.
Try "break main" "continue"?

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: "cannot find bounds of current function"
  2006-10-16  1:05 "cannot find bounds of current function" Turny Dávid
  2006-10-16  9:16 ` Daniel Jacobowitz
@ 2006-10-17  2:37 ` Michael Snyder
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2006-10-17  2:37 UTC (permalink / raw)
  To: Turny Dávid; +Cc: gdb

On Mon, 2006-10-16 at 03:05 +0200, Turny Dávid wrote:
> Hi,
> 
> I like to debug a C program which I compile using gcc for
> ARM target. I use these arguments:
> -march=armv4t -mcpu=arm7tdmi -g -gdwarf-2 -EL
> When I try to execute the "step" or the "next" instruction

Hold on -- need a little more context.
What did you do, and what was the state, 
*before* you tried to execute a "step" or "next"?

Is this a remote target?  Native?  Were you in "main"?

> with the gdb, then I got this message:
> "cannot find bounds of current function"
> There is no function in my program except the main().
> The "list" instruction is OK. I can see my C code.
> How can I execute the next instruction? What I have to do?
> Please somebody help me! Thanks!
> 
> David
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 


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

* Re: "cannot find bounds of current function"
  2006-10-17 18:50 Turny Dávid
@ 2006-10-17 20:20 ` Michael Snyder
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2006-10-17 20:20 UTC (permalink / raw)
  To: Turny Dávid; +Cc: Daniel Jacobowitz, gdb

On Tue, 2006-10-17 at 20:50 +0200, Turny Dávid wrote:
> Hi,
> 
> Sorry, I see just now when I execute the continue or step or next  
> command then the openOCD deamon write an error message:
> 
> error: arm7_9_common.c:1771 arm7_9_read_memory():memory read caused data abort
> 
> What is this? :) I dont understand. 

Personally,  I'm not familiar with openOCD.

One thing you might do at this point would be, before you 
tell gdb to "continue", tell it "set debug remote 1".  This
will turn on "remote protocol debugging", so gdb will echo
all traffic between the debugger and the target to the console.

You can then see exactly what was the last thing that happened
before you got the above error.

You should consult the gdb doc to understand the remote protocol, 
but here's a quick hint: messages that begin with "M" are memory
writes, and messages that begin with "m" are memory reads.  You
are looking for a memory read (apparently).  The hexadecimal address
of the memory access will be the first number following the "M" or 
"m".



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

* "cannot find bounds of current function"
@ 2006-10-17 18:50 Turny Dávid
  2006-10-17 20:20 ` Michael Snyder
  0 siblings, 1 reply; 6+ messages in thread
From: Turny Dávid @ 2006-10-17 18:50 UTC (permalink / raw)
  To: Michael Snyder, Daniel Jacobowitz; +Cc: gdb

Hi,

Sorry, I see just now when I execute the continue or step or next  
command then the openOCD deamon write an error message:

error: arm7_9_common.c:1771 arm7_9_read_memory():memory read caused data abort

What is this? :) I dont understand. Please!

Thank You!

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


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

* "cannot find bounds of current function"
@ 2006-10-17 18:23 Turny Dávid
  0 siblings, 0 replies; 6+ messages in thread
From: Turny Dávid @ 2006-10-17 18:23 UTC (permalink / raw)
  To: Michael Snyder, Daniel Jacobowitz; +Cc: gdb

Hi,

Thak You! The details:
My target is remote, the AT91SAM7S256 microcontoller. It has ARM7TDMI  
core. The architecture of it is armv4t.
I use the openOCD created by Dominic Rath. Thank you Dominic! :)
I didnt try this on Linux only on window$ yet. I can use the yagarto  
(native) or the sourcery g++ toolchain (native, but it can use the  
cygwin as well)...the problem is the same in either case.

The code which I like to debug is this:
                            /*test.c*/
main () {                  /*This is just a test code, meaningless.*/
    int a;
    int b;
    while (1) {
       a=2;
       b=3;
       a+=b;
    }
}
COMPILE
==========
    I compile with these parameters:
    > CC -march=armv4t -mcpu=arm7tdmi -LE -g -gdwarf-2 -o test.elf test.c
    where CC is arm-none-eabi-gcc (sourcery g++) or arm-elf-gcc (yagarto).
    After that I create a .bin file.
    > OB -O binary test.elf test.bin
    Where OB is arm-none-eabi-objcopy (sourcery g++) or  
arm-elf-objcopy (yagarto)
    I can compile without any error or warning message.
    I load the test.bin in the flash using JTAG wiggler interface and the
    openOCD.

OPENOCD
==========
    My openOCD config file contain these lines:

    #Deamon configuration
    gdb_port 3333
    telnet_port 4444
    deamon_startup attach

    #JTAG interface configuration
    interface parport
    jtag_speed 0
    reset_config srst_only
    jtag_device 4 0x1 0xf 0xe
    #jtag_nsrst_delay
    #jtag_ntrst_delay

    #Parport options
    parport_port 0x378
    parport_cable wiggler

    #target configuration
    target arm7tdmi little reset_halt 0 arm7tdmi
    #run_and_halt_time
    #working_area

    #Flash configuration
    flash bank at91sam7 0 0 0 0 0

    After the start I have got 2 info:
    info:   openocd.c:82 main(): Open On-Chip Debbuger (2006-09-28 20:00 CEST)
    info:   configuration.c:50 configuration_output_handler(): Command
            deamon_startup not found

    I dont know what is mean the second one, but there is no problem in during
    the flash write. I load the test.bin in the flash using telnet.


LOAD the test.bin
===================
    Start the telnet:
    >telnet localhost 4444
    I get a prompt like this:

    Open On-Chip Debugger
    >
    The sequence is:
    >soft reset
    >flash erase 0 0 15
    >flash write 0 test.bin 0
    >soft reset
    >arm7_9 sw_bkpts enable

    This works well.

Debug
=====================
    I use the arm-elf or the arm-none-eabi gdb...I will sign this just gdb.
    start:
    >gdb test.elf
    then it write some line information about himself. I think maybe  
this would be
    important:
     This GDB was configured as  "--host=i686-pc-mingw32  
--target=arm-elf" ...      (yagarto)
                                                          
--target=arm-none-eabi" ...(sourcery g++)
    I have a celeron 800MHz.
    Then I connect to the remote target (the prompt is (gdb) now )
    (gdb)target remote localhost:3333
      Remote debugging using localhost:3333
      0x000048a0 in ?? ()
    (gdb)

     Now if I try to execute a "step" or "next" I see:
    (gdb)next
      Cannot find bounds of current function
    (gdb)step
      Cannot find bounds of current function

     Daniel Jacobowitz wrote me I am not in the main().I have to make a
     breakpoint at the entry of the main and execute the continue
     command. Thank You Daniel! If I do this then:
    (gdb)break main
      Breakpoint 1 at 0x821c: file test.c, line 6.
    (gdb)continue
      Continuing.

     Thats all...I dont get back the (gdb) prompt...:(
     Where is the mistake? What I can do? Please somebody help me!

The list command is alright and I can debug assembly code without
any trouble.

Thank You!
David

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


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

end of thread, other threads:[~2006-10-17 20:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-16  1:05 "cannot find bounds of current function" Turny Dávid
2006-10-16  9:16 ` Daniel Jacobowitz
2006-10-17  2:37 ` Michael Snyder
2006-10-17 18:23 Turny Dávid
2006-10-17 18:50 Turny Dávid
2006-10-17 20:20 ` Michael Snyder

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