oneapi-src / oneapi-src/oneAPI-samples

`gdb-oneapi` debug breakpoint doesn't work at all in VSCode

Aperta
#2,705 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
C++
Stelle
1.2k
Fork
745
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Summary

I can set breakpoints in VSCode. I can see the red dots. However, once I start debugging, the red dots move to other lines. Trying to set breakpoints during debugging is like catching the air! It just either doesn't stick at all or moves to other lines. I am using CMake and this is at the top of my CMakeLists.txt:

cmake_minimum_required(VERSION 3.30.3 FATAL_ERROR)

project(DataStructuresAlgorithms CXX)

set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_BUILD_TYPE "Debug")

# ###############################################################################
# Global compiler options
# https://stackoverflow.com/questions/79444534/vscode-cmake-configure-does-not-generate-cmakecache-txt-from-cmakelists-txt
# CMAKE_CXX_COMPILER_ID is set only at the project() call, when CMake actually detect compilers.
# ###############################################################################
if(MSVC)
    # remove default flags provided with CMake for MSVC
    set(CMAKE_CXX_FLAGS "")
    set(CMAKE_CXX_FLAGS_DEBUG "")
    set(CMAKE_CXX_FLAGS_RELEASE "")
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
    message("-- Setting GNU options from CMakeLists.txt")
    set(CMAKE_CXX_FLAGS "-std=gnu++26 -fdiagnostics-color=always" CACHE STRING "CXX build flags" FORCE)
    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -ggdb3 -Og -g3" CACHE STRING "Debug build flags" FORCE)
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG" CACHE STRING "Release build flags" FORCE)
endif()

Version

Report oneAPI Toolkit version and oneAPI Sample version or hash.

$ gdb-oneapi --version
GNU gdb (Intel(R) Distribution for GDB* 2025.3.0) 16.3
Copyright (C) 2025 Free Software Foundation, Inc.; (C) 2025 Intel Corp.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Environment

Ubuntu 25.10

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il comportamento dei breakpoint in VSCode con gdb-oneapi 16.3 su Ubuntu 25.10, utilizzando la configurazione di CMakeLists.txt mostrata nel report. Confronta i breakpoint impostati prima e durante il debugging e verifica che rimangano sulle righe sorgente previste. Il lavoro è completato quando la causa è stata identificata e una correzione per lo spostamento e il mancato funzionamento dei breakpoint è stata documentata o validata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cmake, cpp, vscode
Ambito
build-system, devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.