我想知道是否有人面对它,并且可以帮助我理解它。
(gdb) p *rsp
$8 = {<> = {Couldn't find virtual table -- object may not be constructed yet.
(gdb) p rrc
$9 = (class iface::rrc::MeasurementMessage *) 0x0
(gdb) l
417 iface::cpr::PositionResponse &rspPtr,
418 bool &is3D)
419 {
420 iface::rrlp::PositionResponse *rsp = lt.getRrlpResponse();
421 iface::rrc::MeasurementMessage *rrc = lt.getRrc();
422 iface::lpp::PositionResponse *lpp = lt.getLppResponse();
423 const iface::util::GadShape *gad = 0;
424 iface::cpr::PositionRequest &req = lt.getCprRequest();
425 const iface::is801::MsRspLocation *cdma = lt.getMsRspLocation();
426
(gdb) bt
#0 eotd::fetchAndSetPosition (lt=@0xa76200, position=@0x65e2c640,
rspPtr=@0x3be9660, is3D=@0x65e2c580)
at /home/egpsbld/source/smlc47hpux/icursor/com/cps/eotd/utils.cpp:422
#1 0x200000007e7195b0:0 in eotd::P6Locator::compute (this=0x4076c0,
lt=@0xa76200)
答案 0 :(得分:1)
调试优化代码时,这类问题很常见。局部变量都被优化器搞砸了。当然,结果行为是相同的,但是您不会在何时何地看到数据。
如果是这种情况,只需使用-O0