Actions

EmSys

Compiling for GDB

From EdWiki

Compiling for GDB

  • Normally, you would compile a program like:
arm-none-eabi-gcc [flags] <source files> -o <output file>
  • For example:
arm-none-eabi-gcc -Wall -Werror -ansi -pedantic-errors prog1.c -o prog1.x
  • Now you add a "-g" option to enable built-in debugging support (which gdb needs):
arm-none-eabi-gcc [other flags] -gdwarf-2 <source files> -o <output file>
  • For example:
arm-none-eabi-gcc -Wall -Werror -ansi -pedantic-errors -gdwarf-2 prog1.c -o prog1.x