Skip to content

Alpha 0.1.1 Debugging: breakpoints on local libraries are not considered #120

Closed
@rei-vilo

Description

@rei-vilo

Describe the bug

Breakpoints defined on local libraries are not considered.

To Reproduce

Very basic example with 3 files: Blink.ino, LocalLibrary.h, LocalLibrary.cpp
Two breakpoints defined: one in Blink.ino, another in LocalLibrary.cpp

Expected behavior

Breakpoints defined on local library LocalLibrary.cpp should be considered.

Actually, all the files are duplicated under a temporary folder, /private/var/folders/wn/n7qqb8ss0k3bvpqwfcdwp_7r0000gn/T/arduino-sketch-7CD787D3756B222A4A3572C34ED19F79/sketch/

The breakpoint on Blink.ino is kept, but not the breakpoint on LocalLibrary.cpp.

Workaround

Launch the debugging session.
Define the breakpoint on the local library again.

Screenshots

  • Initial project folder during editing

Capture 2020-02-28 à 15 02 53

  • Initial project folder during debugging

Capture 2020-02-28 à 14 51 28

  • Copy to temporary folder during debugging

Capture 2020-02-28 à 14 50 21

Desktop (please complete the following information):

  • macOS 10.15
  • Arduino Pro IDE 0.0.5
  • SAMD core 1.8.5

Code

  • Blink.ino
#include "LocalLibrary.h"
uint8_t myLED;

void setup()
{
    Serial.begin(9600);
    delay(500);
    Serial.println(__FILE__);

    myLED = LED_BUILTIN;

    pinMode(myLED, OUTPUT);
}

void loop()
{
    Serial.println(millis());

    blinkLED(myLED, 3, 333);
    delay(1000);
}
  • LocalLibrary.h
#include "Arduino.h"

#ifndef blink_LocalLibrary_h
#define blink_LocalLibrary_h

///
/// @brief      Blink a LED
/// @details	LED attached to pin is turned on then off
/// @note       Total cycle duration = ms
/// @param      pin pin to which the LED is attached
/// @param      times number of times
/// @param      ms cycle duration in ms
/// @param		level level for HIGH, default=true=positive logic, false=negative logic
///
void blinkLED(uint8_t pin, uint8_t times, uint16_t ms, bool level = true);
// !!! Help: https://bit.ly/2Bwmyk6

#endif // blink_LocalLibrary_h
  • LocalLibrary.cpp
#include "LocalLibrary.h"

// Code
void blinkLED(uint8_t pin, uint8_t times, uint16_t ms, bool level)
{
    for (uint8_t i = 0; i < times; i++)
    {
        digitalWrite(pin, level ? HIGH : LOW);
        delay(ms >> 1);
        digitalWrite(pin, level ? LOW : HIGH);
        delay(ms >> 1);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions