Debugger in AVR32 Studio does not stop on all instructions

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been using AVR32 Studio under Windows XP SP2 to debug some of my embedded Linux programs. When debugging a program running on my custom board, it is often the case that the debugger will not stop at at the main() subroutine. Instead, the program will either run to completion, or some of the instructions will be skipped (i.e. gdbserver will not stop at every instruction). For the program that is compiled, I have optimizations at -O0 and debugging at -g3.

The program is being uploaded to the embedded system by AVR Studio via FTP (proftpd server), and it is executed using SSH (dropbear server). I am using the Linux ethernet over USB gadget. The program is being linked statically (-static) since I would get this rather cryptic message if I didn't choose to link statically:

warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Error while mapping shared library sections:
/lib/libc.so.0: No such file or directory.
Error while mapping shared library sections:
/lib/ld-uClibc.so.0: No such file or directory.
Error while reading shared library symbols:
/lib/libc.so.0: No such file or directory.
Error while reading shared library symbols:
/lib/ld-uClibc.so.0: No such file or directory.
Stopped due to shared library event

The message goes away when I use the -static switch. I am wondering if I need to include some additional library for debugging. I am writing the programs currently in C, but I would like to also try C++. Which libraries would I need to link if I choose to link statically?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nkinar wrote:

warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Error while mapping shared library sections:
/lib/libc.so.0: No such file or directory.
Error while mapping shared library sections:
/lib/ld-uClibc.so.0: No such file or directory.
Error while reading shared library symbols:
/lib/libc.so.0: No such file or directory.
Error while reading shared library symbols:
/lib/ld-uClibc.so.0: No such file or directory.
Stopped due to shared library event

Can't help you on the first bit but this is usually caused if you haven't told gdb where your _target's_ shared libraries are. If you're using NFS you can specify eg /nfs/ngw/lib. If you aren't then you should keep a local copy of your target libraries on your host PC and point gdb at them. Otherwise it tries to resolve and extract avr32 symbols from your host libraries. That results in pain.
nkinar wrote:
I am writing the programs currently in C, but I would like to also try C++. Which libraries would I need to link if I choose to link statically?
If you compile with avr32-linux-g++ all the extra C++ libraries will be linked for you. If you still specify -static they will be linked statically, if not, they'll be linked dynamically.

Of course you may still need to specify -lm, -lpthread etc for maths/pthread respectively but that's for C and C++.

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perfect. Worked like a charm.

Thanks for your help, Squidgit. :D