亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Table of Contents
Preface" >Preface
vscode plug-in installation" >vscode plug-in installation
remote-ssh" >remote-ssh
Error: Setting up SSH Host XX:Copying VS Code Server to host with scp" >Error: Setting up SSH Host XX:Copying VS Code Server to host with scp
reason" >reason
Solution" >Solution
報(bào)錯(cuò):Permissions for ‘vscode_rsa’ are too open." >報(bào)錯(cuò):Permissions for ‘vscode_rsa’ are too open.
C/C++" >C/C++
Home System Tutorial LINUX Use vscode to remotely debug the Linux kernel

Use vscode to remotely debug the Linux kernel

Feb 05, 2024 pm 12:30 PM
linux linux tutorial linux system Tencent Cloud linux command shell script good promise Getting started with linux linux learning

Preface

The previous article introduced the use of QEMU GDB to debug the Linux kernel. However, sometimes it is not very convenient to directly use GDB to debug and view the code. Therefore, on such an important occasion, how can the artifact of vscode be missing? This article introduces how to use vscode to remotely debug the kernel.

Environment of this article:

  • windows10
  • vscode
  • ubuntu 20.04

I personally use Tencent Cloud Server, so I save the process of installing a virtual machine. Start directly from vscode configuration.

vscode plug-in installation

remote-ssh

Find the Remote-SSH plug-in in the plug-in library and install it.

Use vscode to remotely debug the Linux kernel

After the installation is complete, there will be an additional function on the right toolbar

Use vscode to remotely debug the Linux kernel

Press F1 to call out the dialog box, enter remote-ssh, and select open ssh configuration file.

Use vscode to remotely debug the Linux kernel

Select the first configuration file

Use vscode to remotely debug the Linux kernel
#?Read?more?about?SSH?config?files:?https://linux.die.net/man/5/ssh_config
Host?ubuntu
????HostName?服務(wù)器IP地址
????User?用戶名
????IdentityFile?私鑰路徑

I am using the private key method to log in to the server, and IdentityFile fills in the absolute path of the private key.

After configuration, click the plus button to log in to the server

Use vscode to remotely debug the Linux kernel

Error: Setting up SSH Host XX:Copying VS Code Server to host with scp

I got stuck while connecting and have been waiting for Setting up SSH Host XX:Copying VS Code Server to host with scp.

reason

It’s because the home directory ~/.vscode-server/bin/commit_id/vscode-servlet.tar.gz is not downloaded under the remote server.

commit_id can be viewed in vscode [Help]->[Terminal].

Solution

Then we will download vscode-servlet.tar.gz manually. Download via the link below.

#注意把:${commit_id}替換成對(duì)應(yīng)的Commit?ID
https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable

Run the following line of command. Delete everything in the ~/.vscode-server/bin directory.

rm?~/.vscode-server/bin/*?-rf

If there is no ~/.vscode-server/bin directory, create it. If there is, please ignore this step*.

mkdir?-p?~/.vscode-server/bin

Place the downloaded compressed package vscode-server-linux-x64.tar.gz in the ~/.vscode-server/bin directory.

Run the following three lines of commands, where ${commit_id} needs to be replaced with the commit_id recorded in step 2.

cd?~/.vscode-server/bin
tar?-zxf?vscode-server-linux-x64.tar.gz
mv?vscode-server-linux-x64?${commit_id}

報(bào)錯(cuò):Permissions for ‘vscode_rsa’ are too open.

然后就可以在原來(lái)的文件瀏覽界面,打開(kāi)遠(yuǎn)程的文件夾。但是在配置好進(jìn)行連接的時(shí)候,VScode的終端報(bào)錯(cuò)了:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@?????WARNING:?UNPROTECTED?PRIVATE?KEY?FILE!?????@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions?for?'vscode_rsa'?are?too?open.
It?is?required?that?your?private?key?files?are?NOT?accessible?by?others.
This?private?key?will?be?ignored.
Load?key?"vscode_rsa":?bad?permissions

根本原因是私鑰的權(quán)限問(wèn)題。這要是在Linux里,直接使用chmod,就可以修改,修改為644即可,但是windows,就稍微麻煩點(diǎn)。

在私鑰上右擊選擇屬性,然后選擇【安全】選項(xiàng)卡,然后點(diǎn)擊下面的【高級(jí)】按鈕,然后在新彈出的窗口下方點(diǎn)擊【禁用繼承】,然后點(diǎn)擊繼承那個(gè)按鈕上面的【添加】按鈕重新將當(dāng)前window登錄用戶設(shè)置為私鑰的所有者,并勾選所有權(quán)限。最后跟下面一樣即可:

Use vscode to remotely debug the Linux kernel

這時(shí)再次打開(kāi)VScode遠(yuǎn)程連接,就沒(méi)有問(wèn)題了。

C/C++

安裝C/C++插件

Use vscode to remotely debug the Linux kernel

依次點(diǎn)擊【運(yùn)行】->【打開(kāi)配置】,將以下配置復(fù)制到launch.json中。

{
????"version":?"0.2.0",
????"configurations":?[
????????{
????????????"name":?"kernel-debug",
????????????"type":?"cppdbg",
????????????"request":?"launch",
????????????"miDebuggerServerAddress":?"127.0.0.1:1234",
????????????"program":?"${workspaceFolder}/vmlinux",
????????????"args":?[],
????????????"stopAtEntry":?false,
????????????"cwd":?"${workspaceFolder}",
????????????"environment":?[],
????????????"externalConsole":?false,
????????????"logging":?{
????????????????"engineLogging":?false
????????????},
????????????"MIMode":?"gdb",
????????}
????]
}

然后在main函數(shù)中,打上兩個(gè)斷點(diǎn),在服務(wù)器上開(kāi)啟QEMU,F(xiàn)5即可開(kāi)啟調(diào)試。

Use vscode to remotely debug the Linux kernel

在vscode中調(diào)試內(nèi)核,和正常的在windows調(diào)試代碼是一樣的,側(cè)邊欄可以看到變量,監(jiān)視變量,調(diào)用堆棧等,非常方便。

Use vscode to remotely debug the Linux kernel

大功告成,以后就可以在可視化界面調(diào)試內(nèi)核了!

Use vscode to remotely debug the Linux kernel

The above is the detailed content of Use vscode to remotely debug the Linux kernel. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1488
72
How to choose a Linux distro for a beginner? How to choose a Linux distro for a beginner? Jun 19, 2025 am 12:09 AM

Newbie users should first clarify their usage requirements when choosing a Linux distribution. 1. Choose Ubuntu or LinuxMint for daily use; programming and development are suitable for Manjaro or Fedora; use Lubuntu and other lightweight systems for old devices; recommend CentOSStream or Debian to learn the underlying principles. 2. Stability is preferred for UbuntuLTS or Debian; you can choose Arch or Manjaro to pursue new features. 3. In terms of community support, Ubuntu and LinuxMint are rich in resources, and Arch documents are technically oriented. 4. In terms of installation difficulty, Ubuntu and LinuxMint are relatively simple, and Arch is suitable for those with basic needs. It is recommended to try it first and then decide.

How to add a new disk to Linux How to add a new disk to Linux Jun 27, 2025 am 12:15 AM

The steps to add a new hard disk to the Linux system are as follows: 1. Confirm that the hard disk is recognized and use lsblk or fdisk-l to check; 2. Use fdisk or parted partitions, such as fdisk/dev/sdb and create and save; 3. Format the partition to a file system, such as mkfs.ext4/dev/sdb1; 4. Use the mount command for temporary mounts, such as mount/dev/sdb1/mnt/data; 5. Modify /etc/fstab to achieve automatic mount on the computer, and test the mount first to ensure correctness. Be sure to confirm data security before operation to avoid hardware connection problems.

Where are system logs located in Linux? Where are system logs located in Linux? Jun 24, 2025 am 12:15 AM

Logs in Linux systems are usually stored in the /var/log directory, which contains a variety of key log files, such as syslog or messages (record system logs), auth.log (record authentication events), kern.log (record kernel messages), dpkg.log or yum.log (record package operations), boot.log (record startup information); log content can be viewed through cat, tail-f or journalctl commands; application logs are often located in subdirectories under /var/log, such as Apache's apache2 or httpd directory, MySQL log files, etc.; at the same time, it is necessary to note that log permissions usually require s

Fixed the failure to upload files in Windows Google Chrome Fixed the failure to upload files in Windows Google Chrome Jul 08, 2025 pm 02:33 PM

Have problems uploading files in Google Chrome? This may be annoying, right? Whether you are attaching documents to emails, sharing images on social media, or submitting important files for work or school, a smooth file upload process is crucial. So, it can be frustrating if your file uploads continue to fail in Chrome on Windows PC. If you're not ready to give up your favorite browser, here are some tips for fixes that can't upload files on Windows Google Chrome 1. Start with Universal Repair Before we learn about any advanced troubleshooting tips, it's best to try some of the basic solutions mentioned below. Troubleshooting Internet connection issues: Internet connection

What is the sudo command and when should I use it? What is the sudo command and when should I use it? Jul 02, 2025 am 12:20 AM

sudo stands for "substituteuserdo" or "superuserdo", allowing users to run commands with permissions of other users (usually root). Its core uses include: 1. Perform system-level operations such as installing software or editing system files; 2. Accessing protected directories or logs; 3. Manage services such as restarting nginx; 4. Modify global settings such as /etc/hosts. When using it, the system will check the /etc/sudoers configuration and verify the user password, provide temporary permissions instead of continuously logging in as root, ensuring security. Best practices include: only when necessary, avoid blindly executing network commands, editing sudoers files with visudo, and considering continuous operations.

How to manage groups on Linux How to manage groups on Linux Jul 06, 2025 am 12:02 AM

To manage Linux user groups, you need to master the operation of viewing, creating, deleting, modifying, and user attribute adjustment. To view user group information, you can use cat/etc/group or getentgroup, use groups [username] or id [username] to view the group to which the user belongs; use groupadd to create a group, and use groupdel to specify the GID; use groupdel to delete empty groups; use usermod-aG to add users to the group, and use usermod-g to modify the main group; use usermod-g to remove users from the group by editing /etc/group or using the vigr command; use groupmod-n (change name) or groupmod-g (change GID) to modify group properties, and remember to update the permissions of relevant files.

How to find my private and public IP address in Linux? How to find my private and public IP address in Linux? Jul 09, 2025 am 12:37 AM

In Linux systems, 1. Use ipa or hostname-I command to view private IP; 2. Use curlifconfig.me or curlipinfo.io/ip to obtain public IP; 3. The desktop version can view private IP through system settings, and the browser can access specific websites to view public IP; 4. Common commands can be set as aliases for quick call. These methods are simple and practical, suitable for IP viewing needs in different scenarios.

PHP integrated AI intelligent picture recognition PHP visual content automatic labeling PHP integrated AI intelligent picture recognition PHP visual content automatic labeling Jul 25, 2025 pm 05:42 PM

The core idea of integrating AI visual understanding capabilities into PHP applications is to use the third-party AI visual service API, which is responsible for uploading images, sending requests, receiving and parsing JSON results, and storing tags into the database; 2. Automatic image tagging can significantly improve efficiency, enhance content searchability, optimize management and recommendation, and change visual content from "dead data" to "live data"; 3. Selecting AI services requires comprehensive judgments based on functional matching, accuracy, cost, ease of use, regional delay and data compliance, and it is recommended to start from general services such as Google CloudVision; 4. Common challenges include network timeout, key security, error processing, image format limitation, cost control, asynchronous processing requirements and AI recognition accuracy issues.

See all articles