Gentoo и crossdev - пролбема с удалённой отладкой

 , ,



Пытаюсь разобраться с кросскомпиляцией и удалённой отладкой на Gentoo.

Поставил crossdev, сконфигурировал тулчейн:
crossdev --ex-gdb -t arm-unknown-linux-gnueabihf

И на тестовом примере получается какая-то хрень:

user@japet ~/Temp/2 $ cat ./test1.c 

#include <stdio.h>

int main( int argc, char** argv ){
        printf("Hello World!\n");
        return 0;
user@japet ~/Temp/2 $ arm-unknown-linux-gnueabihf-gcc -g -o ./test1 ./test1.c 
user@japet ~/Temp/2 $ ls -l ./test1
-rwxr-xr-x 1 user user 6028 апр 21 06:20 ./test1
user@japet ~/Temp/2 $ scp -P 2200 test1 pi@rpi:/home/pi/tmp
test1                                                                                                            100% 6028     1.4MB/s   5.9KB/s   00:00    
user@japet ~/Temp/2 $ arm-unknown-linux-gnueabihf-gdb ./test1             
GNU gdb (Gentoo 7.12.1 vanilla) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=arm-unknown-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
 — — Loading Rust pretty-printers — — 
Reading symbols from ./test1...done.
(gdb) target remote rpi:2345
Remote debugging using rpi:2345
warning: Can not parse XML target description; XML support was disabled at compile time
Reading symbols from /usr/arm-unknown-linux-gnueabihf/lib/ debugging symbols found)...done.
Remote 'g' packet reply is too long: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030f3ffbe0000000040fdfcb610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0xb6fcfd40 in ?? () from /usr/arm-unknown-linux-gnueabihf/lib/
(gdb) list
1       /*
2        * 
3        */
5       #include <stdio.h>
7       int main( int argc, char** argv ){
8               printf("Hello World!\n");
9               return 0;
10      }
(gdb) break main
Breakpoint 1 at 0x10414: file ./test1.c, line 8.
(gdb) cont

Breakpoint 1, main (
    argc=<error reading variable: Remote 'g' packet reply is too long: 0100000034f3ffbe3cf3ffbe000401000000000000000000d002010000000000000000000000000000f0ffb6dcf1ffbe0030fab6d0f1ffbe94e2e7b61404010010000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>, argv=0xbefff334) at ./test1.c:8
8               printf("Hello World!\n");
(gdb) next
main (argc=1, argv=0xbefff334) at ./test1.c:8
8               printf("Hello World!\n");
Remote 'g' packet reply is too long: 0100000034f3ffbe3cf3ffbe000401000000000000000000d002010000000000000000000000000000f0ffb6dcf1ffbe0030fab6d0f1ffbe94e2e7b61404010010000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
(gdb) cont
(gdb) quit
A debugging session is active.

        Inferior 1 [process 7611] will be killed.

Quit anyway? (y or n) yes

Откуда вот этот «Remote 'g' packet reply is too long»?
И почему '(gdb) cont' не отрабатывает в конце, а зависает и приходиться обламывать по Ctrl+C?

На удалённой машине вообще ничего:
pi@raspberrypi:~/tmp $ ls -l
total 8
-rwxr-xr-x 1 pi pi 6028 Apr 21 06:22 test1
pi@raspberrypi:~/tmp $ gdbserver :2345 ./test1 
Process ./test1 created; pid = 7611
Listening on port 2345
Remote debugging from host
GDBserver exiting


Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.