Advertisement
bluemmb22

GDB test

Nov 23rd, 2016
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.49 KB | None | 0 0
  1. // ---------------------------- Code
  2.  
  3. #include<bits/stdc++.h>
  4. using namespace std;
  5.  
  6. queue<string> q;
  7.  
  8. int main()
  9. {
  10.         q.push("test");
  11.         q.push("str123");
  12.         cout<<q.front();
  13.         return 0;
  14. }
  15.  
  16.  
  17.  
  18. // --------------------------- GDB output
  19. /*
  20.  
  21. ubuntu@ubuntu:~$ g++ -g test.cpp
  22. ubuntu@ubuntu:~$ gdb ./a.out
  23. GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
  24. Copyright (C) 2016 Free Software Foundation, Inc.
  25. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  26. This is free software: you are free to change and redistribute it.
  27. There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  28. and "show warranty" for details.
  29. This GDB was configured as "x86_64-linux-gnu".
  30. Type "show configuration" for configuration details.
  31. For bug reporting instructions, please see:
  32. <http://www.gnu.org/software/gdb/bugs/>.
  33. Find the GDB manual and other documentation resources online at:
  34. <http://www.gnu.org/software/gdb/documentation/>.
  35. For help, type "help".
  36. Type "apropos word" to search for commands related to "word"...
  37. Reading symbols from ./a.out...done.
  38. (gdb) b 6
  39. Breakpoint 1 at 0x400d7f: file test.cpp, line 6.
  40. (gdb) r
  41. Starting program: /home/ubuntu/a.out
  42.  
  43. Breakpoint 1, main () at test.cpp:7
  44. 7   {
  45. (gdb) print q
  46. No symbol "q" in current context.
  47. (gdb) n
  48. 8           q.push("test");
  49. (gdb) print q
  50. No symbol "q" in current context.
  51. (gdb) n
  52. 9           q.push("str123");
  53. (gdb) print q
  54. No symbol "q" in current context.
  55. (gdb)
  56.  
  57.  
  58. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement