{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Debug Kernel (x64)",
			"type": "cppdbg",
			"request": "launch",
			"program": "${workspaceFolder}/../Kernel/fennix.elf",
			"cwd": "${workspaceFolder}",
			"targetArchitecture": "x64",
			"MIMode": "gdb",
			"miDebuggerServerAddress": "/tmp/gdb-fennix",
			"miDebuggerPath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb",
			"externalConsole": false,
			"internalConsoleOptions": "neverOpen",
			"setupCommands": [
				{
					"text": "set breakpoint pending on",
					"description": "Make breakpoint pending on future shared library load."
				},
				{
					"text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest",
					"description": "Load /bin/utest",
					"ignoreFailures": true
				},
				{
					"text": "source ${workspaceFolder}/../tools/.gdbinit"
				}
			],
			"preLaunchTask": "launch-qemu"
		},
		{
			"name": "Debug Kernel (x86)",
			"type": "cppdbg",
			"request": "launch",
			"program": "${workspaceFolder}/../Kernel/fennix.elf",
			"cwd": "${workspaceFolder}",
			"targetArchitecture": "x86",
			"MIMode": "gdb",
			"miDebuggerServerAddress": "/tmp/gdb-fennix",
			"miDebuggerPath": "${workspaceFolder}/../tools/cross/bin/i386-fennix-gdb",
			"externalConsole": false,
			"internalConsoleOptions": "neverOpen",
			"setupCommands": [
				{
					"text": "set breakpoint pending on",
					"description": "Make breakpoint pending on future shared library load."
				},
				{
					"text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest",
					"description": "Load /bin/utest",
					"ignoreFailures": true
				},
				{
					"text": "source ${workspaceFolder}/../tools/.gdbinit"
				}
			],
			"preLaunchTask": "launch-qemu"
		},
		{
			"name": "Debug Kernel (arm64)",
			"type": "cppdbg",
			"request": "launch",
			"program": "${workspaceFolder}/../Kernel/fennix.elf",
			"cwd": "${workspaceFolder}",
			"targetArchitecture": "arm64",
			"MIMode": "gdb",
			"miDebuggerServerAddress": "/tmp/gdb-fennix",
			"miDebuggerPath": "${workspaceFolder}/../tools/cross/bin/aarch64-fennix-gdb",
			"externalConsole": false,
			"internalConsoleOptions": "neverOpen",
			"setupCommands": [
				{
					"text": "set breakpoint pending on",
					"description": "Make breakpoint pending on future shared library load."
				},
				{
					"text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest",
					"description": "Load /bin/utest",
					"ignoreFailures": true
				},
				{
					"text": "source ${workspaceFolder}/../tools/.gdbinit"
				}
			],
			"preLaunchTask": "launch-qemu"
		},
		{
			"name": "Debug Kernel (arm)",
			"type": "cppdbg",
			"request": "launch",
			"program": "${workspaceFolder}/../Kernel/fennix.elf",
			"cwd": "${workspaceFolder}",
			"targetArchitecture": "arm",
			"MIMode": "gdb",
			"miDebuggerServerAddress": "/tmp/gdb-fennix",
			"miDebuggerPath": "${workspaceFolder}/../tools/cross/bin/arm-fennix-gdb",
			"externalConsole": false,
			"internalConsoleOptions": "neverOpen",
			"setupCommands": [
				{
					"text": "set breakpoint pending on",
					"description": "Make breakpoint pending on future shared library load."
				},
				{
					"text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest",
					"description": "Load /bin/utest",
					"ignoreFailures": true
				},
				{
					"text": "source ${workspaceFolder}/../tools/.gdbinit"
				}
			],
			"preLaunchTask": "launch-qemu"
		},
		{
			"type": "gdb",
			"request": "attach",
			"name": "Launch QEMU & attach to gdbserver (x64)",
			"executable": "${workspaceFolder}/../Kernel/fennix.elf",
			"target": "/tmp/gdb-fennix",
			"remote": true,
			"cwd": "${workspaceRoot}",
			"valuesFormatting": "parseText",
			"gdbpath": "${workspaceFolder}/../tools/cross/bin/x86_64-fennix-gdb",
			"autorun": [
				"set auto-load safe-path ${workspaceFolder}",
				"source ${workspaceFolder}/../tools/.gdbinit",
			],
			"internalConsoleOptions": "neverOpen",
			"printCalls": false,
			"preLaunchTask": "launch-qemu"
		},
	]
}
