STRUCT KGDB_ARCH(9)
π struct kgdb_arch(9) β like, the Kernel API Manual, bestie β¨
okay so this is a page from the Kernel API Manual and it's literally the blueprint for struct kgdb_arch β the lil struct where each architecture gets to say "here's how my CPU does debugger stuff" π it's giving "describe architecture specific values" and honestly? iconic. no cap.
πΈ NAME πΈ
struct kgdb_arch β Describe architecture specific values. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
struct kgdb_arch {
unsigned char gdb_bpt_instr[BREAK_INSTR_SIZE];
unsigned long flags;
int (*set_breakpoint)(unsigned long, char *);
int (*remove_breakpoint)(unsigned long, char *);
int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype);
int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype);
void (*disable_hw_break)(struct pt_regs *regs);
void (*remove_all_hw_break)(void);
void (*correct_hw_break)(void);
};
not me putting the whole struct up there verbatim β yes I did, because you're gonna need every single field spelled exactly right π«Ά don't be editing these, this is the main character struct π
π¦ Members π¦
gdb_bpt_instrβ the actual instruction that triggers a breakpoint π₯ like the little "hey stop here" byte sequence, sizedBREAK_INSTR_SIZE.flagsβ flags for the breakpoint, and rn it's currently justKGDB_HW_BREAKPOINT. that's the whole cast, one flag, periodt πset_breakpointβ lets an architecture specify how to set a software breakpoint. your arch, your rules β¨remove_breakpointβ lets an architecture specify how to remove a software breakpoint. cleanup era π§Ήset_hw_breakpointβ lets an architecture specify how to set a hardware breakpoint. hardware girlies rise πremove_hw_breakpointβ lets an architecture specify how to remove a hardware breakpoint. bye bestie πdisable_hw_breakβ lets an architecture specify how to disable hardware breakpoints for a single cpu. one cpu only, very exclusive πremove_all_hw_breakβ lets an architecture specify how to remove all hardware breakpoints. ALL of them. scorched earth, no survivors π₯correct_hw_breakβ lets an architecture specify how to correct the hardware debug registers. yes she does maintenance too, multi-talented π
π SEE ALSO π
Kernel file ./include/linux/kgdb.h plus the whole friend group β go say hi:
kgdb_skipexception(9)kgdb_breakpoint(9)kgdb_arch_init(9)kgdb_arch_exit(9)pt_regs_to_gdb_regs(9)sleeping_thread_to_gdb_regs(9)gdb_regs_to_pt_regs(9)kgdb_arch_handle_exception(9)kgdb_arch_handle_qxfer_pkt(9)kgdb_call_nmi_hook(9)kgdb_roundup_cpus(9)kgdb_arch_set_pc(9)kgdb_arch_late(9)struct kgdb_io(9)
ngl if you're writing arch-specific kgdb code, read the actual header too β ./include/linux/kgdb.h is the source of truth and she ate π
k that's the page!! sourced from ./include/linux, dated October 2026, filed under struct kgdb_arch(9) β go forth and debug, bestie, you got this πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms