Development Environment / 开发环境

IDE: ARM DS

ARM development studio (DS-5) 5.26
DS-5\v5.26.00\x86_64\setup.exe license: - run "patcher.exe -a" a. generate : patcher.exe --license=ARM_DS_5 . b. use armlic.dat ToolD: D:\ARMX\x32\gcc-linaro-4.9.4-2017.01-i686-mingw32_arm-linux-gnueabihf // unused: \x64\gcc-linaro-4.9.4-2017.01-i686-mingw32_aarch64-linux-gnu // gcc-linaro-4.9.4-2017.01-i686-mingw32_arm-linux-gnueabihf.tar.xz DS5 windows-->Preferences-->DS-5-->Toolchains-->add: add toolchains restart Project properties: C/C++ Build - Settings: - GCC C++ Compiler 4.9.4 [arm-linux-gnueabihf] Includes: add "${workspace_loc:/${ProjName}/src/modules}" and other panda codes dir. Debugging: Debug level: Maximum (-g3) Preprocessor: add: -DUSE_LIBUV // for s_task and libuv - GCC C Compiler 4.9.4 [arm-linux-gnueabihf] Dialect: -std=c99 Symbols: add: -DUSE_LIBUV // for s_task and libuv -D_GNU_SOURCE // libuv migration workaround. DO NOT add in G++ compiler -D_POSIX_C_SOURCE=199309L // for use struct timespec Optimization: None (-O0) // modify from ARM_linux_11f06 default -O3. Includes: add "${workspace_loc:/${ProjName}/src/modules}" and other panda codes dir. Debugging: Debug level: Maximum (-g3) - GCC Assembler 4.9.4 [...] Assambler flags: -mfloat-abi=hard -mfpu=neon // for s_task asm

C++ Code

standard: c++1y = C++14 (gcc c++ 4.9.4+ recognize latter only) // access C++ code from c // in cpp extern "C" int foo(char *bar) { return realFoo(std::string(bar)); } // .h header #ifdef __cplusplus extern "C" { #endif typedef struct duck duck; duck* new_duck(int feet); void delete_duck(duck* d); void duck_quack(duck* d, float volume); #ifdef __cplusplus } #endif // .cpp source struct duck { }; class Duck : public duck { public: Duck(int feet); ~Duck(); void quack(float volume); }; inline Duck* real(duck* d) { return static_cast<Duck*>(d); } duck* new_duck(int feet) { return new Duck(feet); } void delete_duck(duck* d) { delete real(d); } void duck_quack(duck* d, float volume) { real(d)->quack(volume); }

GDB

client

Debug Configurations DS-5 Debugger - create new profile "Linux Application Debug / Application Debug / Connections via gdbserver" - Connection: gdbserver Address / Port: 192.168.10.14:5000 - Files: Load symbols from file: arm elf executable file. Debug F5: Single step (f5): Use this option to execute the program statement by statement. This allows you to branch to other program units. // 函数调用会进入 F6: Execute (f6): Use this option to process a program line by line. All of the statements on the current line are processed in a single step. This allows you to process the whole program. // 函数调用不进入 F7: Return (f7): The Debugger returns to the point at which control is passed back to the main program. Use this option to return from other program units. F8: Continue (f8):Use this option to process the program up to the next breakpoint. If there are no more breakpoints in the program, the system exits debugging mode and executes the rest of the program normally. 在 Debug perspective 右上角 Variables / Breakpoints / Registers 面板右边的向下三角箭头点击 Manage Signals, 取消 SIGALRM 的 STOP / PRINT。否则程序一直会处于 STOP 状态。 * 断点会执行在当前行代码之后位置 STOP。 * 断点的默认模式会 STOP 当前程序的所有线程。 * 程序处于运行状态时无法管理 / 添加断点。 * 程序 RUNNING 状态下调试界面显示的所有程序运行状态信息都不会更新。

host

killall arm_linux_48c03; cd /dpapp/mdm_arm; gdbserver --remote-debug 0.0.0.0:5000 ./arm_linux_48c03 7\n killall gdbserver; killall arm_linux_48c03; cd /root; gdbserver --remote-debug 0.0.0.0:5000 ./arm_linux_48c03 7\n