All Products
Search
Document Center

Use ECI for GDB debugging

Last Updated: Aug 15, 2019

Select an image: eci_open/centos (the commonly used image).

Select an image version: 7.

ECI

2. Establish an exec connection in the console

Select /bin/bash and click OK to open a shell.

ECI

3. Install GCC and GDB

Run the following command in the shell to install GCC and GDB:

  1. yum -y install gcc gdb

4. Write a C program

  1. #include <stdio.h>
  2. int iterate(int value)
  3. {
  4. if(1 == value)
  5. return 1;
  6. return iterate(value - 1) + value;
  7. }
  8. int main()
  9. {
  10. printf("%d\n", iterate(10));
  11. return 1;
  12. }

5. Use GDB to debug the C program

  1. gcc test.c -g -o test
  2. gdb ./test

ECI