Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

Debuging C code on android with gdb ?

77

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
77

Debuging C code on android with gdb ?

Posted at 7/26/2017 10:41:21      View:2495 | Replies:0        Print      Only Author   [Copy Link] 1#
I am attempting to debug the android native code using gdb over adb. However when trying to load a file to debug i get a error

  1. "/home/dan/proj/firefly-rk3399/out/target/product/rk3399_firefly_box/symbols/system/bin/service": not in executable format: File format not recognized
Copy the code

from what Ive been able to find in order to debug this adding LOCAL_CFLAGS += -ggdb and LOCAL_STRIP_MODULE = false to android.mk is required. however i am not sure im adding to the correct android.mk file. ive added it to /frameworks/native/cmds/android.mk
Id like to know if i am adding those flags to the correct android.mk file or
if there is a diffrent debug procedure (that allows me to create breakpoints and step through code)

my gdb debug proceedure:
  1. TARGET SETUP:
  2. $ adb shell
  3. #gdbserver localhost:2345 service list

  4. HOST SETUP:
  5. $adb forward tcp:2345 tcp:2345
  6. $~/proj/firefly-rk3399/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-gdb

  7. (gdb) file ~/proj/firefly-rk3399/out/target/product/rk3399_firefly_box/symbols/system/bin/service
Copy the code
For now im just trying to debug from terminal, from what ive read later on you can link it to eclipse

Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list