This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bdi2000 and gdb (newbie question)


On Thu, Aug 26, 2004 at 05:17:13PM -0500, Jay Monkman wrote:
> On Thu, Aug 26, 2004 at 03:57:15PM -0500, Mark Beckwith wrote:
> > prompt> gdb CSB337_tst.elf 
> > 
> > (gdb) target remote 192.168.100.44:2001
> > Remote debugging using 192.168.100.44:2001
> > 0x00000000 in ?? ()
> > 
> > // Ok, then I try to step:
> > 
> > (gdb) step  
> > Cannot find bounds of current function
> 
> It doesn't look like you loaded your program. Here's the basic
> sequence I use 
> 
> # gdb
> 
> (gdb) file whatever.elf
> (gdb) load
> (gdb) br main
> (gdb) continue

Ok, thanks for the tip on the load comand.  Here is the sequence I use now.
I've inserted comments with //

# gdb
(gdb) file CSB337_tst.elf
Reading symbols from CSB337_tst.elf...done.
(gdb) target remote 192.168.1.93:2001
Remote debugging using 192.168.1.93:2001
0xffffffff in ?? ()
(gdb) load
Loading section .text, size 0x1dad4 lma 0x20100000
Loading section .data, size 0x12dc lma 0x2011dad4
Loading section .rodata, size 0x6596 lma 0x2011edb0
Start address 0x20100070, load size 152390
Transfer rate: 152390 bits/sec, 299 bytes/write.
(gdb) br main
Note: breakpoint -2 also set at pc 0x2011beac. // don't know where this came from
Breakpoint 1 at 0x2011beac: file main.c, line 45.
(gdb) continue
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
<function called from gdb>
Current language:  auto; currently asm
(gdb) next
    // here, there is a very long pause here, then:
Warning:
Cannot insert breakpoint 0.
Error accessing memory address 0xdead: Unknown error 4294967295.
    // the bdi console also outputs:
# TARGET: all hardware breakpoints in use

So it looks like my breakpoint setup is incorrect, right?   I have the BDI
configured for HARD breakpoints.  Is there something else I need to do?  

Also, if I don't insert a breakpoint, and then just type continue, and hit
control-c a few seconds later I get:

(gdb) c
Continuing.

Program received signal SIGSTOP, Stopped (signal).
Cannot remove breakpoints because program is no longer writable.
It might be running in another process.
Further execution is probably impossible.
0x00000000 in ?? ()

My endianness is set to LITTLE.  

Thanks,

Mark

> 
> There are a few things to keep in mind when using the BDI-2000 with
> GDB. 
>  - You need to load the file before you do start trying to run it.
>  - Use 'continue' not 'run' to initiate execution.
>  - Make sure you have the BDI-2000 configured for the correct 
>    type of breakpoints.
>  - (ARM specific) It is frequently good to put break points at the
>     data and instruction expection vectors:
>       br *0xc
>       br *0x10

-- 
Mark Beckwith, Intrig (http://www.intrig.com)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]