Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vscode debug #297

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Vscode debug #297

wants to merge 3 commits into from

Conversation

elliotthenne
Copy link
Contributor

added relevant files needed to use the VSCode debugger while running the speed tester nf

"version": "0.2.0",
"configurations": [
{
"name": "gcc-9 - Build and debug speed tester",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix this name since this doesn't actually build the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to gcc-9 - Debug speed tester

.vscode/launch.json Outdated Show resolved Hide resolved
@@ -0,0 +1,27 @@
{
"tasks": [
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We either need to fix this so it works and can compile the code or delete it

Copy link
Contributor Author

@elliotthenne elliotthenne Jul 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean. Are you referring to the entire file or those 3 lines?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean this tasks section. You can just delete it

@@ -0,0 +1 @@
pkexec /usr/bin/gdb "$@"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a header comment explaining what this file is for

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I entirely understand the purpose of this file. I think it allows administrator privileges for gdb, which is why the pkexec command is used, but I don't think I can succinctly summarize it in a comment

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a suggestion:

Suggested change
pkexec /usr/bin/gdb "$@"
# This is a wrapper script for GDB that allows it to run as root. This is necessary if you are calling
# gdb from an IDE like VS Code that by itself does not run as root.
# NOTE: In some cases we have found that you must use `sudo` instead of `pkexec` here.
pkexec /usr/bin/gdb "$@"

We will need to test this on a few different setups to understand whether to use sudo or pkexec. My memory is that when we tried to use this on Noah's machine it only worked with sudo, but on yours you needed pkexec. We will want to set this to whichever is needed on CloudLab since it is our "standard" platform.

Copy link
Member

@twood02 twood02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions

@@ -0,0 +1,27 @@
{
"tasks": [
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean this tasks section. You can just delete it

@@ -0,0 +1 @@
pkexec /usr/bin/gdb "$@"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a suggestion:

Suggested change
pkexec /usr/bin/gdb "$@"
# This is a wrapper script for GDB that allows it to run as root. This is necessary if you are calling
# gdb from an IDE like VS Code that by itself does not run as root.
# NOTE: In some cases we have found that you must use `sudo` instead of `pkexec` here.
pkexec /usr/bin/gdb "$@"

We will need to test this on a few different setups to understand whether to use sudo or pkexec. My memory is that when we tried to use this on Noah's machine it only worked with sudo, but on yours you needed pkexec. We will want to set this to whichever is needed on CloudLab since it is our "standard" platform.

@twood02
Copy link
Member

twood02 commented Jul 26, 2021

@NoahChinitz
Copy link
Contributor

When I used your gdb.sh file I needed to change it to be sudo /usr/bin/gdb "$@" instead of pkexec /usr/bin/gdb "$@".

@twood02 twood02 added this to the ONVM 21 Summer Release milestone Aug 23, 2021
@twood02 twood02 added the CI/Testing 🤖 Continuous Integration and Testing related label Aug 24, 2021
@twood02 twood02 changed the base branch from master to develop August 26, 2021 15:59
@twood02 twood02 removed this from the ONVM 21 Summer Release milestone Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/Testing 🤖 Continuous Integration and Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants