G

FastLED 3.9.17 AVR GDB session

public
Guest May 25, 2025 354 days 11
Clone
C++ paste1.cpp 330 lines (328 loc) | 16.37 KB
The provided code appears to be a debugging session in GDB (GNU Debugger) for an Arduino project, specifically dealing with the initialization of objects and data structures in the sketch. It seems to be a low-level debugging process trying to identify issues within the initialization routines of the sketch and libraries being used. Key Points: 1. The debugging is moving through various functions and initializations within the Arduino codebase and FastLED library. 2. Initializations of constructors for objects like `HardwareSerial`, `Stream`, `Print`, and various other classes are being traced. 3. Memory allocation and object construction are being tracked, along with function calls made during initialization. 4. The code seems to be stuck in a loop, repeatedly performing a similar set of operations in various parts of the codebase. 5. Information about register values, program counters, and memory addresses are being inspected to diagnose issues. In summary, the provided output shows a detailed step-by-step debugging session, likely conducted to identify and resolve issues with object initializations, memory usage, and constructor calls within an Arduino sketch using FastLED library components.
1
Reading symbols from /mnt/sketch.elf...
2
Remote debugging using /dev/ttyS1
3
0x00000000 in __vectors ()
4
(gdb) s
5
Single stepping until exit from function __vectors,
6
which has no line number information.
7
0x00000078 in __init ()
8
(gdb) s
9
Single stepping until exit from function __init,
10
which has no line number information.
11
__do_copy_data () at ../../../../gcc/libgcc/config/avr/lib1funcs.S:2409
12
2409 ../../../../gcc/libgcc/config/avr/lib1funcs.S: No such file or directory.
13
(gdb) s 100
14
2422 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
15
(gdb)
16
2422 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
17
(gdb)
18
2422 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
19
(gdb) s
20
2424 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
21
(gdb) s
22
2425 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
23
(gdb) s
24
2426 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
25
(gdb) s
26
2417 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
27
(gdb) s
28
2422 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
29
(gdb) s
30
2424 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
31
(gdb)
32
2425 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
33
(gdb)
34
2426 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
35
(gdb) break +1
36
Breakpoint 1 at 0x9a: file ../../../../gcc/libgcc/config/avr/lib1funcs.S, line 2441.
37
(gdb) cont
38
Continuing.
39
40
Breakpoint 1, __do_clear_bss () at ../../../../gcc/libgcc/config/avr/lib1funcs.S:2441
41
2441 ../../../../gcc/libgcc/config/avr/lib1funcs.S: No such file or directory.
42
(gdb) s
43
2442 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
44
(gdb) s
45
2443 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
46
(gdb) s
47
2444 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
48
(gdb) s
49
2448 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
50
(gdb) s
51
2449 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
52
(gdb) s
53
2450 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
54
(gdb) s
55
2446 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
56
(gdb) s
57
2448 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
58
(gdb) s
59
2449 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
60
(gdb) s
61
2450 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
62
(gdb) break +1
63
Breakpoint 2 at 0xaa: file ../../../../gcc/libgcc/config/avr/lib1funcs.S, line 2466.
64
(gdb) cont
65
Continuing.
66
67
Breakpoint 2, __do_global_ctors () at ../../../../gcc/libgcc/config/avr/lib1funcs.S:2466
68
2466 ../../../../gcc/libgcc/config/avr/lib1funcs.S: No such file or directory.
69
(gdb) s
70
2467 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
71
(gdb) s
72
2468 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
73
(gdb) s
74
2472 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
75
(gdb) s
76
2483 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
77
(gdb) s
78
2484 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
79
(gdb) s
80
2489 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
81
(gdb) s
82
2474 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
83
(gdb) s
84
2480 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
85
(gdb) s
86
2481 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
87
(gdb) s
88
__tablejump2__ () at ../../../../gcc/libgcc/config/avr/lib1funcs.S:2296
89
2296 ../../../../gcc/libgcc/config/avr/lib1funcs.S: No such file or directory.
90
(gdb) s
91
2297 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
92
(gdb) s
93
2328 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
94
(gdb) s
95
2329 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
96
(gdb) s
97
2330 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
98
(gdb) s
99
2331 in ../../../../gcc/libgcc/config/avr/lib1funcs.S
100
(gdb) s
101
0x0000392e in global constructors keyed to 65535_0_sketch.ino.cpp.o.17608 ()
102
(gdb) s
103
Single stepping until exit from function _GLOBAL__I_65535_0_sketch.ino.cpp.o.17608,
104
which has no line number information.
105
_GLOBAL__sub_I___vector_18 () at /home/hexi/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/HardwareSerial0.cpp:77
106
77 }
107
(gdb) si
108
0x000002c8 77 }
109
(gdb) si
110
0x000002ca 77 }
111
(gdb) si
112
0x000002cc 77 }
113
(gdb) s
114
__static_initialization_and_destruction_0 (__initialize_p=1, __priority=-1) at /home/hexi/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/HardwareSerial0.cpp:77
115
77 }
116
(gdb) break +1
117
No line 78 in the current file.
118
Make breakpoint pending on future shared library load? (y or [n]) n
119
(gdb) s
120
70 HardwareSerial Serial(&UBRR0H, &UBRR0L, &UCSR0A, &UCSR0B, &UCSR0C, &UDR0);
121
(gdb) s
122
HardwareSerial::HardwareSerial () at /home/hexi/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/HardwareSerial_private.h:95
123
95 _tx_buffer_head(0), _tx_buffer_tail(0)
124
(gdb) s
125
Stream::Stream () at /home/hexi/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/Stream.h:63
126
63 Stream() {_timeout=1000;}
127
(gdb) s
128
Print::Print () at /home/hexi/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/Print.h:46
129
46 Print() : write_error(0) {}
130
(gdb) s
131
Stream::Stream () at /home/hexi/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/Stream.h:63
132
63 Stream() {_timeout=1000;}
133
(gdb) s
134
HardwareSerial::HardwareSerial () at /home/hexi/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/HardwareSerial_private.h:95
135
95 _tx_buffer_head(0), _tx_buffer_tail(0)
136
(gdb) s
137
0x00003932 in global constructors keyed to 65535_0_sketch.ino.cpp.o.17608 ()
138
(gdb) i r
139
r0 0x97 151
140
r1 0x0 0
141
r2 0x0 0
142
r3 0x0 0
143
r4 0x0 0
144
r5 0x0 0
145
r6 0x0 0
146
r7 0x0 0
147
r8 0x0 0
148
r9 0x0 0
149
r10 0x0 0
150
r11 0x0 0
151
r12 0x0 0
152
r13 0x0 0
153
r14 0x0 0
154
r15 0x0 0
155
r16 0x0 0
156
r17 0x0 0
157
r18 0x4 4
158
r19 0x0 0
159
r20 0x0 0
160
r21 0x0 0
161
r22 0xff 255
162
r23 0x0 0
163
r24 0xc6 198
164
r25 0x0 0
165
r26 0x0 0
166
r27 0x0 0
167
r28 0x3a 58
168
r29 0x0 0
169
r30 0x44 68
170
r31 0x4 4
171
SREG 0x2 2
172
SP 0x8fd 0x8008fd
173
PC2 0x3932 14642
174
pc 0x1c99 0x3932 <global constructors keyed to 65535_0_sketch.ino.cpp.o.17608+4>
175
(gdb) s
176
Single stepping until exit from function _GLOBAL__I_65535_0_sketch.ino.cpp.o.17608,
177
which has no line number information.
178
_GLOBAL__sub_I__ZN2fl13xypath_detail19unique_missing_nameERKNS_3StrE () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/xypath.cpp:284
179
284 } // namespace fl
180
(gdb) break +1
181
No line 285 in the current file.
182
Make breakpoint pending on future shared library load? (y or [n]) n
183
(gdb) s
184
__static_initialization_and_destruction_0 (__initialize_p=1, __priority=-1) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/xypath.cpp:284
185
284 } // namespace fl
186
(gdb) s
187
19 ThreadLocal<XYRasterU8Sparse> tls_raster;
188
(gdb) s
189
fl::ThreadLocalFake<fl::XYRasterU8Sparse>::ThreadLocalFake () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/thread_local.h:21
190
21 ThreadLocalFake() : mValue() {}
191
(gdb) s
192
s
193
__static_initialization_and_destruction_0 (__initialize_p=1, __priority=-1) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:327
194
327 size_t p = 1;
195
(gdb) s
196
19 ThreadLocal<XYRasterU8Sparse> tls_raster;
197
(gdb) s
198
fl::ThreadLocalFake<fl::XYRasterU8Sparse>::ThreadLocalFake () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/thread_local.h:21
199
21 ThreadLocalFake() : mValue() {}
200
(gdb) s
201
fl::XYRasterU8Sparse::__base_ctor (this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/raster_sparse.h:40
202
40 XYRasterU8Sparse() = default;
203
(gdb) s
204
fl::HashMap::__base_ctor (max_load=0.699999988, initial_capacity=8, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:55
205
55 _deleted(next_power_of_two(initial_capacity)) {
206
(gdb) s
207
fl::HashMap<fl::vec2<int>, unsigned char, fl::Hash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::next_power_of_two () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:328
208
328 while (p < n)
209
(gdb) s
210
329 p <<= 1;
211
(gdb) s
212
__static_initialization_and_destruction_0 (__initialize_p=1, __priority=-1) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/xypath.cpp:19
213
19 ThreadLocal<XYRasterU8Sparse> tls_raster;
214
(gdb) s
215
fl::ThreadLocalFake<fl::XYRasterU8Sparse>::ThreadLocalFake () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/thread_local.h:21
216
21 ThreadLocalFake() : mValue() {}
217
(gdb) s
218
fl::XYRasterU8Sparse::__base_ctor (this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/raster_sparse.h:40
219
40 XYRasterU8Sparse() = default;
220
(gdb) s
221
fl::HashMap::__base_ctor (max_load=0.699999988, initial_capacity=8, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:55
222
55 _deleted(next_power_of_two(initial_capacity)) {
223
(gdb) s
224
fl::HashMap<fl::vec2<int>, unsigned char, fl::Hash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::next_power_of_two () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:328
225
328 while (p < n)
226
(gdb) s
227
329 p <<= 1;
228
(gdb) s
229
__static_initialization_and_destruction_0 (__initialize_p=1, __priority=-1) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/xypath.cpp:19
230
19 ThreadLocal<XYRasterU8Sparse> tls_raster;
231
(gdb) s
232
fl::ThreadLocalFake<fl::XYRasterU8Sparse>::ThreadLocalFake () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/thread_local.h:21
233
21 ThreadLocalFake() : mValue() {}
234
(gdb) s
235
fl::XYRasterU8Sparse::__base_ctor (this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/raster_sparse.h:40
236
40 XYRasterU8Sparse() = default;
237
(gdb) s
238
fl::HashMap::__base_ctor (max_load=0.699999988, initial_capacity=8, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:55
239
55 _deleted(next_power_of_two(initial_capacity)) {
240
(gdb) s
241
fl::HashMap<fl::vec2<int>, unsigned char, fl::Hash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::next_power_of_two () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:328
242
328 while (p < n)
243
(gdb) s
244
329 p <<= 1;
245
(gdb) s
246
__static_initialization_and_destruction_0 (__initialize_p=1, __priority=-1) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/xypath.cpp:19
247
19 ThreadLocal<XYRasterU8Sparse> tls_raster;
248
(gdb) s
249
fl::ThreadLocalFake<fl::XYRasterU8Sparse>::ThreadLocalFake () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/thread_local.h:21
250
21 ThreadLocalFake() : mValue() {}
251
(gdb) s
252
fl::XYRasterU8Sparse::__base_ctor (this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/raster_sparse.h:40
253
40 XYRasterU8Sparse() = default;
254
(gdb) s
255
fl::HashMap::__base_ctor (max_load=0.699999988, initial_capacity=8, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:55
256
55 _deleted(next_power_of_two(initial_capacity)) {
257
(gdb) s
258
fl::HashMap<fl::vec2<int>, unsigned char, fl::Hash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::next_power_of_two () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:328
259
328 while (p < n)
260
(gdb) s
261
fl::HashMap::__base_ctor (max_load=0.699999988, initial_capacity=8, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:55
262
55 _deleted(next_power_of_two(initial_capacity)) {
263
(gdb) s
264
fl::InlinedVector::__base_ctor (size=8, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:782
265
782 InlinedVector(size_t size) : mUsingHeap(false) {
266
(gdb) s
267
fl::FixedVector<fl::HashMap<fl::vec2<int>, unsigned char, fl::Hash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry, 8u>::FixedVector () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:82
268
82 constexpr FixedVector() : current_size(0) {}
269
(gdb) s 10000
270
126 push_back(T());
271
(gdb) s
272
fl::FixedVector<fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry, 8u>::push_back ()
273
at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:143
274
143 if (current_size < N) {
275
(gdb) s
276
144 void *mem = &memory()[current_size];
277
(gdb) s
278
fl::FixedVector<fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry, 8u>::memory () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:74
279
74 T *memory() { return mMemoryBlock.memory(); }
280
(gdb) s
281
fl::InlinedMemoryBlock<fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry, 8u>::memory ()
282
at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:46
283
46 uintptr_t shift_up =
284
(gdb) s
285
48 MemoryType *raw = begin + shift_up;
286
(gdb) s
287
fl::FixedVector<fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry, 8u>::push_back () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:144
288
144 void *mem = &memory()[current_size];
289
(gdb) s
290
s145 new (mem) T(value);
291
(gdb) s
292
fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry::Entry () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:317
293
317 struct Entry {
294
(gdb) s
295
fl::vec2<int>::vec2 () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/geometry.h:18
296
18 constexpr vec2(const vec2 &p) : x(p.x), y(p.y) {}
297
(gdb) s
298
fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry::Entry () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:317
299
317 struct Entry {
300
(gdb) s
301
fl::HashMap::__base_ctor (max_load=0.699999988, initial_capacity=8, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/hash_map.h:55
302
55 _deleted(next_power_of_two(initial_capacity)) {
303
(gdb) s
304
fl::InlinedVector::__base_ctor (size=8, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:787
305
787 mFixed.resize(size);
306
(gdb) s
307
fl::FixedVector::resize (n=<optimized out>, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:126
308
126 push_back(T());
309
(gdb) s
310
fl::FixedVector<fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry, 8u>::push_back ()
311
at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:146
312
146 ++current_size;
313
(gdb) s
314
fl::FixedVector::resize (n=<optimized out>, this=<optimized out>) at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:125
315
125 while (current_size < n) {
316
(gdb) s
317
126 push_back(T());
318
(gdb) s
319
fl::FixedVector<fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry, 8u>::push_back ()
320
at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:143
321
143 if (current_size < N) {
322
(gdb) s
323
144 void *mem = &memory()[current_size];
324
(gdb) s
325
fl::FixedVector<fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry, 8u>::memory () at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:74
326
74 T *memory() { return mMemoryBlock.memory(); }
327
(gdb) s
328
fl::InlinedMemoryBlock<fl::HashMap<fl::vec2<int>, unsigned char*, fl::FastHash<fl::vec2<int> >, fl::EqualTo<fl::vec2<int> >, 8>::Entry, 8u>::memory ()
329
at /tmp/hexi-arduino:avr:nano/libraries/FastLED/src/fl/vector.h:46
330
46 uintptr_t shift_up =