Simavr debugging not working in VS Code

I have just come across this issue but it is closed.

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

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)

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

I suppose this is the reason for the debugger not working. Is it? Or am I missing something else?
I’d be glad at any help :slight_smile:

The PlatformIO provided binaries (which in turn may have been provided by the github project pages) do not take binary dependencies into account.

You need to find out how to install the libncurses (5) library in your operating system. That was already e.g. discussed at

Thank you,

sudo apt install libncurses5 libtinfo5 libncursesw5

solved the issue.