📄 cyggdb
字号:
GNU's gdb from Cygnus Support GNU's gdb from Cygnus SupportTo use the debug Monitor with GNU's gdb,connect the serial port that gdb will use, to the Monitor's tty0 (theconsole) on the target board. i.e., gdb only uses one serial port.set command to set yourMonitor's prompt to "PMON ". Gdb ishardwired to expect that string, and will not work with any other value(note the space after the "").--Compile and link your modules with the -g option. This will generatethe extra information that is required by gdb. For example, pmcc -g -o bubble bubble.cInvoke gdb. % mips-lsi-elf-gdb -b 9600 bubblewhere 'bubble' is the name of the object file that you are debugging.The option "-b 9600" specifies that 9600 baud will be used for theHost-to-Target communications.By default gdb from Cygnus Support runs in a windowed mode. However, itthe time of writing, the windowed mode was incomplete/buggy, so you mightprefer to run it in non-windowed mode. To select non-windowed mode, addthe option -nw to the command line. % mips-lsi-elf-gdb -nw -b 9600 bubblegdb normally expects your monitor to have a prompt of "PMON " (notethe space). If your monitor uses a different type of prompt you caneither change it in the Monitor using the setcommand or tell gdb what prompt to expect. For example, (gdb) set monitor-prompt IMON Note that this command does not expect quotes around the prompt,but gdb will take the entire string including trailing spaces. So be carefulto type the string exactly.Next you must specify the target type, and serial portthat will be used to communicated with the target. For example, (gdb) target lsi /dev/ttybthis specifies that the target is running LSI Logic's PMON (or IMON),and that the target is connected to /dev/ttyb on the host. If you areusing MSDOS you will need to specify one ofthe COM ports. eg. com1.To download your program to the Target issue the "load" command. Noarguments are necessary as gdb has all the other information it needs. (gdb) loadIf you simply want to run your program, you can just type "run". But ifas is more likely you want to be able to set breakpoints and single-stepyour program, you should type, (gdb) b main (gdb) runthis will set a breakpoint at "main" and execute the program until itreaches that point.The following table is a summary of the most frequently used commands:Brief Command SummarygdbPMON/IMON equivalentDescriptionsteptSingle StepnexttoStep Overb addrb addrSet Breakpointdeletedb *DeleteccContinuerungStart ExecutionWhen debugging the Host-to-Target communications it is sometimes usefulto create of log of all the transactions. The following command writesa log to the file "remote.log". (gdb) set remotelogfile remote.log
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -