Skip to content

Breakpoint set to wrong line #2888

@PerennialNovice

Description

@PerennialNovice

Describe the problem

I try to debug my project, but when I set a breakpoint the target halts at a different line

Breakpoint is set to line 236, but as the orange highlight shows, the target hats at line 240

Image

Optimize for debug is ticked

Image

Core logs and symbols are enabled and there is no optimization

Image

Initially it was optimized for debug (-Og), behaviour is the same

xModemMode is declared volatile (did this after stumbling on the shifted breakpoint, but it did change nothing)

Image

When I try stepping through the code, I can reach the line 236 (although nothing works as intended because stepping disturbs the RS232 timings, data is lost, ...)

To reproduce

difficult to give an easy example as it seems to be highly dependent on the exact code
I can provide my source files confidentially if that helps

Expected behavior

debugger should stop at line 236

Arduino IDE version

Version: 2.3.9-nightly-20260330 Date: 2026-03-30T04:12:05.284Z CLI Version: 1.4.1 Copyright © 2026 Arduino SA

Operating system

Windows

Operating system version

win11 26200.7840

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions