Making GDB attach to gdbserver instead of launching

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

Hi, I am currently developing using Atmel Studio 7 and using the debugger to debug the application. However now we want to use an external hardware debugging device which also flashes the binary (this already works) and has a gdbserver built into it. I could wrap launching gdb in a custom program which prevents it from launching but instead attaches to the server, but I couldn't find any way to make it start the debugger from Atmel Studio without it trying to also build and flash the program.

 

Is there a way to make Atmel Studio debug after running a custom programming tool or launching a debug session separately without it trying to build & flash? Or is there some built-in way to make Atmel Studio 'attach' instead of 'launch' with gdb?

 

This topic has a solution.
Last Edited: Fri. Mar 16, 2018 - 07:05 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Atmel Studio has EDBG for current debuggers though has support for EOL debuggers.

Atmel Studio does not interface via GDB for AVR.

 

Embedded Debugger-Based Tools Protocols User's Guide

http://www.microchip.com/webdoc/GUID-33422CDF-8B41-417C-9C31-E4521ADAE9B4/index.html

http://www.microchip.com/webdoc/AVRLibcReferenceManual/overview_1overview_gdb_insight_ddd.html

 

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

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

huh ok, can you explain what the 'Use GDB' option in the project settings under the Advanced tab does? Doesn't really make sense to me why that's there if it doesn't use it. Or is there some way to use that specified GDB?

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

The 'Use GDB' option changes the debug engine from the atbackend internal one to using gdb. Atmel Studio itself cannot connect to a gdb server (although atbackend can act as a gdb server if someone wants to use it with a gdb-enabled frontend)

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hm ok, I solved this issue now by using MIEngine from Microsoft and adding AtmelStudio 7.0 to the vsixmanifest and changing the GUIDs, it works fine with it. Modified it a bit to match my projects and added a toolbar button. So I guess if someone wants to use some external debuggers from AtmelStudio they can do so by using MIEngine from Microsoft and then using gdb, lldb, etc with the mi communication mode. The only downside to this is that some specialized functions don't work. Surprisingly the I/O panel works fine as it seems to just check the memory view and registers don't work, but other than that everything common works as expected and anything AtmelStudio specific doesn't, as expected.

 

Would still be nice to have support for this in AtmelStudio though as it seems like it can already use GDB and making it connect to a gdbserver is literally just calling target extended-remote ip:port instead of run, so it should be really easy to implement.