Skip to content

Instantly share code, notes, and snippets.

View kienvo's full-sized avatar
😀
Caffeinized

Dien-Nhung Nguyen kienvo

😀
Caffeinized
View GitHub Profile
@kienvo
kienvo / foo.md
Last active March 30, 2022 05:41
Objective in C with MACRO
struct some_struct {int some; char value;};

#define SOME_STRUCT_INIT(name) 			\
	struct some_struct *name = malloc(sizeof(struct some_struct));\
	*name = (struct __##name){.some = 5, .value = 'a'}; // compound literal
@kienvo
kienvo / launch.json
Created March 30, 2022 00:17
vscode gdb local debugging
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"preLaunchTask": "${defaultBuildTask}",
@kienvo
kienvo / c_cpp_properties.json
Created November 16, 2021 19:06
IntelliSense configuration for kernel headers
{
"configurations": [
{
"name": "Linux",
"includePath": [
// https://github.com/microsoft/vscode-cpptools/issues/5588#issuecomment-662116156
"${workspaceFolder}/**",
"/usr/src/linux-headers-5.4.0-81-generic/arch/x86/include",
"/usr/src/linux-headers-5.4.0-81-generic/arch/x86/include/generated",
"/usr/src/linux-headers-5.4.0-81-generic/include",
@kienvo
kienvo / launch.json
Last active November 4, 2021 07:34
vscode remote debugging
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "GDB debug",
"type": "cppdbg",
"request": "launch",