microsoft / microsoft/vscode-cpptools

Breakpoint get ignored since a Cproject trans into a C++ project

Aperta
#5,926 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

debugger
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Type: Debugger

my debugger:GNU gdb (GDB) 8.1

Describe the bug:

  • OS and Version: Windows 10 x64 10.0.18363

  • VS Code Version: 1.47.3

  • C/C++ Extension Version: v0.30.0-insiders

  • Other extensions you installed (and if the issue persists after disabling them):
    Bracket Pair Colorizer 2
    C/C++ Project Generator(I use its to create makefile for project)
    Code Runner
    Debug Visualizer

  • A clear and concise description of what the bug is.
    The debugging can see the yellow director normally when I debug my C projects(2 c files,1 head files),for some reasons I need get my c files change into cpp files and make and debug again,then I find the director is disappeared and the red break dot become grey,I try to change my compiler from gcc to g++ to solve its but it's not work.

To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:

  1. rename all c files as cpp files,and change complier command in makefile from gcc to g++.
  2. Click on Ctrl+F5 for debugging.
  3. Termiral:'.

Executing task: powershell -c mingw32-make <
g++ -std=c++17 -Wall -Wextra -g -Iinclude -Llib src/tree.o src/petclub.o -o bin/main.exe
Terminal will be reused by tasks, press any key to close it....'

  1. the director is disappeared and the red break dot become grey.

my C++ project structure:
D:.
│ Makefile

├─.vscode
│ launch.json
│ tasks.json

├─bin
│ main.exe

├─include
├─lib
└─src
petclub.cpp
petclub.o
tree.cpp
tree.h
tree.o

launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Debug", "type": "cppdbg", "request": "launch", "args": [], "stopAtEntry": true, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "linux": { "MIMode": "gdb", "miDebuggerPath": "gdb", "program": "${workspaceFolder}/bin/main" }, "osx": { "MIMode": "lldb", "miDebuggerPath": "lldb-mi", "program": "${workspaceFolder}/bin/main" }, "windows": { "MIMode": "gdb", "miDebuggerPath": "gdb.exe", "program": "${workspaceFolder}/bin/main.exe" }, "preLaunchTask": "build" } ] }

makefile
`CC := g++
CFLAGS := -std=c++17 -Wall -Wextra -g

BIN := bin
SRC := src
INCLUDE := include
LIB := lib

LIBRARIES :=

ifeq ($(OS),Windows_NT)
EXECUTABLE := main.exe
SOURCEDIRS := $(SRC)
INCLUDEDIRS := $(INCLUDE)
LIBDIRS := $(LIB)
else
EXECUTABLE := main
SOURCEDIRS := $(shell find $(SRC) -type d)
INCLUDEDIRS := $(shell find $(INCLUDE) -type d)
LIBDIRS := $(shell find $(LIB) -type d)
endif

CINCLUDES := $(patsubst %,-I%, $(INCLUDEDIRS:%/=%))
CLIBS := $(patsubst %,-L%, $(LIBDIRS:%/=%))

SOURCES := $(wildcard $(patsubst %,%/*.cpp, $(SOURCEDIRS)))
OBJECTS := $(SOURCES:.cpp=.o)

all: $(BIN)/$(EXECUTABLE)

.PHONY: clean
clean:
-$(RM) $(BIN)/$(EXECUTABLE)
-$(RM) $(OBJECTS)

run: all
./$(BIN)/$(EXECUTABLE)

$(BIN)/$(EXECUTABLE): $(OBJECTS)
$(CC) $(CFLAGS) $(CINCLUDES) $(CLIBS) $^ -o $@ $(LIBRARIES)`

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

Iniziare con il .vscode/launch.json e il Makefile segnalati, quindi riprodurre il comportamento dei breakpoint utilizzando le versioni indicate di Windows, GDB, VS Code e dell’estensione C/C++. Verificare se i breakpoint rimangono attivi dopo aver rinominato i sorgenti in .cpp e ricompilato l’eseguibile; una correzione dovrebbe preservare l’associazione dei breakpoint per il progetto C++.

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

Valutazione

Stack tecnologico
cpp, vscode
Ambito
build-system, devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.