In gdb, if I just hit return, it repeats the last command. Is there a way to configure Sun/Oracle/Solaris dbx to do likewise?
Asked
Active
Viewed 612 times
4
-
Was this a question about Solaris/Sun/Oracle version of dbx, of the SGI version of dbx? I think there is a way to do this with the Solaris Studio dbx, but I don't have the answer handy right now. You should be able to find the reference manual using a google search. – Chris Quenelle Jun 03 '12 at 16:16
2 Answers
2
Looks like you can use the $repeatmode for this. I got the following from the dbx-guide
Repeating Commands
You can execute any of the commands contained in the history list. Each
history command begins with an exclamation point (!):
!! Repeats the previous command. If the value of the dbx
variable $repeatmode is set to 1, then entering a carriage
return at an empty line is equivalent to executing !!. By
default, $repeatmode is set to 0.
There also seems to be another option 'gdb on' which makes dbx behave like gdb. I haven't tried either as I don't have access to dbx right now, so you can let me know if this works for you.

Raam
- 10,296
- 3
- 26
- 27
2
You can get that behavior by enabling "gdb mode" in dbx.
(dbx) gdb on
(dbx) step
stopped in main at line 4 in file "t.c"
4 printf("world");
(dbx)
step
stopped in main at line 5 in file "t.c"
5 printf("!");
(dbx)
step
stopped in main at line 6 in file "t.c"
6 printf("\n");
(dbx)
step
helloworld!
stopped in main at line 7 in file "t.c"
7 }
Here is the help for gdb mode from the latest dbx.
(dbx) help gdb gdb (command) gdb on | off Use `gdb on' to enter the gdb command mode under which dbx will understand and accept gdb commands. To exit the gdb command mode and return to the dbx command mode, enter "gdb off". Please note that the dbx commands will not be accepted while in gdb command mode and vice versa. All debugging settings such as breakpoints are preserved across different command modes. The following gdb commands are not supported in the current release: - commands - define - handle - hbreak - interrupt - maintenance - printf - rbreak - return - signal - tcatch - until

Chris Quenelle
- 801
- 4
- 16