Changeset View
Changeset View
Standalone View
Standalone View
autotests/html/highlight.gdb.html
- This file was added.
1 | <!DOCTYPE html> | ||||
---|---|---|---|---|---|
2 | <html><head> | ||||
3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||||
4 | <title>highlight.gdb</title> | ||||
5 | <meta name="generator" content="KF5::SyntaxHighlighting (GDB)"/> | ||||
6 | </head><body style="color:#1f1c1b"><pre> | ||||
7 | GNU gdb (GDB) 8.1 | ||||
8 | Copyright (C) 2018 Free Software Foundation, Inc. | ||||
9 | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | ||||
10 | This is free software: you are free to change and redistribute it. | ||||
11 | There is NO WARRANTY, to the extent permitted by law. Type "show copying" | ||||
12 | and "show warranty" for details. | ||||
13 | This GDB was configured as "x86_64-pc-linux-gnu". | ||||
14 | Type "show configuration" for configuration details. | ||||
15 | For bug reporting instructions, please see: | ||||
16 | <http://www.gnu.org/software/gdb/bugs/>. | ||||
17 | Find the GDB manual and other documentation resources online at: | ||||
18 | <http://www.gnu.org/software/gdb/documentation/>. | ||||
19 | For help, type "help". | ||||
20 | Type "apropos word" to search for commands related to "word"... | ||||
21 | Reading symbols from your_application...done. | ||||
22 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">break</span><span style="color:#644a9b;"> main</span> | ||||
23 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">run</span><span style="color:#644a9b;"> <arguments for your application></span> | ||||
24 | ... | ||||
25 | Breakpoint 1 at 0x400b56: file yourmain.cpp, line 3 | ||||
26 | 3: int main(int argc, char* argv[]) | ||||
27 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">continue</span> | ||||
28 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">backtrace</span> | ||||
29 | #0 0x7f59e39bf18d in <span style="color:#644a9b;font-weight:bold;">poll</span> () from<span style="color:#0057ae;"> /usr/lib/libc.so.6</span> | ||||
30 | #1 0x7f59df6c8c7c in <span style="color:#644a9b;font-weight:bold;">??</span> () from<span style="color:#0057ae;"> /usr/lib/libglib-2.0.so.0</span> | ||||
31 | #2 0x7f59df6c8d8c in <span style="color:#644a9b;font-weight:bold;">g_main_context_iteration</span> () from<span style="color:#0057ae;"> /usr/lib/libglib-2.0.so.0</span> | ||||
32 | #3 0x7f59e480b23f in <span style="color:#006e28;">QEventDispatcherGlib::</span><span style="color:#644a9b;font-weight:bold;">processEvents</span>(...) | ||||
33 | from<span style="color:#0057ae;"> /usr/lib/libQt5Core.so.5</span> | ||||
34 | ... | ||||
35 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">where</span> | ||||
36 | #0 <span style="color:#644a9b;font-weight:bold;">main</span> (argc=1, argv=0x7fffffffca88) at<span style="color:#0057ae;"> ../../debugging/ex_debugger/main.cpp</span>:11 | ||||
37 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">list</span> | ||||
38 | 10 bool run = true; | ||||
39 | 11 while (run) { | ||||
40 | 12 // infinite loop! can you make it quit? | ||||
41 | 13 } | ||||
42 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">info</span><span style="color:#644a9b;"> locals</span> | ||||
43 | app = <incomplete type> | ||||
44 | run = true | ||||
45 | complexData = {{d = 0x61d430, e = 0x61d430}} | ||||
46 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">info</span><span style="color:#644a9b;"> scope main.cpp:12</span> | ||||
47 | Scope for main.cpp:12: | ||||
48 | Symbol argc is a variable at frame base reg $rbp offset 0+-8, length 4. | ||||
49 | Symbol argv is a variable at frame base reg $rbp offset 0+-16, length 8. | ||||
50 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">ptype</span><span style="color:#644a9b;"> run</span> | ||||
51 | type = bool | ||||
52 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">print</span><span style="color:#644a9b;"> run</span> | ||||
53 | run = true | ||||
54 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">set</span><span style="color:#644a9b;"> run = false</span> | ||||
55 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">print</span><span style="color:#644a9b;"> run</span> | ||||
56 | run = false | ||||
57 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">print</span><span style="color:#644a9b;"> myString.size()</span> | ||||
58 | 42 | ||||
59 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">ptype</span><span style="color:#644a9b;"> MyType</span> | ||||
60 | type = class MyType { | ||||
61 | private: | ||||
62 | int foo; | ||||
63 | public: | ||||
64 | int foo() const; | ||||
65 | ... | ||||
66 | } | ||||
67 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">break</span><span style="color:#644a9b;"> QMessageLogger::warning</span> | ||||
68 | Breakpoint 1 at 0x7ffff6f143f0 (8 locations) | ||||
69 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">command</span><span style="color:#644a9b;"> 1</span> | ||||
70 | Type commands for breakpoint(s) 1, one per line. | ||||
71 | End with a line saying just \"end\". | ||||
72 | <span style="color:#644a9b;">> </span><span style="font-weight:bold;">backtrace</span> | ||||
73 | <span style="color:#644a9b;">> </span><span style="font-weight:bold;">continue</span> | ||||
74 | <span style="color:#644a9b;">> </span><span style="font-weight:bold;">end</span> | ||||
75 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">catch</span><span style="color:#644a9b;"> throw </span><span style="color:#898887;"># or when an exception is thrown</span> | ||||
76 | Catchpoint 2 (throw) | ||||
77 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">break</span><span style="color:#644a9b;"> main.cpp:12 </span><span style="color:#898887;"># or when certain code is executed</span> | ||||
78 | Breakpoint 3 at 0x401216: file ../../debugging/ex_debugger/main.cpp, line 12. | ||||
79 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">info</span><span style="color:#644a9b;"> breakpoints</span> | ||||
80 | Num Type Disp Enb Address What | ||||
81 | 1 breakpoint keep y <MULTIPLE> | ||||
82 | 1.1 y 0x7ffff6f143f0 <QMessageLogger::warning(char const*, … | ||||
83 | ... | ||||
84 | 2 breakpoint keep y 0x7ffff66d9b90 exception throw | ||||
85 | 3 breakpoint keep y 0x000000401216 in main(int, char**) | ||||
86 | at debugging/ex_debugger/main.cpp:12 | ||||
87 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">condition</span><span style="color:#644a9b;"> 3 argc > 5</span> | ||||
88 | # ^-- breakpoint id, see `info breakpoints` above | ||||
89 | (gdb) call <span style="color:#644a9b;font-weight:bold;">myFunction</span>() | ||||
90 | (gdb) set paginat<span style="color:#0057ae;">ion off</span> | ||||
91 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">set</span><span style="color:#644a9b;"> logging file /tmp/warnings.log</span> | ||||
92 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">set</span><span style="color:#644a9b;"> logging on</span> | ||||
93 | Copying output to /tmp/warnings.log. | ||||
94 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">info</span><span style="color:#644a9b;"> threads</span> | ||||
95 | Id Target Id Frame | ||||
96 | 2 Thread 0x7fffe10e1700 (LWP 7271) \"QXcbEventReader\" | ||||
97 | 0x7ffff0b6718d in poll () from /usr/lib/libc.so.6 | ||||
98 | * 1 Thread 0x7ffff7edd840 (LWP 7267) \"kwrite\" | ||||
99 | 0x7ffff0b6718d in poll () from /usr/lib/libc.so.6 | ||||
100 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">thread</span> | ||||
101 | <span style="color:#b08000;">[Current thread is 1 (Thread 0x7ffff7edd840 (LWP 7267))]</span> | ||||
102 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">thread</span><span style="color:#644a9b;"> 2</span> | ||||
103 | [Switching to thread 2 (Thread 0x7fffe10e1700 (LWP 9765))] | ||||
104 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">thread</span><span style="color:#644a9b;"> apply all backtrace</span> | ||||
105 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">info</span><span style="color:#644a9b;"> sharedlibrary</span> | ||||
106 | From To Syms Read Shared Object Library | ||||
107 | 0x7ffff7ddbb80 0x7ffff7df5610 Yes (*) /lib64/ld-linux-x86-64.so.2 | ||||
108 | 0x7ffff7690460 0x7ffff7ab723c Yes /opt/qt/5.5/gcc_64/lib/libQt5Gui.so.5 | ||||
109 | 0x7ffff6efdb80 0x7ffff71af318 Yes /opt/qt/5.5/gcc_64/lib/libQt5Core.so.5 | ||||
110 | 0x7ffff6c02f60 0x7ffff6c5f852 Yes (*) /usr/lib/libGL.so.1 | ||||
111 | 0x7ffff69d3ac0 0x7ffff69e0931 Yes (*) /usr/lib/libpthread.so.0 | ||||
112 | 0x7ffff66d5fa0 0x7ffff6781d89 Yes /usr/lib/libstdc++.so.6 | ||||
113 | 0x7ffff6353510 0x7ffff63bb33a Yes (*) /usr/lib/libm.so.6 | ||||
114 | ... | ||||
115 | (*): Shared library is missing debugging information. | ||||
116 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">list</span><span style="color:#644a9b;"> 64</span> | ||||
117 | 59 * If no red can be seen, then the cached implementation is \"good enough\". | ||||
118 | 60 */ | ||||
119 | 61 void paintEvent(QPaintEvent *event) | ||||
120 | 62 { | ||||
121 | 63 const QRect rect = event->rect(); | ||||
122 | 64 | ||||
123 | 65 QPainter painter(this); | ||||
124 | 66 painter.setRenderHint(QPainter::Antialiasing); | ||||
125 | 67 painter.fillRect(rect, Qt::black); | ||||
126 | 68 | ||||
127 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">dprintf</span><span style="color:#644a9b;"> main.cpp:64,\"paint rect(w=%d,h=%d)\\n\",rect.width(),rect.height()</span> | ||||
128 | Dprintf 1 at 0x403a1e: file path/to/main.cpp, line 64. | ||||
129 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">continue</span> | ||||
130 | Continuing. | ||||
131 | paint rect(w=202,h=200) | ||||
132 | paint rect(w=213,h=203) | ||||
133 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">target</span><span style="color:#644a9b;"> remote <device ip>:<port></span> | ||||
134 | Remote debugging using <device ip>:<port> | ||||
135 | Reading /lib64/ld-linux-x86-64.so.2 from remote target... | ||||
136 | warning: File transfers from remote targets can be slow. | ||||
137 | Use \"set sysroot\"to access files locally instead. | ||||
138 | ... | ||||
139 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">set</span><span style="color:#644a9b;"> sysroot /path/to/sysroot</span> | ||||
140 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">print</span><span style="color:#644a9b;"> myMap</span> | ||||
141 | $1 = QMap<QString, int> = { | ||||
142 | [\"bar\"] = 1, | ||||
143 | [\"foo\"] = 2 | ||||
144 | } | ||||
145 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">print</span><span style="color:#644a9b;"> money</span> | ||||
146 | $1 { | ||||
147 | {value = 1.20000005, currency = Money::Euro}, | ||||
148 | {value = 3.4000001, currency = Money::Dollar} | ||||
149 | } | ||||
150 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">python</span> | ||||
151 | > <span style="color:#ff5500;">import</span> sys | ||||
152 | > sys.path.insert(<span style="color:#b08000;">0</span>, <span style="color:#bf0303;">'/path/to/addon/debugging/ex_gdb_pretty_printer'</span>) | ||||
153 | > <span style="color:#ff5500;">import</span> money_printer | ||||
154 | > <span style="font-weight:bold;">end</span> | ||||
155 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">print</span><span style="color:#644a9b;"> money</span> | ||||
156 | $2 = { | ||||
157 | \"1.200000 Euro\", | ||||
158 | \"3.400000 Dollar\" | ||||
159 | } | ||||
160 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">continue</span> | ||||
161 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">detach</span> | ||||
162 | <span style="color:#644a9b;">(gdb) </span><span style="font-weight:bold;">quit</span> | ||||
163 | </pre></body></html> |