C program debugging with eclipse

kermit
 
Posts: 6
Joined: Sat Sep 23, 2017 10:54 pm

C program debugging with eclipse

Tue Oct 10, 2017 7:59 pm

Hello
Have someone tried debugging C program for voCore2 and succeed?
I followed this tutorial to setup eclipse:
https://docs.labs.mediatek.com/resource ... clipse-ide
Everything goes fine, untill i stuck with error which goes "remote 'g' packet reply is too long" (see attachment 1)


None of set main() breakpoints working, something only stucks at program start(see attachment 2), but i don`t now why debugger set program counter there, when i try to resume program i get mentioned error

Greetings
Attachments
eclipse_error2.png
eclipse_error2.png (116.2 KiB) Viewed 5499 times
eclipse_error.png
eclipse_error.png (148.62 KiB) Viewed 5499 times

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: C program debugging with eclipse

Thu Oct 12, 2017 2:19 pm

As I know it is a GDB issue, you need to recompile your GDB with a special flag...(can not remember but can be find at google), then replace the default GDB of eillesp currently using, everything will work.
I have tried this before and get same result when using command line, solved by recompile GDB, later I will update my blog, good luck.

kermit
 
Posts: 6
Joined: Sat Sep 23, 2017 10:54 pm

Re: C program debugging with eclipse

Thu Oct 12, 2017 6:37 pm

Wow, finally after three days i resolved this issue, thanks for hint Vonger.
So, problem was with missing expat library, if someone will have similar problem this is what You have to do:
1. Install expat library on your host machine
on ubuntu 15.04:
Code: Select all
 sudo apt-get install expat libexpat1-dev

probably only one of these are needed, but don`t really sure which one of these
2. Edit gdb makefile( [openWrt_dir]/toolchain/gdb/Makefile ), we need to add line " --with-expat" to "define Host/Configure" procedure
so it looks like this
Code: Select all
define Host/Configure
   (cd $(HOST_BUILD_DIR); \
      gdb_cv_func_sigsetjmp=yes \
      CFLAGS="-O2" \
      $(HOST_BUILD_DIR)/configure \
      --prefix=$(TOOLCHAIN_DIR) \
      --build=$(GNU_HOST_NAME) \
      --host=$(GNU_HOST_NAME) \
      --target=$(REAL_GNU_TARGET_NAME) \
      --disable-werror \
      --without-uiout \
      --disable-tui --disable-gdbtk --without-x \
      --without-included-gettext \
      --enable-threads \
      --with-expat \
   );
endef

3. Rebuild gdb with command
Code: Select all
make toolchain/gdb/{clean,compile,install}

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Re: C program debugging with eclipse

Thu Oct 12, 2017 11:34 pm

This post may be of interest. It is very old, it worked with the original VoCore2 sources. There will be some differences, at least the part about SD card error messages isn't needed any more.

All of my eclipse/openwrt info is based on this

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: No registered users and 44 guests