Object file debugging

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi All,

I have some code compiled and linked with GNU.

I'm trying to debug its ELF using atmel studio 7 - "Object file for debugging".

I'm using Jtag MKII.

I can add some break points for the assembly code - when trying to add breakpoint to the c/c++ code I get "Unable to set requested breakpoint on target.

I'm compiling the code with -g3 flag and -O0 - yet it does not help.

 

Also I noticed that when looking AT dEBUG->wINDOWS->MODULE - I can see that "symbols not loaded".

 

If anyone has successfully debug an external ELF - I'll be happy to hear from his experience.

 

And any help is generally welcome 

Regards,

Lior.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Which microcontroller device are you working on? Really a UC3?

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

valusoft wrote:

Which microcontroller device are you working on? Really a UC3?

Still could be as the JTAG ICE MK II ( big blue box ) is used for AVR32 debugging to, we have a bunch here at work as in the past we have done some AVR32 stuff.

But indeed also wonder what processor, the OP is using

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi the microcontroller is AT32UC3C0512C.

 

We use eclipse with a gcc 4.4.7 toolchain in a linux environment - then I'm using (trying to...) its ELF along with atmel studio 7 for debugging with Jtag MKII.

 

When starting to debug, it starts from main function, then step by step works fine for functions which are in the main file. when trying to step in - debug get lost (shows assembly code).

Also, when trying to set break points on c code I get "Unable to set breakpoint on target". 

Any advice is most welcome...

 

Lior.

Last Edited: Tue. Jan 21, 2020 - 01:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The way ELF works for debugging is that the file contains paths to find the .c and .cpp source files. It does not contain anything like source itself. So if you take an ELF from one file structure to a different machine with a different file structure it may not be able to resolve the file references.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

shamilal wrote:
... then I'm using (trying to...) its ELF along with atmel studio 7 for debugging with Jtag MKII.
Nitrokey Storage may still be on a UC3A3.

Using the debugger in AVR32Studio | GitHub - Nitrokey/nitrokey-storage-firmware: Firmware for the Nitrokey Storage device

 


Nitrokey | Secure your digital life

 

GitHub - Nitrokey/nitrokey-storage-hardware: Hardware project of the Nitrokey Storage device

 

AVR and SAM Downloads Archive | Microchip Technology

mid-page for AVR32 Studio

there's AVR32 Studio 2.7 "somewhere" (Eclipse extensions site?)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

shamilal wrote:
We use eclipse with a gcc 4.4.7 toolchain in a linux environment - ...
IIRC, the file systems are linked between Linux and Windows 10 via WSL.

Learn about the Windows Subsystem for Linux | Microsoft Docs

Announcing WSL 2 | Windows Command Line Tools For Developers

Complete containers may be arriving in Windows 10X; current Windows containers lack HID and may lack USB CDC ACM (virtual COM) (Atmel-ICE programming and debugging is by USB HID)

An Atmel AVR JTAGICE mkII has a serial port (likewise on the clone); desktop and workstation motherboards likely have one or more UART on headers.

WSL 1 and WSL 2 are lacking significant USB and GPU for input/output though there's effort to add these for WSL 2.

 


USB AVR JTAGICE XPII - Waveshare Wiki

 

edit :

Using WSL 2 with Visual Studio Code

September 3, 2019 by Matt Hernandez [VS Code Program Manager]

...

the reference AVR simulator is available :

GitHub - xoriath/vscode-atmel-debug: Debug adapter for Visual Studio code for the Atmel debug backend

https://www.avrfreaks.net/forum/avr-simulators-open-source#comment-2640886

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Sun. Feb 9, 2020 - 11:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks,

I understand that, yet in visual studio 7 , once you choose to debug there is "Remap Object Files" table - which as I understand, mapping the ELF files locations  Original file system  (in linux in my case) to their debugging environment (windows in my case). It looks like the file mapping is OK - since pressing the files in the AS7 project takes me to the relevant file. 

However I can see that not all the files which were part of the project compilation are in the AS7 project - which is weird...

 

Any idea to what am I missing here? 

 

Also, Is there any other way to debug that code (mybe by using its makefile)? 

The project is built with an un managed eclipse environment so I have an external makefile? can I use that external makefile to link my project file for debug only (using JtagMKII)? any manual about that?

 

Thanks all  for your help!!!

 

Lior.