GP2C-DBG(1)

πŸ’– GP2C-DBG πŸ’–

okay so bestie, welcome to the GP to C debugger driver β€” that's the whole name, and it lives in the PARI manual page family, section 1, iykyk. this is the lil tool that lets you poke at your GP scripts with a real actual C debugger. no cap. πŸ¦‹


✨ NAME ✨

gp2c-dbg β€” the GP to C debugger driver πŸ’…


🌸 DESCRIPTION 🌸

so here's the two whole vibes of this thing:

gp2c-dbg [gp2c options] [file.gp]

it compiles file.gp with gp2c, then throws open a debugger session of gp where all the functions from file.gp are already loaded in. the [gp2c options] get passed straight on through to gp2c. simple as that. ✨

gp2c-dbg file.c

this one compiles file.c and opens a debugger session of gp with the functions of file.c loaded up. but heads up β€” file.c must have suitable GP;install() lines, or this whole situation is not giving what it needs to give. πŸ™ˆ


πŸŽ€ USAGE πŸŽ€

the way that there is literally no debugger for the GP language 😭 so gp2c-dbg is the workaround β€” it lets you debug your GP scripts using the C debugger instead. iconic problem-solving honestly.

and listen: to catch PARI errors, you can set a break point on the function "pari_err". do it. it's the move. πŸ”₯

⚠️ one big note bestie: your functions will not be loaded until gp has read the .run file. so don't come at it confused when nothing's there yet. patience, queen. πŸ‘‘

πŸ¦‹ FILES πŸ¦‹

  • file.gp.c β€” the C output that gp2c produces. the whole point. πŸ’–
  • file.gp.so β€” the GP loadable module.
  • file.gp.run β€” the commands that load the module. once a module is compiled, you can load it inside a gp session just by running this script. so handy fr fr. ✨

🌈 ENVIRONMENT 🌈

  • GP2C β€” path to the gp2c compiler. default: /usr/bin/gp2c
  • GP_DBG β€” path to the gp calculator. default: /usr/bin/gp
  • GP2C_DBG β€” command to start the debugger. default: "gdb --args"

πŸ‘‘ COPYING πŸ‘‘

Copyright 2000-2018 The PARI Group πŸ’œ

GP2C is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. and ngl there is absolutely no warranty for GP2C. none. zero. nada. 😭


πŸ“ SEE ALSO πŸ“

The GP2C manual, gp2c-run(1), gp2c(1), gp(1), gdb(1) β€” go read them, they're all in the same friend group 🫢


okay that's the whole page, bestie!! this was the GP to C compiler driver situation, and this version is dated November 2001 🌸 slay, go debug something iconic, periodt. πŸ’…βœ¨