STRUCT KGDB_ARCH(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, sized BREAK_INSTR_SIZE.
  • flags β€” flags for the breakpoint, and rn it's currently just KGDB_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:


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