Есть программа, и мне её в произвольном месте (не брекпоинтом, а вручную нажатием комбинации с клавиатуры) надо приостановить и узнать на каком месте программа стала. Можно так сделать или нет?
Кирилл Жиляев, продолжить -- c. Ответы на все остальные такие же вопросы -- apropos <действие> (когда надо поискать возможные ассоциации для действия, или help <ключевое слово>, для известных gdb ключевых слов, например:
(gdb) apropos running
attach -- Attach to a process or file outside of GDB
info proc -- Show /proc process information about any running process
interrupt -- Interrupt the execution of the debugged program
load -- Dynamically load FILE into the running program
running -- Running the program
set annotate -- Set annotation_level
set charset -- Set the host and target character sets
set exec-wrapper -- Set a wrapper for running programs
set follow-exec-mode -- Set debugger response to a program call of exec
set host-charset -- Set the host character set
show annotate -- Show annotation_level
show charset -- Show the host and target character sets
show exec-wrapper -- Show the wrapper for running programs
show follow-exec-mode -- Show debugger response to a program call of exec
show host-charset -- Show the host character set
или
(gdb) help running
Running the program.
List of commands:
advance -- Continue the program up to the given location (same form as args for break command)
attach -- Attach to a process or file outside of GDB
continue -- Continue program being debugged
detach -- Detach a process or file previously attached
detach checkpoint -- Detach from a checkpoint (experimental)
detach inferiors -- Detach from inferior ID (or list of IDS)
disconnect -- Disconnect from a target
finish -- Execute until selected stack frame returns
handle -- Specify how to handle signals
inferior -- Use this command to switch between inferiors
interrupt -- Interrupt the execution of the debugged program
jump -- Continue program being debugged at specified line or address
kill -- Kill execution of program being debugged
kill inferiors -- Kill inferior ID (or list of IDs)
next -- Step program
nexti -- Step one instruction
queue-signal -- Queue a signal to be delivered to the current thread when it is resumed
reverse-continue -- Continue program being debugged but run it in reverse
reverse-finish -- Execute backward until just before selected stack frame is called
reverse-next -- Step program backward
reverse-nexti -- Step backward one instruction
reverse-step -- Step program backward until it reaches the beginning of another source line
reverse-stepi -- Step backward exactly one instruction
run -- Start debugged program
signal -- Continue program with the specified signal
start -- Run the debugged program until the beginning of the main procedure
step -- Step program until it reaches a different source line
stepi -- Step one instruction exactly
target -- Connect to a target machine or process
target core -- Use a core file as a target
target ctf -- Use a CTF directory as a target
target exec -- Use an executable file as a target
target extended-remote -- Use a remote computer via a serial line
target native -- Native process (started by the "run" command)
target record-btrace -- Collect control-flow trace and provide the execution history
target record-core -- Log program while executing and replay execution from log
target record-full -- Log program while executing and replay execution from log
target remote -- Use a remote computer via a serial line
target tfile -- Use a trace file as a target
task -- Use this command to switch between Ada tasks
thread -- Use this command to switch between threads
thread apply -- Apply a command to a list of threads
thread apply all -- Apply a command to all threads
thread find -- Find threads that match a regular expression
thread name -- Set the current thread's name
until -- Execute until the program reaches a source line greater than the current