git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: contrib/vscode/: debugging with vscode and gdb

From
Guillaume Cogoni <cogoni.guillaume@gmail.com>
Date
Apr 3, 2022, 20:18 UTC
Message-ID
<CAA0Qn1tscbh-jzRDxL-9heMA4Nu8Z=7ssuT6cTeKGB_yvKgwBA@mail.gmail.com>
In-Reply-To
<CANteD_yZ8de2i54EUWW=d6eVzpiKm5NNHGVEKrXOmo5KXnXUVQ@mail.gmail.com>
Hello,

We don't know if we can revive this topic, but we still think that it's a good idea to talk more about "how it can be useful to use the debugging tool that gives VS Code".

So, we make a patch about it. We retrieve what Derrick Stolee did and add what we said in our previous mail.

Thanks, Cogoni Guillaume and Jonathan Bressat

--------------------->8-----------------------------------
Subject: [PATCH 0/1] contrib/vscode/: debugging with VS Code and gdb
COGONI Guillaume (1):
contrib/vscode/: debugging with VS Code and gdb
| Documentation/MyFirstContribution.txt | 12 ++++++++++++
| contrib/vscode/README.md | 5 +++++
| contrib/vscode/init.sh | 1 -
| 3 files changed, 17 insertions(+), 1 deletion(-)
-- 
2.25.1

Date: Sun, 3 Apr 2022 21:47:02 +0200
Subject: [PATCH 1/1] contrib/vscode/: debugging with VS Code and gdb

Remove "externalConsole" line in contrib/vscode/init.sh because it
seems to not work for everyone, and after a discussion with Matthieu
Moy and Derrick Stolee, we agreed that it is better to let the user choose
what to do with this line (Add his own configuration).

Add useful links in contrib/vscode/README.md to help the user to
configure his VS Code and how to use the debugging feature.

Add a mention to the README in Documentation/MyFirstContribution.txt
and a part "To convince a newcomer that VS Code can help him".

Signed-off-by: COGONI Guillaume <cogoni.guillaume@gmail.com>
Co-authored-by: BRESSAT Jonathan <git.jonathan.bressat@gmail.com>
Helped-by: Matthieu Moy <Matthieu.Moy@univ-lyon1.fr>
Helped-by: Derrick Stolee <derrickstolee@github.com>
---
Documentation/MyFirstContribution.txt | 12 ++++++++++++
contrib/vscode/README.md | 5 +++++
contrib/vscode/init.sh | 1 -
3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/Documentation/MyFirstContribution.txt
b/Documentation/MyFirstContribution.txt
index 63a2ef5449..97f53f536d 100644
--- a/Documentation/MyFirstContribution.txt
+++ b/Documentation/MyFirstContribution.txt
@@ -1265,3 +1265,15 @@ against the appropriate GitGitGadget/Git branch.
If you're using `git send-email`, you can use it the same way as before, but you
should generate your diffs from `<topic>..<mybranch>` and base your work on
`<topic>` instead of `master`.
+
+[[Bonus-useful-tools]]
+== Bonus - useful tools
+
+=== VS Code
+
+To see "how to use VS Code" read contrib/vscode/README.md.
+If you want to try to understand "how git works internally", the debugging
+feature of VS Code can help you. It will not give you all the keys to
fully understand it, but
+it can give you an idea of "how the information travels inside the code".
+It can help you to isolate some parts of code, with this you are able
+to ask more precise questions when you are stuck. (See getting-help sections).
\ No newline at end of file

diff --git a/contrib/vscode/README.md b/contrib/vscode/README.md
index 8202d62035..a416a752c1 100644
--- a/contrib/vscode/README.md
+++ b/contrib/vscode/README.md
@@ -8,6 +8,11 @@ code editor which runs on your desktop and is available for
[Linux](https://code.visualstudio.com/docs/setup/linux). Among other languages,
it has [support for C/C++ via an
extension](https://github.com/Microsoft/vscode-cpptools).
+To understand "how works the debugging part" read:
+[Help with the debugging
part](https://code.visualstudio.com/docs/editor/debugging)
+To get help about "how to personalize your settings" read:
+[How to set up your
settings](https://code.visualstudio.com/docs/getstarted/settings)
+
To start developing Git with VS Code, simply run the Unix shell script called
`init.sh` in this directory, which creates the configuration files in
`.vscode/` that VS Code consumes. `init.sh` needs access to `make` and `gcc`,

diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh
index 27de94994b..f139fd8644 100755
--- a/contrib/vscode/init.sh
+++ b/contrib/vscode/init.sh
@@ -271,7 +271,6 @@ cat >.vscode/launch.json.new <<EOF ||
"stopAtEntry": false,
"cwd": "\${workspaceFolder}",
"environment": [],
- "externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "$GDBPATH",
"setupCommands": [
-- 
2.25.1

On Sat, Mar 26, 2022 at 3:11 PM Jonathan Bressat
<git.jonathan.bressat@gmail.com> wrote:
>
> On 3/25/2022 2:27 PM, Matthieu Moy wrote:
>
> > I couldn't understand what exactly the option was supposed to do. If I
> > understand correctly, it should launch another window to show the git
> > program output, but I don't know which window actually (xterm?
> > x-terminal-emulator? a terminal program that isn't installed on my system?).
>
> In VS Code settings, it seems to be x-terminal-emulator.
>
>
> On 3/25/2022 8:01 PM, Derrick Stolee <derrickstolee@github.com> wrote :
> > >> - "externalConsole": true,
> > >> + "externalConsole": false,
> > I'd actually remove the line completely, to mean "let VSCode decide what to do", i.e. either VSCode's default, or the user's configuration ("launch" section in settings.json, see e.g. https://code.visualstudio.com/docs/getstarted/settings ). If some user has a > non-broken externalConsole: true VSCode and likes this behavior, then the best place to configure it is in a user-wide config file IHMO.
> >
> > I confirmed that deleting the line works just fine.
>
> Yes, we agree with both of you, remove the line completly is better
> because it let the user choices his preferences.
> And it also work for us.
>
> > Reported-by: Jonathan Bressat <git.jonathan.bressat@gmail.com>
> > Reported-by: Cogoni Guillaume <cogoni.guillaume@gmail.com>
> > Helped-by: Matthieu Moy <Matthieu.Moy@univ-lyon1.fr>
> > Signed-off-by: Derrick Stolee <derrickstolee@github.com>
> > ---
> > contrib/vscode/init.sh | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh
> > index 27de94994b5..f139fd86444 100755
> > --- a/contrib/vscode/init.sh
> > +++ b/contrib/vscode/init.sh
> > @@ -271,7 +271,6 @@ cat >.vscode/launch.json.new <<EOF ||
> > "stopAtEntry": false,
> > "cwd": "\${workspaceFolder}",
> > "environment": [],
> > - "externalConsole": true,
> > "MIMode": "gdb",
> > "miDebuggerPath": "$GDBPATH",
> > "setupCommands": [
> > --
> > 2.35.1.138.gfc5de29e9e6
> >
> >
>
> https://code.visualstudio.com/docs/editor/debugging
> https://code.visualstudio.com/docs/getstarted/settings
> Maybe, It would be nice to add these two links in
> contrib/vscode/readme.md, this may be relevant to
> help new users that want to use vscode debugger. And add some explanations
> like "How to use it".
>
> Except that, your patch sounds good for us.
>
> Thanks,
>
> Guillaume and Jonathan.
Previous: Jonathan BressatNext: Matthieu Moy
Message 6 of 24 in “contrib/vscode/: debugging with vscode and gdb”
  1. Jonathan BressatMar 24, 2022
  2. Derrick StoleeMar 25, 2022
  3. Matthieu MoyMar 25, 2022
  4. Derrick StoleeMar 25, 2022
  5. Jonathan BressatMar 26, 2022
  6. Guillaume CogoniApr 3, 2022
  7. Matthieu MoyApr 5, 2022
  8. 0/1 contrib/vscode/: debugging with VS Code and gdbCOGONI Guillaume, Apr 5, 2022
  9. 1/1 contrib/vscode/: debugging with VS Code and gdbCOGONI Guillaume, Apr 5, 2022
  10. Ævar Arnfjörð BjarmasonApr 6, 2022
  11. Matthieu MoyApr 6, 2022
  12. Matthieu MoyApr 6, 2022
  13. 0/1 contrib/vscode/: debugging with VS Code and gdbCOGONI Guillaume, Apr 6, 2022
  14. 1/1 contrib/vscode/: debugging with VS Code and gdbCOGONI Guillaume, Apr 6, 2022
  15. Derrick StoleeApr 6, 2022
  16. Junio C HamanoApr 6, 2022
  17. 0/1 contrib/vscode/: debugging with VS Code and gdbCOGONI Guillaume, Apr 6, 2022
  18. 1/1 contrib/vscode/: debugging with VS Code and gdbCOGONI Guillaume, Apr 6, 2022
  19. Ævar Arnfjörð BjarmasonApr 7, 2022
  20. Derrick StoleeApr 7, 2022
  21. Junio C HamanoApr 7, 2022
  22. 0/1 contrib/vscode/: debugging with VS Code and gdbCOGONI Guillaume, Apr 7, 2022
  23. 1/1 contrib/vscode/: debugging with VS Code and gdbCOGONI Guillaume, Apr 7, 2022
  24. Matthieu MoyApr 7, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.