Remote C/C++ Debugging with VSCode #2 - VSCode Makefile Tools

이미지
This article is a continuation of the previous blog( https://tipspiggy.blogspot.com/2022/05/remote-cc-debugging-with-vscode-1.html ).  Traditionally, Makefile is mainly used for Linux C/C++ development.(In fact, Makefile and make can be used not only in C/C++ but also in various development language projects.)  The usual purpose for Makefile in C++ projects is to recompile and link necessary files based on the modifications done to dependencies.   Compared to development tools such as Visual Studio on Windows, the extension sln and vcxproj files are used. When developing C/C++ using Visual Studio on Windows, most of us do not look at the contents of sln (Visual Solution File) and vcxproj (Visual Studio Project File) files. The reason is that if you select the properties of a solution or project in Visual Studio IDE, you can easily see the contents of the file in the property window. However, although the Linux system uses a desktop mode that supports a GUI, there are also many cases wh

Remote C/C++ Debugging with VSCode #1 - Installation and simple debugging

이미지
 Previously, I wrote an article about C++ debugging of remote Linux systems in VSCode , but it seems that it is time to change the contents after about 3 years have passed. VSCode has been greatly improved over the past time and the remote debugging feature has also become much easier to use. There is little difference from debugging on the local system. This explanation assumes that VSCode is installed on your computer. For reference, I used CentOS 7 installed on VMWare Workstation as a remote Linux server. There is probably no difference in usage even if you use a different distribution such as Ubuntu. Install extension for remote development Remote Development Extension First, install the extension for remote development in your VSCode. Search for "Remote Development" in VSCode and install "Remote Development" made by Microsoft. This extension installs Remote - SSH, Remote - Containers, Remote - WSL. Among them, Remote-SSH will be mainly used. <Remote Developm

Dynamically assigned TCP port scanning

이미지
 This time, we will create an echo server that can dynamically open a TCP port to check a connection. As with the previous UDP port detection, we will use epoll.  TCP works a little differently than UDP. In TCP, the client tries to connect to the bound socket. And the server socket creates a new socket through the accept function and then communicates with this socket. <tcp/ip socket  communication process> Multiple port tests To test ports in a specific band, all ports in the corresponding area should be opened and bind operation should be performed. If there is a port where the bind operation failed, take action after confirming that this port is already in use by another process. The TCP example is a little more complicated than the UDP example because it creates a new socket and communicates through the processes of listen and accept. #!/usr/bin/env python import socket import time import select import logging import argparse logger = logging . getLog