0

I'm working on bare metal Programming on the Beaglebone Black with a Segger J-link under Ubuntu linux with the arm-none-eabi toolchain.

So now i get every time the error No source aviailable for "0x...."

When I pause the bone I get following in the Disassembly:

b6e93ce1:   inc %ebx
b6e93ce2:   fdivl -0x4922eb40(%esi)
b6e93ce8:   call 0xdfa019f7
b6e93ced:   add %ch,%bl
b6e93cef:   mov $0x50,%dh
b6e93cf1:   add $0xdd,%al
b6e93cf3:   mov $0xa4,%dh
b6e93cf5:   or %ebp,%ebx
b6e93cf7:   mov $0xcc,%dh
b6e93cf9:   inc %eax
b6e93cfa:   fnsave -0x4922bf2c(%esi)
b6e93d00:   add %al,(%eax)
b6e93d02:   add %al,(%eax)
b6e93d04:   add %al,(%eax)
b6e93d06:   add %al,(%eax)
b6e93d08:   js 0xb6e93d4c
b6e93d0a:   fnsave -0x4922bb54(%esi)
b6e93d10:   xor $0x42,%al
b6e93d12:   fnsave -0x4922cfc0(%esi)
b6e93d18:   mov $0x42,%ah
b6e93d1a:   fnsave -0x4922cf98(%esi)
b6e93d20:   cmp $0x31,%al
b6e93d22:   fnsave -0x4922b92c(%esi)
b6e93d28:   xorb $0xdd,(%edx)
b6e93d2b:   mov $0xe0,%dh
b6e93d2d:   xor %ebx,%ebp
b6e93d2f:   mov $0xf0,%dh

When I start debugging the programm the J-Link restarts the bone correct but then the linux starts and not my Programm.

Frant
  • 3,769
  • 1
  • 11
  • 20
lox
  • 3
  • 3

1 Answers1

0

You may have several problems here, but the most severe is that you are using a version of gdb targeted for Intel processors: ebx, esi and friends are Intel 32 bits registers.

You have to use arm-none-eabi-gdb, not the gdb that comes with Ubuntu.

An easy way to avoid confusion is to explicitly use arm-none-eabi-gcc, arm-none-eabi-as, arm-none-eabi-ld and friends in your scripts and make files.

J-Links comes with a gdb-server software that acts as an intermediary between GDB and the JTAG hardware. Once the gdb-server is running, you can start a debugging session, assuming you are using a version of GDB debugger that matches your target processor.

This is obviously not your case, since your disassembled code looks pretty much like x86 assembly language code. This makes me think you are using a GDB executable compiled for an x86 target. You therefore really do need to get a version of GDB compiled for use with ARM targets.

You will find a version suitable to your needs in the bin directory of a Linaro toolchain, either for Windows or Linux. Its name will be arm-none-eabi-gdb.exe (Windows) or arm-none-eabi-gdb (Linux).

Frant
  • 3,769
  • 1
  • 11
  • 20
  • I use the GDB that comes with segger J-link. – lox Oct 11 '14 at 21:18
  • For the record, I understand you think you do, but there is no such a thing as a GDB provided with Segger J-Link software, even though Segger is providing a GDB server software an arm-none-eabi-gdb GDB can connect to. Again, the fact that you were displaying Intel x86 instructions with the GDB you were using does definitively prove you were not using a suitable GDB debugger for ARM, but rather a version suitable for debugging the Intel x86 architecture. – Frant Jan 23 '18 at 20:58