命令在
log stdout
全局变量在
(gdb) p zlog_default
$4 = (struct zlog *) 0x7ffff0335018
(gdb) b
定义在
/* va_list version of zlog. */
static void
vzlog (struct zlog *zl, int priority, const char *format, va_list args)
这个zlog_default是怎么个混淆!
160 if (zl == NULL)
(gdb) n
161 zl = zlog_default;
(gdb) n
164 if (zl == NULL)
(gdb) n
176 tsctl.precision = zl->timestamp_precision;
(gdb) n
179 if (priority <= zl->maxlvl[ZLOG_DEST_SYSLOG])
(gdb) n
188 if ((priority <= zl->maxlvl[ZLOG_DEST_FILE]) && zl->fp)
(gdb) n
203 if (priority <= zl->maxlvl[ZLOG_DEST_STDOUT])
(gdb) n
218 if (priority <= zl->maxlvl[ZLOG_DEST_MONITOR])
(gdb) p priority
$7 = 5
(gdb) p zl->maxlvl[ZLOG_DEST_STDOUT]
$8 = 3
(gdb) p zlog_default->maxlvl[ZLOG_DEST_STDOUT]
$9 = 7
(gdb) p zl
$10 = (struct zlog *) 0x7ffff0271018
(gdb) p zlog_default
$11 = (struct zlog *) 0x7ffff0335018
(gdb)
Breakpoint 1, openzlog (progname=0x79afd0 "zebra", protocol=ZLOG_ZEBRA, syslog_flags=11, syslog_facility=24) at log.c:679
679 zl = XCALLOC(MTYPE_ZLOG, sizeof (struct zlog));
(gdb) bt
#0 openzlog (progname=0x79afd0 "zebra", protocol=ZLOG_ZEBRA, syslog_flags=11, syslog_facility=24) at log.c:679
#1 0x00007ffff09c94c9 in main (argc=5, argv=0x708f00) at main.c:232
#2 0x00007ffff7a0708f in ns3::DceManager::DoStartProcess (context=0x82a080) at ../model/dce-manager.cc:283
#3 0x00007ffff7a907fc in ns3::TaskManager::Trampoline (context=0x6e0200) at ../model/task-manager.cc:274
#4 0x00007ffff7a8c7d7 in ns3::PthreadFiberManager::Run (arg=0x82a370) at ../model/pthread-fiber-manager.cc:402
#5 0x000000318b2079d1 in start_thread () from /lib64/libpthread.so.0
#6 0x000000318a6e88fd in clone () from /lib64/libc.so.6
(gdb)
这里出现值切换让我不知所措
Old value = (struct zlog *) 0x7ffff0335018
New value = (struct zlog *) 0x7ffff7252018
0x000000318a68998c in memcpy () from /lib64/libc.so.6
(gdb) bt
#0 0x000000318a68998c in memcpy () from /lib64/libc.so.6
#1 0x00007ffff7aa28de in ns3::CoojaLoader::NotifyStartExecute (this=0x6d25f0) at ../model/cooja-loader-factory.cc:129
#2 0x00007ffff7a077fa in ns3::DceManager::TaskSwitch (type=ns3::Task::TO, context=0x829b70) at ../model/dce-manager.cc:375
#3 0x00007ffff7a92735 in ns3::TaskManager::Schedule (this=0x773d40) at ../model/task-manager.cc:431
#4 0x00007ffff7a947a5 in ns3::EventImpl* ns3::MakeEvent<void (ns3::TaskManager::*)(), ns3::TaskManager*>(void (ns3::TaskManager::*)(), ns3::TaskManager*)::EventMemberImpl0::Notify() (this=0x699780) at /home/z/dce/build/include/ns3.23/ns3/make-event.h:323
#5 0x00007ffff73465e7 in ns3::EventImpl::Invoke (this=0x699780) at ../src/core/model/event-impl.cc:51
#6 0x00007ffff734b2ac in ns3::DefaultSimulatorImpl::ProcessOneEvent (this=0x6bedb0) at ../src/core/model/default-simulator-impl.cc:147
#7 0x00007ffff734b638 in ns3::DefaultSimulatorImpl::Run (this=0x6bedb0) at ../src/core/model/default-simulator-impl.cc:200
#8 0x00007ffff7347378 in ns3::Simulator::Run () at ../src/core/model/simulator.cc:204
#9 0x000000000042857e in main (argc=5, argv=0x7fffffffdbd8) at ../myscripts/ns-3-dce-quagga/example/dce-zebra-simple.cc:823
(gdb)