0

When I want to run python into gdb I using

source /tmp/gdb/tmp/parser.py

  1. Can I set an alias so in the next time I want to call this script I use only parser.py or parser (without setting the script into working directory
  2. How can I pass args to script ? source /tmp/gdb/tmp/parser.py <args1> doesn't work
MicrosoctCprog
  • 460
  • 1
  • 3
  • 23
  • Instead of sourcing the script multiple times, you could create a function in the script, source it one time, and call the function as many times as you want (with arguments). – ssbssa Jan 22 '21 at 16:18

1 Answers1

0

These should have been asked as two separate questions, really. But:

  1. Execute command dir /tmp/gdb/tmp/, after that you should be able to run script as source parser.py
  2. You can't when you are sourcing a script. Rewrite script so that it attaches itself as GDB command via class inheriting from gdb.Command. The command can accept arguments. And you will save on typing source ... too.