In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
In this article, let's take a look at the common commands in gdb. There is a certain reference value, friends in need can refer to, hope to help you.
The gdb command is included in GNU's gcc development kit and is a powerful program debugger.
There are many commands in gdb, but we only need to master about ten of them to roughly complete the daily basic program debugging work.
Syntax format: gdb [parameters] [file]
Common parameters:
-cd sets working directory-Q quiet mode, does not print introduction information and version information-d adds file lookup path-x executes GDB instruction from specified file-s setting reads symbol table file
Common commands:
File load the executable program file being debugged run restart to run the file start step execution, run the program, stop at the first execution statement list to view the original code, abbreviate lset to set the value of the variable next step debugging (step by step Function execution directly), nstep step debugging (sentence by sentence: jump into the custom function), sbacktrace to view the stack frame and hierarchical relationship of function calls, btframe to switch the stack frame of the function, finfo to view the value of local variables inside the function, ifinish to end the current function, return to function call point continue to continue running, abbreviated cprint print value and address, pquit exit gdb, Q
The gdb command has more internal commands. Enter "help" at the gdb command prompt "(gdb)" to view all internal commands and instructions. To debug a program using gdb, you must add the "- g" parameter when compiling the source code using gcc.
Reference example
Start the gdb debugger:
[root@linuxcool ~] # gdb (gdb)
Load the binary executable program:
(gdb) file linuxcool.out
Run and track the program:
(gdb) the above start is a brief introduction to the common commands in gdb. Of course, you have to use the above differences in detail before you understand them. If you want to know more, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.