Embed gdb pretty-printing script directly into Kakoune binary

This will get stripped correctly, and should make debugging easier.
main
Maxime Coste 2019-01-23 20:27:16 +11:00
parent 1b469f4c00
commit ebc9f7703b
2 changed files with 12 additions and 9 deletions

View File

@ -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

View File

@ -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
)");