Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在LP64中,C++通过引用更改ME上的指针值。我应该看什么?_C++_Pass By Reference_Solaris Studio - Fatal编程技术网

在LP64中,C++通过引用更改ME上的指针值。我应该看什么?

在LP64中,C++通过引用更改ME上的指针值。我应该看什么?,c++,pass-by-reference,solaris-studio,C++,Pass By Reference,Solaris Studio,我深入了解synergy-project.org的旧版本1.3.4,将其构建在Solaris Studio 12.4上 在这个程序中,有两个地方用参数指针调用函数,而 指针在进入的过程中被弄坏了。在-m64中编译和链接。我可以在构建标志中看到什么 或者其他来弄清楚为什么这是haywire? 在下面的日志中,程序在看到错误指针的函数内被中断。 堆栈上的父级具有正确的数据: (dbx) print &event &event = 0x948d30 (dbx) up

我深入了解synergy-project.org的旧版本1.3.4,将其构建在Solaris Studio 12.4上 在这个程序中,有两个地方用参数指针调用函数,而 指针在进入的过程中被弄坏了。在-m64中编译和链接。我可以在构建标志中看到什么 或者其他来弄清楚为什么这是haywire? 在下面的日志中,程序在看到错误指针的函数内被中断。 堆栈上的父级具有正确的数据:

(dbx) print &event
&event = 0x948d30
(dbx) up          
Current function is TMethodEventJob<CXWindowsScreen>::run
 66                   (m_object->*m_method)(event, m_arg);
(dbx) print &event
&event = 0xffff80f8be958a60

(dbx) down
(dbx) print event
event = {
m_type   = 7354752U
m_target = 0x7091a0
m_data   = 0x7036a0
m_flags  = 6257120U
}
(dbx) up        
Current function is TMethodEventJob<CXWindowsScreen>::run
   66                   (m_object->*m_method)(event, m_arg);
(dbx) print event
event = {
m_type   = 2U
m_target = 0x94ee80
m_data   = 0xc838b0d68
m_flags  = 0
}
…其中m_解析器解析为:

bool
CClientProxy1_0::parseHandshakeMessage(const UInt8* code)
{
    if (memcmp(code, kMsgCNoop, 4) == 0) {
            // discard no-ops
            LOG((CLOG_DEBUG2 "no-op from", getName().c_str()));
            return true;
    }
    else if (memcmp(code, kMsgDInfo, 4) == 0) {
            // future messages get parsed by parseMessage
            m_parser = &CClientProxy1_0::parseMessage;
            if (recvInfo()) {
                    EVENTQUEUE->addEvent(CEvent(getReadyEvent(), getEventTarget()));
                    addHeartbeatTimer();
                    return true;
            }
    }
    return false;
}
}
。。。注意,随着通信协议的发展,m_解析器是如何重新加载的

在回答关于进入函数的问题时:它在进入函数时被破坏,
并导致函数不久后崩溃。如果我硬编码将握手消息解析为handleData,它将正常工作。然而,我在这个系统中还有其他依赖函数指针来正确工作的例子。我可能会发布编译标志,它们是冗余和广泛的。

尝试使用+W2-xport64编译所有内容


这可能会产生很多错误/警告。理想情况下,您的代码应该清除所有警告,尤其是从-xPuts64 .< /p>生成的警告,您是否也可以发布相应的相应C++代码片段?另外,您确定已在参数实际初始化时停止程序吗?也许你需要跨过被叫人的第一行或者其他什么……制作一个电话是你能做的最好的事情。如果你不能做一个,即当你删除一些代码时,错误消失了,那么这是一个关于错误来自何处的强有力的线索。
bool
CClientProxy1_0::parseHandshakeMessage(const UInt8* code)
{
    if (memcmp(code, kMsgCNoop, 4) == 0) {
            // discard no-ops
            LOG((CLOG_DEBUG2 "no-op from", getName().c_str()));
            return true;
    }
    else if (memcmp(code, kMsgDInfo, 4) == 0) {
            // future messages get parsed by parseMessage
            m_parser = &CClientProxy1_0::parseMessage;
            if (recvInfo()) {
                    EVENTQUEUE->addEvent(CEvent(getReadyEvent(), getEventTarget()));
                    addHeartbeatTimer();
                    return true;
            }
    }
    return false;
}
}