Skip to content

Instantly share code, notes, and snippets.

@clowwindy
Created January 18, 2015 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clowwindy/b8a8c6e07a8df485e647 to your computer and use it in GitHub Desktop.
Save clowwindy/b8a8c6e07a8df485e647 to your computer and use it in GitHub Desktop.
$ g++ -g LRU.cpp
In file included from LRU.cpp:2:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map:212:5: warning:
Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map> [-W#warnings]
# warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>
^
1 warning generated
$ lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) run
Process 27670 launched: './a.out' (x86_64)
Process 27670 stopped
* thread #1: tid = 0x8466ae, 0x000000010000392c a.out`LRUCache<int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::detach(this=0x00007fff5fbff310, node=0x0000000100104af0) + 28 at LRU.cpp:71, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
frame #0: 0x000000010000392c a.out`LRUCache<int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::detach(this=0x00007fff5fbff310, node=0x0000000100104af0) + 28 at LRU.cpp:71
68
69 private:
70 void detach(Node<K,T>* node){
-> 71 node->prev->next = node->next;
72 node->next->prev = node->prev;
73 }
74
(lldb) p node->prev
(Node<int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > *) $0 = 0x0000000000000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment