microsoft / microsoft/vscode-cpptools

[FEATURE REQUEST] Support debugging for YACC

Open
#4,942 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger Feature Request more votes needed
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: Debugger

Can't DEBUG YACC files.

I wrote a short yacc file which had a problem.
I wasn't able to attach a debugger to the main function.

I would like to see the following:

  • Being able to set and hit breakpoints in the original .y file

  • Being able to hit breakpoints in the y.tab.c file (generated by yacc).

  • have automatic task support for makefiles (should this be a new issue)?

  • OS and Version: Ubuntu 19.10

  • VS Code Version: ms-vscode.cpptools

  • C/C++ Extension Version: 0.26.3

To Reproduce
I made a short version of a yacc file to highlight the problems.
This yacc file is not supposed to work, it's supposed to highlight the problems with the debugger.
All the files are in this gist: https://gist.github.com/rvanlaar/000c06347ef6fd6bfb5e7ddb8e17f0aa

The y.tab.c is generated with debug options enabled:
yacc -t --debug --verbose hoc1.y

Steps to reproduce the behavior:

  1. Open the files in VSCode
  2. Set a breakpoint on line y.tab.c: 1458
  3. compile with: cc -g y.tab.c -o hoc1
  4. run the debugger
  5. See it doesn't hit the breakpoint while executing

Additional context
https://gist.github.com/rvanlaar/000c06347ef6fd6bfb5e7ddb8e17f0aa#file-full-debug-log
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided hoc1.y and generated y.tab.c files, reproduce the breakpoint failure using yacc -t --debug --verbose hoc1.y and cc -g y.tab.c -o hoc1, then review the linked debugger log. Done means breakpoints can be set and hit in both the original .y file and generated y.tab.c file.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.