Re: PR13984 - gdb stops controlling a thread after "Remote 'g' packet reply is too long: ..." error message

Orgad Shaneh
2016-04-13T20:52:59Z

[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]

On Wed, Apr 13, 2016 at 11:27 PM, Pedro Alves <palves@redhat.com> wrote:
> On 04/13/2016 09:07 PM, Orgad Shaneh wrote:
>> On Wed, Apr 13, 2016 at 10:11 PM, Luis Machado
>> <lgustavo@codesourcery.com> wrote:
>>>
>>> On 04/13/2016 12:43 AM, Orgad Shaneh wrote:
>>>>>>
>>>>>> I got this message when I tried to remotely debug a
>>>>>> mips64-octeon-linux gdbserver 6.8 with GDB >= 7.5.
>>>>>>
>>>>>> GDB <= 7.4.1 works well, but with 7.5 and up I receive this message
>>>>>> and the debugger stops functioning.
>>>>>>
>>>>>
>>>>> I suppose GDB 7.5 is slightly incompatible with older gdbserver versions.
>>>>>
>>>>> What kind of target description does gdbserver return in this case (set
>>>>> debug remote 1)?
>>>>
>>>>
>>>> Full log attached. Thanks for your help.
>>>>
>>>> - Orgad
>>>>
>>>
>>> Strange. If this is gdbserver 6.8, it should've replied to the qSupported packet? That one was added in 6.6.
>>
>>
>> Hi,
>>
>> Sorry, my fault. The gdbserver is GNU gdb 6.5 Cavium Networks Version:
>> 1_7_0, build 45
>>
>> gdbserver 6.8 is in Cavium SDK2. I don't know if it works with recent GDB.
>>
>
> So there's no xml target description involved? It sounds like
> either the default layout or some of the mips_register_g_packet_guesses
> guesses is taking effect then.
>
> If the size of the register file gdbserver is sending is larger than
> what gdb is expecting, then it's possible to register offsets
> are mismatched as well.
>
> Figure out what set of registers gdbserver is sending, and compare to
> "maint print remote-registers", after connecting. What's the mismatch?

See the attached files.

gdb-local-6.5 is a local execution of gdb on the target machine.
gdb-remote-7.4 is the output of 7.4 official version (without Cavium
patches), which works.
gdb-remote-7.6 is the output of 7.6 Cavium version, which doesn't.

[-- Attachment #2: gdb-local-6.5.txt --]
[-- Type: text/plain, Size: 8928 bytes --]

(gdb) main print registers
Name Nr Rel Offset Size Type
'' 0 0 0 8 int64_t
'' 1 1 8 8 int64_t
'' 2 2 16 8 int64_t
'' 3 3 24 8 int64_t
'' 4 4 32 8 int64_t
'' 5 5 40 8 int64_t
'' 6 6 48 8 int64_t
'' 7 7 56 8 int64_t
'' 8 8 64 8 int64_t
'' 9 9 72 8 int64_t
'' 10 10 80 8 int64_t
'' 11 11 88 8 int64_t
'' 12 12 96 8 int64_t
'' 13 13 104 8 int64_t
'' 14 14 112 8 int64_t
'' 15 15 120 8 int64_t
'' 16 16 128 8 int64_t
'' 17 17 136 8 int64_t
'' 18 18 144 8 int64_t
'' 19 19 152 8 int64_t
'' 20 20 160 8 int64_t
'' 21 21 168 8 int64_t
'' 22 22 176 8 int64_t
'' 23 23 184 8 int64_t
'' 24 24 192 8 int64_t
'' 25 25 200 8 int64_t
'' 26 26 208 8 int64_t
'' 27 27 216 8 int64_t
'' 28 28 224 8 int64_t
'' 29 29 232 8 int64_t
'' 30 30 240 8 int64_t
'' 31 31 248 8 int64_t
'' 32 32 256 8 int64_t
'' 33 33 264 8 int64_t
'' 34 34 272 8 int64_t
'' 35 35 280 8 int64_t
'' 36 36 288 8 int64_t
'' 37 37 296 8 int64_t
'' 38 38 304 8 _ieee_double_big
'' 39 39 312 8 _ieee_double_big
'' 40 40 320 8 _ieee_double_big
'' 41 41 328 8 _ieee_double_big
'' 42 42 336 8 _ieee_double_big
'' 43 43 344 8 _ieee_double_big
'' 44 44 352 8 _ieee_double_big
'' 45 45 360 8 _ieee_double_big
'' 46 46 368 8 _ieee_double_big
'' 47 47 376 8 _ieee_double_big
'' 48 48 384 8 _ieee_double_big
'' 49 49 392 8 _ieee_double_big
'' 50 50 400 8 _ieee_double_big
'' 51 51 408 8 _ieee_double_big
'' 52 52 416 8 _ieee_double_big
'' 53 53 424 8 _ieee_double_big
'' 54 54 432 8 _ieee_double_big
'' 55 55 440 8 _ieee_double_big
'' 56 56 448 8 _ieee_double_big
'' 57 57 456 8 _ieee_double_big
'' 58 58 464 8 _ieee_double_big
'' 59 59 472 8 _ieee_double_big
'' 60 60 480 8 _ieee_double_big
'' 61 61 488 8 _ieee_double_big
'' 62 62 496 8 _ieee_double_big
'' 63 63 504 8 _ieee_double_big
'' 64 64 512 8 _ieee_double_big
'' 65 65 520 8 _ieee_double_big
'' 66 66 528 8 _ieee_double_big
'' 67 67 536 8 _ieee_double_big
'' 68 68 544 8 _ieee_double_big
'' 69 69 552 8 _ieee_double_big
'' 70 70 560 8 int64_t
'' 71 71 568 8 int64_t
'' 72 72 576 8 int64_t
'' 73 73 584 8 int64_t
'' 74 74 592 8 int64_t
'' 75 75 600 8 int64_t
'' 76 76 608 8 int64_t
'' 77 77 616 8 int64_t
'' 78 78 624 8 int64_t
'' 79 79 632 8 int64_t
'' 80 80 640 8 int64_t
'' 81 81 648 8 int64_t
'' 82 82 656 8 int64_t
'' 83 83 664 8 int64_t
'' 84 84 672 8 int64_t
'' 85 85 680 8 int64_t
'' 86 86 688 8 int64_t
'' 87 87 696 8 int64_t
'' 88 88 704 8 int64_t
'' 89 89 712 8 int64_t
zero 90 0 720 8 int64_t
at 91 1 728 8 int64_t
v0 92 2 736 8 int64_t
v1 93 3 744 8 int64_t
a0 94 4 752 8 int64_t
a1 95 5 760 8 int64_t
a2 96 6 768 8 int64_t
a3 97 7 776 8 int64_t
a4 98 8 784 8 int64_t
a5 99 9 792 8 int64_t
a6 100 10 800 8 int64_t
a7 101 11 808 8 int64_t
t0 102 12 816 8 int64_t
t1 103 13 824 8 int64_t
t2 104 14 832 8 int64_t
t3 105 15 840 8 int64_t
s0 106 16 848 8 int64_t
s1 107 17 856 8 int64_t
s2 108 18 864 8 int64_t
s3 109 19 872 8 int64_t
s4 110 20 880 8 int64_t
s5 111 21 888 8 int64_t
s6 112 22 896 8 int64_t
s7 113 23 904 8 int64_t
t8 114 24 912 8 int64_t
t9 115 25 920 8 int64_t
k0 116 26 928 8 int64_t
k1 117 27 936 8 int64_t
gp 118 28 944 8 int64_t
sp 119 29 952 8 int64_t
s8 120 30 960 8 int64_t
ra 121 31 968 8 int64_t
sr 122 32 976 8 int64_t
lo 123 33 984 8 int64_t
hi 124 34 992 8 int64_t
bad 125 35 1000 8 int64_t
cause 126 36 1008 8 int64_t
pc 127 37 1016 8 int64_t
'' 128 38 1024 8 _ieee_double_big
'' 129 39 1032 8 _ieee_double_big
'' 130 40 1040 8 _ieee_double_big
'' 131 41 1048 8 _ieee_double_big
'' 132 42 1056 8 _ieee_double_big
'' 133 43 1064 8 _ieee_double_big
'' 134 44 1072 8 _ieee_double_big
'' 135 45 1080 8 _ieee_double_big
'' 136 46 1088 8 _ieee_double_big
'' 137 47 1096 8 _ieee_double_big
'' 138 48 1104 8 _ieee_double_big
'' 139 49 1112 8 _ieee_double_big
'' 140 50 1120 8 _ieee_double_big
'' 141 51 1128 8 _ieee_double_big
'' 142 52 1136 8 _ieee_double_big
'' 143 53 1144 8 _ieee_double_big
'' 144 54 1152 8 _ieee_double_big
'' 145 55 1160 8 _ieee_double_big
'' 146 56 1168 8 _ieee_double_big
'' 147 57 1176 8 _ieee_double_big
'' 148 58 1184 8 _ieee_double_big
'' 149 59 1192 8 _ieee_double_big
'' 150 60 1200 8 _ieee_double_big
'' 151 61 1208 8 _ieee_double_big
'' 152 62 1216 8 _ieee_double_big
'' 153 63 1224 8 _ieee_double_big
'' 154 64 1232 8 _ieee_double_big
'' 155 65 1240 8 _ieee_double_big
'' 156 66 1248 8 _ieee_double_big
'' 157 67 1256 8 _ieee_double_big
'' 158 68 1264 8 _ieee_double_big
'' 159 69 1272 8 _ieee_double_big
'' 160 70 1280 4 int32_t
'' 161 71 1284 4 int32_t
'' 162 72 1288 4 int32_t
'' 163 73 1292 4 int32_t
'' 164 74 1296 4 int32_t
'' 165 75 1300 4 int32_t
'' 166 76 1304 4 int32_t
'' 167 77 1308 4 int32_t
'' 168 78 1312 4 int32_t
'' 169 79 1316 4 int32_t
'' 170 80 1320 4 int32_t
'' 171 81 1324 4 int32_t
'' 172 82 1328 4 int32_t
'' 173 83 1332 4 int32_t
'' 174 84 1336 4 int32_t
'' 175 85 1340 4 int32_t
'' 176 86 1344 4 int32_t
'' 177 87 1348 4 int32_t
'' 178 88 1352 4 int32_t
'' 179 89 1356 4 int32_t

[-- Attachment #3: gdb-remote-7.4.txt --]
[-- Type: text/plain, Size: 10875 bytes --]

(gdb) main print remote-registers
Name Nr Rel Offset Size Type Rmt Nr g/G Offset
'' 0 0 0 8 int64_t 0 0
'' 1 1 8 8 int64_t 1 8
'' 2 2 16 8 int64_t 2 16
'' 3 3 24 8 int64_t 3 24
'' 4 4 32 8 int64_t 4 32
'' 5 5 40 8 int64_t 5 40
'' 6 6 48 8 int64_t 6 48
'' 7 7 56 8 int64_t 7 56
'' 8 8 64 8 int64_t 8 64
'' 9 9 72 8 int64_t 9 72
'' 10 10 80 8 int64_t 10 80
'' 11 11 88 8 int64_t 11 88
'' 12 12 96 8 int64_t 12 96
'' 13 13 104 8 int64_t 13 104
'' 14 14 112 8 int64_t 14 112
'' 15 15 120 8 int64_t 15 120
'' 16 16 128 8 int64_t 16 128
'' 17 17 136 8 int64_t 17 136
'' 18 18 144 8 int64_t 18 144
'' 19 19 152 8 int64_t 19 152
'' 20 20 160 8 int64_t 20 160
'' 21 21 168 8 int64_t 21 168
'' 22 22 176 8 int64_t 22 176
'' 23 23 184 8 int64_t 23 184
'' 24 24 192 8 int64_t 24 192
'' 25 25 200 8 int64_t 25 200
'' 26 26 208 8 int64_t 26 208
'' 27 27 216 8 int64_t 27 216
'' 28 28 224 8 int64_t 28 224
'' 29 29 232 8 int64_t 29 232
'' 30 30 240 8 int64_t 30 240
'' 31 31 248 8 int64_t 31 248
'' 32 32 256 8 int64_t 32 256
'' 33 33 264 8 int64_t 33 264
'' 34 34 272 8 int64_t 34 272
'' 35 35 280 8 int64_t 35 280
'' 36 36 288 8 int64_t 36 288
'' 37 37 296 8 int64_t 37 296
'' 38 38 304 8 double 38 304
'' 39 39 312 8 double 39 312
'' 40 40 320 8 double 40 320
'' 41 41 328 8 double 41 328
'' 42 42 336 8 double 42 336
'' 43 43 344 8 double 43 344
'' 44 44 352 8 double 44 352
'' 45 45 360 8 double 45 360
'' 46 46 368 8 double 46 368
'' 47 47 376 8 double 47 376
'' 48 48 384 8 double 48 384
'' 49 49 392 8 double 49 392
'' 50 50 400 8 double 50 400
'' 51 51 408 8 double 51 408
'' 52 52 416 8 double 52 416
'' 53 53 424 8 double 53 424
'' 54 54 432 8 double 54 432
'' 55 55 440 8 double 55 440
'' 56 56 448 8 double 56 448
'' 57 57 456 8 double 57 456
'' 58 58 464 8 double 58 464
'' 59 59 472 8 double 59 472
'' 60 60 480 8 double 60 480
'' 61 61 488 8 double 61 488
'' 62 62 496 8 double 62 496
'' 63 63 504 8 double 63 504
'' 64 64 512 8 double 64 512
'' 65 65 520 8 double 65 520
'' 66 66 528 8 double 66 528
'' 67 67 536 8 double 67 536
'' 68 68 544 8 double 68 544
'' 69 69 552 8 double 69 552
'' 70 70 560 8 int64_t 70 560
'' 71 71 568 8 int64_t 71 568
'' 72 72 576 8 int64_t 72 576
'' 73 73 584 8 int64_t 73 584
'' 74 74 592 8 int64_t 74 592
'' 75 75 600 8 int64_t 75 600
'' 76 76 608 8 int64_t 76 608
'' 77 77 616 8 int64_t 77 616
'' 78 78 624 8 int64_t 78 624
'' 79 79 632 8 int64_t 79 632
'' 80 80 640 8 int64_t 80 640
'' 81 81 648 8 int64_t 81 648
'' 82 82 656 8 int64_t 82 656
'' 83 83 664 8 int64_t 83 664
'' 84 84 672 8 int64_t 84 672
'' 85 85 680 8 int64_t 85 680
'' 86 86 688 8 int64_t 86 688
'' 87 87 696 8 int64_t 87 696
'' 88 88 704 8 int64_t 88 704
'' 89 89 712 8 int64_t 89 712
zero 90 0 720 8 int64_t
at 91 1 728 8 int64_t
v0 92 2 736 8 int64_t
v1 93 3 744 8 int64_t
a0 94 4 752 8 int64_t
a1 95 5 760 8 int64_t
a2 96 6 768 8 int64_t
a3 97 7 776 8 int64_t
a4 98 8 784 8 int64_t
a5 99 9 792 8 int64_t
a6 100 10 800 8 int64_t
a7 101 11 808 8 int64_t
t0 102 12 816 8 int64_t
t1 103 13 824 8 int64_t
t2 104 14 832 8 int64_t
t3 105 15 840 8 int64_t
s0 106 16 848 8 int64_t
s1 107 17 856 8 int64_t
s2 108 18 864 8 int64_t
s3 109 19 872 8 int64_t
s4 110 20 880 8 int64_t
s5 111 21 888 8 int64_t
s6 112 22 896 8 int64_t
s7 113 23 904 8 int64_t
t8 114 24 912 8 int64_t
t9 115 25 920 8 int64_t
k0 116 26 928 8 int64_t
k1 117 27 936 8 int64_t
gp 118 28 944 8 int64_t
sp 119 29 952 8 int64_t
s8 120 30 960 8 int64_t
ra 121 31 968 8 int64_t
sr 122 32 976 8 int64_t
lo 123 33 984 8 int64_t
hi 124 34 992 8 int64_t
bad 125 35 1000 8 int64_t
cause 126 36 1008 8 int64_t
pc 127 37 1016 8 int64_t
f0 128 38 1024 8 double
f1 129 39 1032 8 double
f2 130 40 1040 8 double
f3 131 41 1048 8 double
f4 132 42 1056 8 double
f5 133 43 1064 8 double
f6 134 44 1072 8 double
f7 135 45 1080 8 double
f8 136 46 1088 8 double
f9 137 47 1096 8 double
f10 138 48 1104 8 double
f11 139 49 1112 8 double
f12 140 50 1120 8 double
f13 141 51 1128 8 double
f14 142 52 1136 8 double
f15 143 53 1144 8 double
f16 144 54 1152 8 double
f17 145 55 1160 8 double
f18 146 56 1168 8 double
f19 147 57 1176 8 double
f20 148 58 1184 8 double
f21 149 59 1192 8 double
f22 150 60 1200 8 double
f23 151 61 1208 8 double
f24 152 62 1216 8 double
f25 153 63 1224 8 double
f26 154 64 1232 8 double
f27 155 65 1240 8 double
f28 156 66 1248 8 double
f29 157 67 1256 8 double
f30 158 68 1264 8 double
f31 159 69 1272 8 double
fsr 160 70 1280 4 int32_t
fir 161 71 1284 4 int32_t
'' 162 72 1288 4 int32_t
'' 163 73 1292 4 int32_t
'' 164 74 1296 4 int32_t
'' 165 75 1300 4 int32_t
'' 166 76 1304 4 int32_t
'' 167 77 1308 4 int32_t
'' 168 78 1312 4 int32_t
'' 169 79 1316 4 int32_t
'' 170 80 1320 4 int32_t
'' 171 81 1324 4 int32_t
'' 172 82 1328 4 int32_t
'' 173 83 1332 4 int32_t
'' 174 84 1336 4 int32_t
'' 175 85 1340 4 int32_t
'' 176 86 1344 4 int32_t
'' 177 87 1348 4 int32_t
'' 178 88 1352 4 int32_t
'' 179 89 1356 4 int32_t

[-- Attachment #4: gdb-remote-7.6.txt --]
[-- Type: text/plain, Size: 9555 bytes --]

(gdb) main print remote-registers
Name Nr Rel Offset Size Type Rmt Nr g/G Offset
'' 0 0 0 8 int64_t 0 0
'' 1 1 8 8 int64_t 1 8
'' 2 2 16 8 int64_t 2 16
'' 3 3 24 8 int64_t 3 24
'' 4 4 32 8 int64_t 4 32
'' 5 5 40 8 int64_t 5 40
'' 6 6 48 8 int64_t 6 48
'' 7 7 56 8 int64_t 7 56
'' 8 8 64 8 int64_t 8 64
'' 9 9 72 8 int64_t 9 72
'' 10 10 80 8 int64_t 10 80
'' 11 11 88 8 int64_t 11 88
'' 12 12 96 8 int64_t 12 96
'' 13 13 104 8 int64_t 13 104
'' 14 14 112 8 int64_t 14 112
'' 15 15 120 8 int64_t 15 120
'' 16 16 128 8 int64_t 16 128
'' 17 17 136 8 int64_t 17 136
'' 18 18 144 8 int64_t 18 144
'' 19 19 152 8 int64_t 19 152
'' 20 20 160 8 int64_t 20 160
'' 21 21 168 8 int64_t 21 168
'' 22 22 176 8 int64_t 22 176
'' 23 23 184 8 int64_t 23 184
'' 24 24 192 8 int64_t 24 192
'' 25 25 200 8 int64_t 25 200
'' 26 26 208 8 int64_t 26 208
'' 27 27 216 8 int64_t 27 216
'' 28 28 224 8 int64_t 28 224
'' 29 29 232 8 int64_t 29 232
'' 30 30 240 8 int64_t 30 240
'' 31 31 248 8 int64_t 31 248
'' 32 32 256 8 int64_t 32 256
'' 33 33 264 8 int64_t 33 264
'' 34 34 272 8 int64_t 34 272
'' 35 35 280 8 int64_t 35 280
'' 36 36 288 8 int64_t 36 288
'' 37 37 296 8 int64_t 37 296
'' 38 38 304 8 double 38 304
'' 39 39 312 8 double 39 312
'' 40 40 320 8 double 40 320
'' 41 41 328 8 double 41 328
'' 42 42 336 8 double 42 336
'' 43 43 344 8 double 43 344
'' 44 44 352 8 double 44 352
'' 45 45 360 8 double 45 360
'' 46 46 368 8 double 46 368
'' 47 47 376 8 double 47 376
'' 48 48 384 8 double 48 384
'' 49 49 392 8 double 49 392
'' 50 50 400 8 double 50 400
'' 51 51 408 8 double 51 408
'' 52 52 416 8 double 52 416
'' 53 53 424 8 double 53 424
'' 54 54 432 8 double 54 432
'' 55 55 440 8 double 55 440
'' 56 56 448 8 double 56 448
'' 57 57 456 8 double 57 456
'' 58 58 464 8 double 58 464
'' 59 59 472 8 double 59 472
'' 60 60 480 8 double 60 480
'' 61 61 488 8 double 61 488
'' 62 62 496 8 double 62 496
'' 63 63 504 8 double 63 504
'' 64 64 512 8 double 64 512
'' 65 65 520 8 double 65 520
'' 66 66 528 8 double 66 528
'' 67 67 536 8 double 67 536
'' 68 68 544 8 double 68 544
'' 69 69 552 8 double 69 552
'' 70 70 560 8 int64_t 70 560
'' 71 71 568 8 int64_t 71 568
'' 72 72 576 8 int64_t 72 576
'' 73 73 584 8 int64_t 73 584
'' 74 74 592 8 int64_t 74 592
'' 75 75 600 8 int64_t 75 600
'' 76 76 608 8 int64_t 76 608
'' 77 77 616 8 int64_t 77 616
'' 78 78 624 8 int64_t 78 624
zero 79 0 632 8 int64_t
at 80 1 640 8 int64_t
v0 81 2 648 8 int64_t
v1 82 3 656 8 int64_t
a0 83 4 664 8 int64_t
a1 84 5 672 8 int64_t
a2 85 6 680 8 int64_t
a3 86 7 688 8 int64_t
a4 87 8 696 8 int64_t
a5 88 9 704 8 int64_t
a6 89 10 712 8 int64_t
a7 90 11 720 8 int64_t
t0 91 12 728 8 int64_t
t1 92 13 736 8 int64_t
t2 93 14 744 8 int64_t
t3 94 15 752 8 int64_t
s0 95 16 760 8 int64_t
s1 96 17 768 8 int64_t
s2 97 18 776 8 int64_t
s3 98 19 784 8 int64_t
s4 99 20 792 8 int64_t
s5 100 21 800 8 int64_t
s6 101 22 808 8 int64_t
s7 102 23 816 8 int64_t
t8 103 24 824 8 int64_t
t9 104 25 832 8 int64_t
k0 105 26 840 8 int64_t
k1 106 27 848 8 int64_t
gp 107 28 856 8 int64_t
sp 108 29 864 8 int64_t
s8 109 30 872 8 int64_t
ra 110 31 880 8 int64_t
sr 111 32 888 8 int64_t
lo 112 33 896 8 int64_t
hi 113 34 904 8 int64_t
bad 114 35 912 8 int64_t
cause 115 36 920 8 int64_t
pc 116 37 928 8 int64_t
f0 117 38 936 8 double
f1 118 39 944 8 double
f2 119 40 952 8 double
f3 120 41 960 8 double
f4 121 42 968 8 double
f5 122 43 976 8 double
f6 123 44 984 8 double
f7 124 45 992 8 double
f8 125 46 1000 8 double
f9 126 47 1008 8 double
f10 127 48 1016 8 double
f11 128 49 1024 8 double
f12 129 50 1032 8 double
f13 130 51 1040 8 double
f14 131 52 1048 8 double
f15 132 53 1056 8 double
f16 133 54 1064 8 double
f17 134 55 1072 8 double
f18 135 56 1080 8 double
f19 136 57 1088 8 double
f20 137 58 1096 8 double
f21 138 59 1104 8 double
f22 139 60 1112 8 double
f23 140 61 1120 8 double
f24 141 62 1128 8 double
f25 142 63 1136 8 double
f26 143 64 1144 8 double
f27 144 65 1152 8 double
f28 145 66 1160 8 double
f29 146 67 1168 8 double
f30 147 68 1176 8 double
f31 148 69 1184 8 double
fsr 149 70 1192 4 int32_t
fir 150 71 1196 4 int32_t
'' 151 72 1200 8 int64_t
'' 152 73 1208 8 int64_t
'' 153 74 1216 8 int64_t
'' 154 75 1224 8 int64_t
'' 155 76 1232 8 int64_t
'' 156 77 1240 8 int64_t
'' 157 78 1248 8 int64_t