Files
yelvens d2f748f1bd *: add support for linux/loong64 to native backend (#3892)
* delve: support linux-loong64 native debug

LoongArch is a new RISC ISA, which is independently designed by Loongson Technology.

LoongArch includes a reduced 32-bit version (LA32R), a standard 32-bit version (LA32S)
and a 64-bit version (LA64), and loong64 is the 64-bit version of LoongArch.

LoongArch documentation: https://github.com/loongson/LoongArch-Documentation.git

* *: mark loong64 port as experimental

---------

Co-authored-by: Huang Qiqi <huangqiqi@loongson.cn>
2025-01-17 09:41:37 -08:00

47 lines
971 B
C

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef __amd64__
#define BREAKPOINT asm("int3;")
#elif __i386__
#define BREAKPOINT asm("int3;")
#elif __aarch64__
#ifdef WIN32
#define BREAKPOINT asm("brk 0xF000;")
#else
#define BREAKPOINT asm("brk 0;")
#endif
#elif __riscv
#define BREAKPOINT asm("ebreak;")
#elif __loongarch__
#define BREAKPOINT asm("break 0;")
#endif
#define N 100
struct align_check {
int a;
char b;
};
void testfn(void) {
const char *s0 = "a string";
const char *longstring = "averylongstring0123456789a0123456789b0123456789c0123456789d0123456789e0123456789f0123456789g0123456789h0123456789";
int *v = malloc(sizeof(int) * N);
struct align_check *v_align_check = malloc(sizeof(struct align_check) * N);
for (int i = 0; i < N; i++) {
v[i] = i;
v_align_check[i].a = i;
v_align_check[i].b = i;
}
char *s = malloc(strlen(s0) + 1);
strcpy(s, s0);
BREAKPOINT;
printf("%s %s %p %p\n", s, longstring, v, v_align_check);
}