Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdbserver hangs on ARC HS3x/4x Linux targets #213

Open
kolerov opened this issue Jun 28, 2024 · 1 comment
Open

gdbserver hangs on ARC HS3x/4x Linux targets #213

kolerov opened this issue Jun 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kolerov
Copy link
Contributor

kolerov commented Jun 28, 2024

A sample program:

#include <stdio.h>

int main()
{
        printf("Hello, World!\n");
        return 0;
}

First, build Linux image using Buildroot, arc-2023.09 branch (don't forget to select building GDB in toolchain's configuration and then gdbserver package itself). I did it in build-hs4x-glibc subdirectory of Buildroot source tree. Then run Linux image using QEMU:

qemu-system-arc -M virt -cpu archs -m 2G -kernel images/vmlinux \
                -display none -nographic -monitor none \
                -device virtio-rng-pci \
                -netdev user,id=net0,hostfwd=tcp::2022-:22,hostfwd=tcp::12345-:12345 \
                -device virtio-net-device,netdev=net0

Run gdbserver on target:

# gdbserver :12345 main-hs4x-glibc

Run GDB:

$ ./build-hs4x-glibc/host/bin/arc-buildroot-linux-gnu-gdb -q \
        -ex "set sysroot build-hs4x-glibc/host/arc-buildroot-linux-gnu/sysroot" \
        -ex "target remote :12345" \
        overlay/root/main-hs4x-glibc
Reading symbols from overlay/root/main-hs4x-glibc...
Remote debugging using :12345
Reading symbols from build-hs4x-glibc/host/arc-buildroot-linux-gnu/sysroot/lib/ld-linux-arc.so.2...
0x2000d47c in __start () from build-hs4x-glibc/host/arc-buildroot-linux-gnu/sysroot/lib/ld-linux-arc.so.2
(gdb) b main
Breakpoint 1 at 0x40000540: file main.c, line 5.
(gdb) c
Continuing.

gdbserver output:

Process /root/main-hs4x-glibc created; pid = 96
Listening on port 12345
Remote debugging from host 10.0.2.2, port 34430

Then nothing happens. Sometimes that issue does not happen, but in most cases it does. The same issue does not happen on ARCv3 targets.

@kolerov kolerov added the bug Something isn't working label Jun 28, 2024
@kolerov
Copy link
Contributor Author

kolerov commented Jul 11, 2024

Cannot reproduce this issue when building an image using a prebuilt 2024.06 toolchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant