Set the Core Environment
Uname-a view Machine Parameters
Ulimit-a view default parameters
Ulimit-C 1024 sets the core file size to 1024
Ulimit-C unlimit: Set the core file size to unlimited.
Multi-thread dump is often a segment error, which generally involves illegal memory read/write. You can use the following command to enable the system switch so that it can generate
Core File.
Ulimit-C Unlimited
Thread debugging command
(GDB) info threads
Display All the currently debuggable threads. Each thread has an ID allocated to it by GDB, which will be used in subsequent thread operations.
There are * threads currently being debugged.
(GDB) thread ID
Switch the thread of the current debugging to the thread with the specified ID.
(GDB) thread apply id1 Id2 command
Let one or more threads execute the gdb command.
(GDB) thread apply all command
Let all the debugging threads execute the gdb command.
(GDB) set scheduler-locking off | on | step
It is estimated that all users who have used multi-thread debugging can find that when using the step or continue command to debug the currently debugged thread, other threads also execute at the same time, how can I only execute the program to be debugged? You can use this command to achieve this requirement.
Off does not lock any thread, that is, all threads are executed. This is the default value.
On is executed only by the currently debugged program.
Step in a single step, except for the next function (people familiar with the situation may know that this is actually an action to set the breakpoint and then continue, only the current thread will execute.
// Display thread stack information
(GDB) BT
View All call stacks
(GDB) F 3
Call box level
(GDB) I locals
Display all variables of all current call stacks