Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Can't debug startup code Reset_Handler
Can't debug startup code Reset_Handler [message #1819064] Tue, 07 January 2020 05:42 Go to next message
Anthony  Heak is currently offline Anthony HeakFriend
Messages: 5
Registered: January 2020
Junior Member
Hi, maybe somebody can help me with this. I am trying to debug the startup code for my kl25z freedom board. I set a breakpoint at Reset_Handler label which is in file startup_MKL25Z4.S

I am using GDB PEMicro Interface Debugging plugin. In the eclipse 2019-12 Debug Configurations Startup tab, I set breakpoint at Reset_Handler (the label in startup code at address 0x4d0) and uncheck Run on reset checkbox. When starting debugging a new tab is created in the editor with a message:
"Break at address 0x4d0 with no debug information available, or outside of program code"

The code is compiled with debugging information with the -ggdb flag and optimization set to -O0 (no optimatization).

If I set the breakpoint at main, the program debug just fine, I can step through it.

Thanks in advance,
Anthony H.
Re: Can't debug startup code Reset_Handler [message #1819080 is a reply to message #1819064] Tue, 07 January 2020 12:11 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
The debugger is complaining that the startup module does not have debug information. Did you translate it with debugging enabled?

The module seems to be assembly code with C macro pre-processing.


--

Tauno Voipio
Re: Can't debug startup code Reset_Handler [message #1819139 is a reply to message #1819080] Wed, 08 January 2020 15:43 Go to previous messageGo to next message
Anthony  Heak is currently offline Anthony HeakFriend
Messages: 5
Registered: January 2020
Junior Member
Hi Tauno, thanks for replying. startup_MKL25Z4.S is a preprocessed assembly file. In the project properties, Tool Settings tab->Debugging, I have the flags -g3 and -ggdb. I have attached the startup_MKL25Z4.S assemby file.

Thanks,
Anthony H.

Re: Can't debug startup code Reset_Handler [message #1819148 is a reply to message #1819139] Wed, 08 January 2020 19:48 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
First, we should split the problem between Eclipse and GDB.

Have you tried to start the debugger from the console with your run file?

Have you remembered to have the -g switch on the linker command line?

You should take the link map (-Wl,-Map=myfile.map on gcc command line).


--

Tauno Voipio
Re: Can't debug startup code Reset_Handler [message #1819152 is a reply to message #1819148] Thu, 09 January 2020 01:57 Go to previous messageGo to next message
Anthony  Heak is currently offline Anthony HeakFriend
Messages: 5
Registered: January 2020
Junior Member
Hi Tauno,

As for console debugging, I am not proficient in that.
I added the -g flag to the linker, but no difference.
I added -Wl, -Map=dac_adc_demo.map in the gcc miscellanous field, but I got an error.

I have another project that I can successfully debug the startup code. The debug configuration is GDB SEGGER J-Link Debugging.

The project that I am having trouble with has a debugging configuration of GDB PEMicro Interface Debugging.

Regards,
Anthony Heak
Re: Can't debug startup code Reset_Handler [message #1819177 is a reply to message #1819152] Thu, 09 January 2020 14:51 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
For console use of GDB, get the manual from: <https://www.gnu.org/software/gdb/documentation/>. Please check that at least the major version number matches with your copy of GDB.

It is about a quarter century since I have used a PE micro adapter on a MC68332, so I cannot give definitive instructions. My guess is that it is connected as a GDB remote agent to the GDB. The mechanism may be hidden inside the manufacturer's package.

Which object file format is use by the run file (COFF, ELF or something else)?

The GNU translators usually use the binutils package <https://www.gnu.org/software/binutils/>, which includes the assembler and the linker and a bunch of useful tools.

The objdump tool can show details from the run file, including information if there are debugging symbols.

You can add linker map instructions to the linker command. My instruction was for the gcc command line. For the linker it is simply -Map=myfile.map


--

Tauno Voipio
Re: Can't debug startup code Reset_Handler [message #1819205 is a reply to message #1819177] Fri, 10 January 2020 02:14 Go to previous message
Anthony  Heak is currently offline Anthony HeakFriend
Messages: 5
Registered: January 2020
Junior Member
Hi Tauno, thanks for replying again.
Project object file format is ELF (dac_adc_demo.elf)
startup_MKL25Z4.o (startup assembly object file)
I ran arm-none-eabi-objdump --syms startup_MKL25Z4.o I get an output that has a symbol for Reset_Handler. I have attached output file from the command.

Also ran arm-none-eabi-objdump --syms dac_adc_demo.elf > output.symbols
It also has symbol for Reset_Handler. I have attached output file from the command.

Regards,
Anthony H.
Previous Topic:How to run TWO applications in Debug mode - both on Eclipse
Next Topic:cross compiler: eclipse build keep selecting the incorrect cross compiler
Goto Forum:
  


Current Time: Thu Apr 25 00:29:01 GMT 2024

Powered by FUDForum. Page generated in 0.04158 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top