Skip to content

Instantly share code, notes, and snippets.

View weliveindetail's full-sized avatar
🌍
🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲

Stefan Gränitz weliveindetail

🌍
🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲 🚲
View GitHub Profile
@weliveindetail
weliveindetail / windbg-symbol-synth-001.md
Created September 27, 2023 15:00
WinDbg SymBuilder demo

Minimal example:

> cat app.c
extern char lafc(int argc, char *argv[]);
int main(int argc, char *argv[]) {
  return lafc(argc, argv);
}
> cat lafc.c
char lafc(int argc, char *argv[]) {
  char ec = argv[argc - 1][0];
From fa1d9a34232137d7a6db6a01735a9d4bf690d4a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= <stefan.graenitz@gmail.com>
Date: Thu, 16 Mar 2023 14:42:45 +0100
Subject: [PATCH] [CMake] Prevent uncachable calls with ccache on Windows
---
llvm/CMakeLists.txt | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
@weliveindetail
weliveindetail / launch.json
Last active January 10, 2024 12:52
Cross-compile and remote debug clang-repl on Raspberry Pi 2-4 (32-bit Raspbian armv7)
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "custom",
"name": "[raspi4b] Attach clang-repl",
"initCommands": [
"platform select remote-linux",
"platform connect connect://192.168.1.104:9001",
@weliveindetail
weliveindetail / R_ARM_GOT_PREL.md
Last active January 10, 2024 12:30
AArch32 relocation notes

Run test arm-fpic-got.s (simplified ouput):

$ bin/llvm-lit --filter=arm-fpic-got -a tools/lld/test
...
RUN: at line 2: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi arm-fpic-got.s -o arm-fpic-got.s.tmp.o
RUN: at line 3: ld.lld arm-fpic-got.s.tmp.o -o arm-fpic-got.s.tmp
...

Input object:

@weliveindetail
weliveindetail / lldb-precache
Created January 20, 2024 13:01
Pre-populate LLDB module cache with existing binaries
#!/bin/bash
set -e
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <executable> [remote-linux]"
exit 1
fi
executable_path="$1"
echo "Pre-caching executable: $executable_path"