概述
GlobalObject
exit()
调试代码:
(gdb) l
20
{
21
printf("GlobalObject:~GlobalObject() n");
22
MutexLockGuard lock(mutex_);
23
printf("GlobalObject:~GlobalObject() cleanningn");
24
}
25
26 private:
27
MutexLock mutex_;
28 };
29
(gdb) l
30 GlobalObject g_obj;
31
32 int main()
33 {
34
g_obj.doit();
35 }(gdb)
Line number 36 out of range; exit.cpp has 35 lines.
(gdb) b main
Breakpoint 1 at 0x98c: file exit.cpp, line 34.
(gdb) r
Starting program: /root/study/chapter-4/exit
Breakpoint 1, main () at exit.cpp:34
34
g_obj.doit();
(gdb) b 21
Breakpoint 2 at 0x555555554bb3: file exit.cpp, line 21.
(gdb) b 23
Breakpoint 3 at 0x555555554bd2: file exit.cpp, line 23.
(gdb) l
29
30 GlobalObject g_obj;
31
32 int main()
33 {
34
g_obj.doit();
35 }(gdb)
Line number 36 out of range; exit.cpp has 35 lines.
(gdb) s
GlobalObject::doit (this=0x555555756040 <g_obj>) at exit.cpp:13
13
void doit()
(gdb) s
15
MutexLockGuard lock(mutex_);
(gdb) p mutex
No symbol "mutex" in current context.
(gdb) p mutex_
$1 = {<noncopyable> = {<No data fields>}, mutex_ = {__data = {__lock = 0, __count = 0, __owner = 0, __
__size = '