You can run gdb with –args parameter,
gdb --args executablename arg1 arg2 arg3
If you want it to run automatically, place some commands in a file (e.g. ‘run’) and give it as argument: -x /tmp/cmds. Optionally you can run with -batch mode.
gdb -batch -x /tmp/cmds --args executablename arg1 arg2 arg3
Related Posts:
- gdb can’t access memory address error
- What does int argc, char *argv[] mean?
- How to handle command-line arguments in PowerShell
- Argument list too long error for rm, cp, mv commands
- No Symbol Table using GDB on Compiled Programs
- How to prompt for user input and read command-line arguments
- Program received signal SIGPIPE, Broken pipe
- Parsing boolean values with argparse
- mkdir’s “-p” option
- How do I remove a single breakpoint with GDB?
- How to print register values in GDB?
- Installing cgdb on a mac os x
- What is “String args[]”? parameter in main method Java
- gdb: “No symbol table is loaded”
- Display value found at given address gdb
- How to use gdb with pipes and stdin
- How to disassemble a memory range with GDB?
- binary bomb lab phase 6
- gdb fails with “Unable to find Mach task port for process-id” error
- Check number of arguments passed to a Bash script
- How do I parse command line arguments in Java?
- gdb error not in executable format: File format not recognized
- Run a string as a command within a Bash script
- What’s the difference between nexti and stepi in gdb?
- Core dump file analysis
- Unknown ending signal when using debugger gdb
- Step out of current function with GDB
- How can one see content of stack with GDB?
- Is there an “until” command in gdb?
- How to print in binary mode in gdb?
- What is Robocopy’s “restartable” option?
- gcc -g :what will happen
- gdb debugging in Terminal OS X (10.8.5) with zsh
- no debugging symbols found when using gdb
- Passing additional variables from command line to make
- gdb split view with code
- gdb: No symbol “i” in current context
- C – Error is “free(): invalid next size (normal) “
- “please check gdb is codesigned – see taskgated(8)” – How to get gdb installed with homebrew code signed?
- GDB no such file or directory
- Parsing command-line arguments in C
- What is the jmpq command doing in this example
- [Binary Bomb – Phase 4