Documentation Source Text

Check-in [ad08afecb8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improvements to the debugging.html webpage.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ad08afecb800aedf9d3b33f57854658901461b4bf5490891fdb2618781d97d29
User & Date: drh 2019-03-22 15:04:55.250
Context
2019-03-23
16:09
Add a note about the ".breakpoint" shell command to the "debugging.html" page. (check-in: 61444ae7e4 user: drh tags: trunk)
2019-03-22
15:04
Improvements to the debugging.html webpage. (check-in: ad08afecb8 user: drh tags: trunk)
2019-03-18
10:26
Updates to the size and speed graph spreadsheet. (check-in: c925c91186 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to pages/debugging.in.
19
20
21
22
23
24
25



26
27
28
29
30
31
32
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35







+
+
+







to understand, it is often useful to run it in the [command-line shell]
with the ".eqp full" setting.  When ".eqp" is set to FULL, the shell
automatically shows the [EXPLAIN] and [EXPLAIN QUERY PLAN] output for
each command prior to actually running that command.

<p>For added readability, also set ".echo on" so that the output contains
the original SQL text.

<p>The newer ".eqp trace" command does everything that ".eqp full" does
and also turns on [vdbe_trace|VDBE tracing].
</li>

<li>
<p><b>Use compile-time options to enable debugging features.</b>

<p>Suggested compile-time options include:
<ul>
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
79
80
81
82
83
84
85

86
87
88
89
90
91
92
93







-
+








<p>When debugging the [bytecode] generator, it is often useful to know
where a particular opcode is being generated.  To find this easily,
run the script in a debugger.  Set a breakpoint on the "test_addoptrace"
routine.  Then run the "PRAGMA vdbe_addoptrace=ON;" followed by the
SQL statement in question.  Each opcode will be displayed as it is
appended to the VDBE program, and the breakpoint will fire immediately
thereafter.  Step until reaching the opcode and question then look backwards
thereafter.  Step until reaching the opcode then look backwards
in the stack to see where and how it was generated.

<p>This only works when compiled with [SQLITE_DEBUG].
</li>

<li>
<p><b>Using the ".selecttrace" and ".wheretrace" shell commands</b>
102
103
104
105
106
107
108
109


110
111
112
113
114
115
116
105
106
107
108
109
110
111

112
113
114
115
116
117
118
119
120







-
+
+







</li>

<li>
<p><b>Disable the [lookaside memory allocator]</b>

<p>When looking for memory allocation problems (memory leaks, use-after-free
errors, buffer overflows, etc) it is sometimes useful to disable the
[lookaside memory allocator] then run the test under valgrind.
[lookaside memory allocator] then run the test under valgrind or MSAN or
some other heap memory debugging tool.
The lookaside memory allocator can 
be disabled at start-time using the [SQLITE_CONFIG_LOOKASIDE]
interface.  The [command-line shell] will use that interface to
disable lookaside if it is started with the "--lookaside 0 0"
command line option.
</li>
</ol>