2011-01-16 05:31:24     Using KGDB in u-boot-2010R1-RC2

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2011-01-16 05:31:24     Using KGDB in u-boot-2010R1-RC2

Ivan Koryakovskiy (RUSSIAN FEDERATION)

Message: 97471   

 

I saw some links which explain how to use it with uCLinux, but i did not see anything about debugging standalone applications (I use "go 0x0" to run my application, which is not that standalone actually since it uses u-boot initializations).

 

Anyway, can I use it in my case? And how? Can anyone point me to a right direction since may own experience in gdb is very little.

 

when I run kgdb in u-boot i get the following error. Is it notmal or not? I mean gdbserver should wait for connection (from eclipse plugin or whatever). However, i have the error...

 

bfin> kgdb

Entering KGDB mode via exception handler...

 

 

 

Ack! Something bad happened to the Blackfin!

 

SEQUENCER STATUS:

SEQSTAT: 00000001  IPEND: 0032  SYSCFG: 0000

  HWERRCAUSE: 0x0: undef

  EXCAUSE   : 0x1: custom exception

RETE: <0xd881cd00> { ___smulsi3_highpart + 0xd86367d4 }

RETN: <0x001b12c4> /* unknown address */

RETX: <0x001e35c2> { _kgdb_breakpoint + 0xa }

RETS: <0x001dc55a> { _do_kgdb + 0x22 }

RETI: <0x001d2270> { _start + 0x1f0 }

DCPLB_FAULT_ADDR: <0x001b12c0> /* unknown address */

ICPLB_FAULT_ADDR: <0x001e35c2> { _kgdb_breakpoint + 0xa }

 

PROCESSOR STATE:

R0 : 00000000    R1 : 001b1ef8    R2 : 00000025    R3 : 00000434

R4 : 00000000    R5 : 00000000    R6 : 001b1ef8    R7 : 00000000

P0 : 001b1ef8    P1 : 00000428    P2 : ffc00400    P3 : 001b2000

P4 : 001b1ef4    P5 : 001f0bec    FP : 001b16f8    SP : ffb00f18

LB0: 001d3d0a    LT0: 001d3d0a    LC0: 00000000

LB1: 001df288    LT1: 001df282    LC1: 00000000

B0 : 0000001b    L0 : 00000000    M0 : ffffffbc    I0 : 001b1aae

B1 : 034019d3    L1 : 00000000    M1 : 97607b1f    I1 : 0000000f

B2 : 21401b97    L2 : 00000000    M2 : d6513395    I2 : 00000000

B3 : 75b05d83    L3 : 00000000    M3 : 1340d356    I3 : 001e6a90

A0.w: 00000093   A0.x: 00000000   A1.w: 00000093   A1.x: 00000000

USP : 5118378f  ASTAT: 00003025

 

Hardware Trace:

   0 Target : <0x001d3ac4> { _trap_c + 0x0 }

     Source : <0x001d3324> { _trap + 0x6c }

   1 Target : <0x001d32b8> { _trap + 0x0 }

     Source : <0x001e35c0> { _kgdb_breakpoint + 0x8 }

   2 Target : <0x001e35b8> { _kgdb_breakpoint + 0x0 }

     Source : <0x001dc556> { _do_kgdb + 0x1e }

   3 Target : <0x001dc552> { _do_kgdb + 0x1a }

     Source : <0x001daeba> { _printf + 0x42 }

   4 Target : <0x001daeb0> { _printf + 0x38 }

     Source : <0x001d3244> { _serial_puts + 0x1c }

   5 Target : <0x001d3238> { _serial_puts + 0x10 }

     Source : <0x001d3210> { _serial_putc + 0x3c }

   6 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

   7 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

   8 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

   9 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

  10 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

  11 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

  12 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

  13 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

  14 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

  15 Target : <0x001d31ea> { _serial_putc + 0x16 }

     Source : <0x001d31f8> { _serial_putc + 0x24 }

 

kgdb: handle_exception; trap [0x5]

$T0535:c2351e00;0e:f0111b00;#7e

QuoteReplyEditDelete

 

 

2011-01-16 05:55:10     Re: Using KGDB in u-boot-2010R1-RC2

Ivan Koryakovskiy (RUSSIAN FEDERATION)

Message: 97472   

 

Also, if I switch on the board (u-boot is loaded automatically), run bfin-elf-gdb on host and type "target remote /dev/ttyUSB0" i get this message which means that It cannot connect to kgdb, am i right?

 

(gdb) target remote /dev/ttyUSB0

Remote debugging using /dev/ttyUSB0

Ignoring packet error, continuing...

warning: unrecognized item "timeout" in "qSupported" response

Malformed response to offset query, qOffsets

QuoteReplyEditDelete

 

 

2011-01-16 12:20:28     Re: Using KGDB in u-boot-2010R1-RC2

Mike Frysinger (UNITED STATES)

Message: 97476   

 

currently, kgdb is meant for debugging u-boot itself and not random apps

QuoteReplyEditDelete

 

 

2011-01-16 12:21:00     Re: Using KGDB in u-boot-2010R1-RC2

Mike Frysinger (UNITED STATES)

Message: 97477   

 

you need to tell u-boot to enter kgdb mode.  it has no support for doing this automatically.

Attachments

    Outcomes