This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I use J-Link GDB session to debug assembly code for LPC2148 device. I set a hwbreak at some address in flash. I receive 'SIGTRAP, Trace/breakpoint trap. PC in ?? ()'

I use SEGGER J-Link GDB session to debug assembly code for NXP LPC2148 device. I set a hwbreak at some address in flash. I receive 'SIGTRAP, Trace/breakpoint trap. PC in ?? ()' If I want to step through the code I get 'Cannot find bounds of current function'. Why PC is ??

  • Hi,

    "PC in ??()" indicates that GDB was not able to get the corresponding function for the current PC.

    This explains why stepping through the code does not work either.

    To be able to give you any further information about what is going wrong,

    could you tell us more about what you are doing?

    Are you using GDB directly or via an IDE?

    Can you post the complete GDB communication log?

    - SEGGER Support

  • Jlink_Features.jpgI reinstalled the J-link package on my windows machine and updated the Jtag-Link firmware. I think I miss some licenses to debug proper. Only the GDB feature is active. Should flashbreakpoints work with this feature?

  • Debugging without Flash Breakpoints is possible, but you are limited to the hardware breakpoint units available on the device.

    Nevertheless everything, at least on the J-Link and GDB Server side, is looking good. The application stops at the breakpoint like expected.

    As indicated before, it looks like GDB is not able to find any source location which belongs to the address you set the breakpoint on.

    It might be possible that your application is not compiled with debug symbols (GCC option -g) or there is really no source for this location.

    You could test this by setting a break on a function of which you know it is in your application, for example "break main".

    If GDB sets the breakpoint without an error, let the application continue. It should break and report to be at main().

    If GDB is not able to set the breakpoint, there is a problem with your elf-file.

    - SEGGER Support

  • SIGTRAP.jpgmain_txt.jpg

    I have my doubts.here. Main is residing in Flash at 0x8008. Breakpoint is set by server. But at breakpoint trap the server reads PC at 0x014800c0. Far off the main function address.

    Tnx for reply!