I use both GDB and DBX depending on the platform I'm debugging. I need to debug a tool where there are 20 command line parameters that need to be passed. GDB has an option where you can pass these parameters upon gdb startup:
gdb --args ...
I am looking for a similar way to do this in DBX. I'm hoping to save time rather than cutting and pasting all the time. I read parts of the manual, and I couldn't see a way to do this.
The three most common ways to start a debug session with the dbx program are: Running the dbx command on a specified object file. Using the -r flag to run the dbx command on a program that ends abnormally. Using the -a flag to run the dbx command on a process that is already in progress.
The dbx command provides a symbolic debug program for C, C++, and Fortran programs, allowing you to carry out the following operations: Examine object and core files. Provide a controlled environment for running a program. Set breakpoints at selected statements or run the program one line at a time.
The q and qq commands end the debugging session. (In CDB and KD, this command also exits the debugger itself.
To invoke dbx, type 'dbx' followed by the executable file name. For example, if the executable file name is 'a. out', you will type: % dbx a. out This will be followed by the following message (this may vary depending on version of dbx): dbx version 3.17 ...
you can execute runargs command on startup
dbx -c "runargs --all --your --flags" a.out
If you need to run app with name yourApp
using dbx for debugging. For example:
yourApp param1 param2
You can do it by using command run
from dbx
:
> dbx yourApp
Type 'help' for help.
reading symbolic information ...
(dbx) run param1 param2
//some output made by yourApp
(dbx)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With