Warning, /frameworks/syntax-highlighting/autotests/folding/highlight.gdb.fold is written in an unsupported language. File is not indexed.

0001 GNU gdb (GDB) 8.1
0002 Copyright (C) 2018 Free Software Foundation, Inc.
0003 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
0004 This is free software: you are free to change and redistribute it.
0005 There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
0006 and "show warranty" for details.
0007 This GDB was configured as "x86_64-pc-linux-gnu".
0008 Type "show configuration" for configuration details.
0009 For bug reporting instructions, please see:
0010 <http://www.gnu.org/software/gdb/bugs/>.
0011 Find the GDB manual and other documentation resources online at:
0012 <http://www.gnu.org/software/gdb/documentation/>.
0013 For help, type "help".
0014 Type "apropos word" to search for commands related to "word"...
0015 Reading symbols from your_application...done.
0016 (gdb) break main
0017 # this is a comment
0018 (gdb) run <arguments for your application>
0019 ...
0020 Breakpoint 1 at 0x400b56: file yourmain.cpp, line 3
0021 3: int main(int argc, char* argv[])
0022 (gdb) continue
0023 (gdb) backtrace
0024 #0  0x7f59e39bf18d in poll () from /usr/lib/libc.so.6
0025 #1  0x7f59df6c8c7c in ?? () from /usr/lib/libglib-2.0.so.0
0026 #2  0x7f59df6c8d8c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
0027 #3  0x7f59e480b23f in QEventDispatcherGlib::processEvents(...)
0028     from /usr/lib/libQt5Core.so.5
0029 ...
0030 (gdb) where
0031 #0  main (argc=1, argv=0x7fffffffca88) at ../../debugging/ex_debugger/main.cpp:11
0032 (gdb) list
0033 10          bool run = true;
0034 11          while (run) {
0035 12              // infinite loop! can you make it quit?
0036 13          }
0037 (gdb) info locals
0038 app = <incomplete type>
0039 run = true
0040 complexData = {{d = 0x61d430, e = 0x61d430}}
0041 (gdb) info scope main.cpp:12
0042 Scope for main.cpp:12:
0043 Symbol argc is a variable at frame base reg $rbp offset 0+-8, length 4.
0044 Symbol argv is a variable at frame base reg $rbp offset 0+-16, length 8.
0045 (gdb) ptype run
0046 type = bool
0047 (gdb) print run
0048 run = true
0049 (gdb) set run = false
0050 (gdb) print run
0051 run = false
0052 (gdb) print myString.size()
0053 42
0054 (gdb) ptype MyType
0055 type = class MyType {
0056 private:
0057     int foo;
0058 public:
0059     int foo() const;
0060     ...
0061 }
0062 (gdb) break QMessageLogger::warning
0063 Breakpoint 1 at 0x7ffff6f143f0 (8 locations)
0064 (gdb) command 1
0065 Type commands for breakpoint(s) 1, one per line.
0066 End with a line saying just \"end\".
0067 > backtrace
0068 > continue
0069 > end
0070 (gdb) catch throw # or when an exception is thrown
0071 Catchpoint 2 (throw)
0072 (gdb) break main.cpp:12 # or when certain code is executed
0073 Breakpoint 3 at 0x401216: file ../../debugging/ex_debugger/main.cpp, line 12.
0074 (gdb) info breakpoints
0075 Num     Type           Disp Enb Address            What
0076 1       breakpoint     keep y   <MULTIPLE>
0077 1.1                         y     0x7ffff6f143f0 <QMessageLogger::warning(char const*, …
0078 ...
0079 2       breakpoint     keep y   0x7ffff66d9b90 exception throw
0080 3       breakpoint     keep y   0x000000401216 in main(int, char**)
0081                                                 at debugging/ex_debugger/main.cpp:12
0082 (gdb) condition 3 argc > 5
0083                 # ^-- breakpoint id, see `info breakpoints` above
0084 (gdb) call myFunction()
0085 (gdb) set pagination off
0086 (gdb) set logging file /tmp/warnings.log
0087 (gdb) set logging on
0088 Copying output to /tmp/warnings.log.
0089 (gdb) info threads
0090             Id   Target Id         Frame
0091 2    Thread 0x7fffe10e1700 (LWP 7271) \"QXcbEventReader\"
0092     0x7ffff0b6718d in poll () from /usr/lib/libc.so.6
0093 * 1    Thread 0x7ffff7edd840 (LWP 7267) \"kwrite\"
0094     0x7ffff0b6718d in poll () from /usr/lib/libc.so.6
0095 (gdb) thread
0096 [Current thread is 1 (Thread 0x7ffff7edd840 (LWP 7267))]
0097 (gdb) thread 2
0098 [Switching to thread 2 (Thread 0x7fffe10e1700 (LWP 9765))]
0099 (gdb) thread apply all backtrace
0100 (gdb) info sharedlibrary
0101 From                To                  Syms Read   Shared Object Library
0102 0x7ffff7ddbb80  0x7ffff7df5610  Yes (*)     /lib64/ld-linux-x86-64.so.2
0103 0x7ffff7690460  0x7ffff7ab723c  Yes         /opt/qt/5.5/gcc_64/lib/libQt5Gui.so.5
0104 0x7ffff6efdb80  0x7ffff71af318  Yes         /opt/qt/5.5/gcc_64/lib/libQt5Core.so.5
0105 0x7ffff6c02f60  0x7ffff6c5f852  Yes (*)     /usr/lib/libGL.so.1
0106 0x7ffff69d3ac0  0x7ffff69e0931  Yes (*)     /usr/lib/libpthread.so.0
0107 0x7ffff66d5fa0  0x7ffff6781d89  Yes         /usr/lib/libstdc++.so.6
0108 0x7ffff6353510  0x7ffff63bb33a  Yes (*)     /usr/lib/libm.so.6
0109 ...
0110 (*): Shared library is missing debugging information.
0111 (gdb) list 64
0112 59           * If no red can be seen, then the cached implementation is \"good enough\".
0113 60           */
0114 61          void paintEvent(QPaintEvent *event)
0115 62          {
0116 63              const QRect rect = event->rect();
0117 64
0118 65              QPainter painter(this);
0119 66              painter.setRenderHint(QPainter::Antialiasing);
0120 67              painter.fillRect(rect, Qt::black);
0121 68
0122 (gdb) dprintf main.cpp:64,\"paint rect(w=%d,h=%d)\\n\",rect.width(),rect.height()
0123 Dprintf 1 at 0x403a1e: file path/to/main.cpp, line 64.
0124 (gdb) continue
0125 Continuing.
0126 paint rect(w=202,h=200)
0127 paint rect(w=213,h=203)
0128 (gdb) target remote <device ip>:<port>
0129 Remote debugging using <device ip>:<port>
0130 Reading /lib64/ld-linux-x86-64.so.2 from remote target...
0131 warning: File transfers from remote targets can be slow.
0132             Use \"set sysroot\"to access files locally instead.
0133 ...
0134 (gdb) set sysroot /path/to/sysroot
0135 (gdb) print myMap
0136 $1 = QMap<QString, int> = {
0137     [\"bar\"] = 1,
0138     [\"foo\"] = 2
0139 }
0140 (gdb) print money
0141 $1 {
0142     {value = 1.20000005, currency = Money::Euro},
0143     {value = 3.4000001, currency = Money::Dollar}
0144 }
0145 (gdb) python
0146 > import sys
0147 > sys.path.insert<beginfold id='1'>(</beginfold id='1'>0, '/path/to/addon/debugging/ex_gdb_pretty_printer'<endfold id='1'>)</endfold id='1'>
0148 > import money_printer
0149 > end
0150 (gdb) print money
0151 $2 = {
0152     \"1.200000 Euro\",
0153     \"3.400000 Dollar\"
0154 }
0155 (gdb) continue
0156 (gdb) detach
0157 (gdb) quit