lpcware

GDB Command Line and Vector Catch

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by JAlvarez on Tue Jul 10 12:57:36 MST 2012
Two questions:

1. How can the "vector catch" option be enabled when using GDB from the command line?

2. Would this handler to break into the debugger in a hard fault work with the LPCXpresso toolchain?

void HardFault_Handler (void) {
  if (CoreDebug->DHCSR & 1) { // check C_DEBUGEN == 1 -> Debugger Connected
    __breakpoint (0); // halt program execution here
  }
  while (1); // enter endless loop otherwise
}

It came from this Keil app note.

http://www.keil.com/appnotes/files/apnt209.pdf
Application Note 209 - Using Cortex-M3 and Cortex-M4 Fault Exceptions

Thanks.

BTW - The command line GDB document in the Wiki should be updated to list the LPC18xx/LPC43xx driver (crt_emu_lpc18_43_nxp).

http://support.code-red-tech.com/CodeRedWiki/UsingGDB

Outcomes