diff --git a/src/.gdbinit b/src/.gdbinit index 9f8da0bf..0feb1444 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -1,11 +1,2 @@ set print pretty break Kakoune::on_assert_failed - -python -sys.path.insert(0, '../gdb/') -import gdb.printing -import kakoune -gdb.printing.register_pretty_printer( - gdb.current_objfile(), - kakoune.build_pretty_printer()) -end diff --git a/src/main.cc b/src/main.cc index 3a1d23fe..cebc78f5 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1139,3 +1139,15 @@ int main(int argc, char* argv[]) } return 0; } + +asm(R"( +.pushsection ".debug_gdb_scripts", "MS",@progbits,1 +.byte 4 +.ascii "kakoune-inline-gdb.py\n" +.ascii "import os.path\n" +.ascii "sys.path.insert(0, os.path.dirname(gdb.current_objfile().filename) + '/../share/kak/gdb/')\n" +.ascii "import gdb.printing\n" +.ascii "import kakoune\n" +.ascii "gdb.printing.register_pretty_printer(gdb.current_objfile(), kakoune.build_pretty_printer())\n" +.popsection +)");