有没有办法配置dbx将空命令视为最后一个命令的重复?

时间:2012-05-24 16:56:50

标签: configuration gdb solaris repeat dbx

在gdb中,如果我只是点击返回,它会重复上一个命令。有没有办法配置Sun / Oracle / Solaris dbx来做同样的事情?

2 个答案:

答案 0 :(得分:2)

看起来你可以使用$ repeatmode。 我从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.

似乎还有另一个选项'gdb on',这使得dbx的行为与gdb相似。我没有尝试过,因为我现在无法访问dbx,所以如果这对你有用,你可以告诉我。

答案 1 :(得分:2)

您可以通过启用" gdb模式"来获得该行为。在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   }

以下是来自最新dbx的gdb模式的帮助。

(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