c++ EXC_BAD_ACCESS 错误,如何调试

c++ EXC_BAD_ACCESS error, how to debug

我确实编译了我的代码,没有任何错误,当我 运行 它时,我得到了分段错误 11。 使用 lldb 跟踪代码后,我在下面的代码中遇到了 EXC_BAD_ACCESS 错误。问题是它说有错误的行不在我的代码中。所以我不知道如何调试代码。

感谢任何帮助,在此先感谢。这是错误消息:

* thread #1: tid = 0x17be3, 0x000000010000393f p1ex01`Tree<int, std::__1::less<int> >::Tree(std::__1::list<int, std::__1::allocator<int> > const&) [inlined] std::__1::deque<int, std::__1::allocator<int> >::back(this=0x00007fff5fbfe868 size=0) + 96 at deque:1752, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x000000010000393f p1ex01`Tree<int, std::__1::less<int> >::Tree(std::__1::list<int, std::__1::allocator<int> > const&) [inlined] std::__1::deque<int, std::__1::allocator<int> >::back(this=0x00007fff5fbfe868 size=0) + 96 at deque:1752
1749    deque<_Tp, _Allocator>::back()
1750    {
1751        size_type __p = __base::size() + __base::__start_ - 1;
-> 1752     return *(*(__base::__map_.begin() + __p / __base::__block_size) + __p % __base::__block_size);
1753    }
1754    
1755    template <class _Tp, class _Allocator>

出现该错误时键入 'bt'。这将为您提供函数调用回溯。 – 乔尔科内特