platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
136 stars 104 forks source link

debugging with simavr: avr-gdb depends on libncurses.so.5 and libtinfo.so.5 #312

Closed michaels011235 closed 1 year ago

michaels011235 commented 1 year ago

I have just come across this issue but it is closed. Thus I'm starting a new one.

I am using VS Code version 1.77.3 on Debian 11 with the PlatformIO extension version 3.1.1 (2023-03-16). I tried to use simavr to debug a trivial example but it does not work.

My platform.ini file is

[env:myenv]
platform = atmelavr
board = uno
framework = arduino
debug_tool = simavr

and my code is

#include <Arduino.h>

// put function declarations here:
int myFunction(int, int);

void setup() {
  // put your setup code here, to run once:
  int result = myFunction(2, 3);
}

void loop() {
  // put your main code here, to run repeatedly:
}

// put function definitions here:
int myFunction(int x, int y) {
  return x + y;
}

In VS Code I built the project and used Run -> Start Debugging, but I got no call stack, variables, etc. (see image below)

Screenshot from 2023-05-13 12-33-26

The debug console got the error message /home/michael/.platformio/packages/toolchain-atmelavr/bin/avr-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

I suppose this is the reason for the debugger not working. I'd be glad at any help :)

michaels011235 commented 1 year ago
sudo apt install libncurses5 libtinfo5 libncursesw5

solved the issue.