Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dbx debugger able to pass command line parameters on dbx startup?

Tags:

debugging

dbx

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.

like image 817
Jenner Avatar asked Jan 14 '13 21:01

Jenner


People also ask

How to use dbx debugger?

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.

What is dbx command?

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.

What command do you use to quit the debugging environment?

The q and qq commands end the debugging session. (In CDB and KD, this command also exits the debugger itself.

How do I run dbx?

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


2 Answers

you can execute runargs command on startup

dbx -c "runargs --all --your --flags" a.out
like image 92
horsh Avatar answered Oct 12 '22 11:10

horsh


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)
like image 30
yaroslavpalamar Avatar answered Oct 12 '22 10:10

yaroslavpalamar