Remote-gdb to debug hostapd process on target, rpi 4b

i tried using remote-gdb to debug hostapd process on target, rpi 4b.
it can not work. please check the below log.

./scripts/remote-gdb 192.168.1.19:5566 ./staging_dir/target-aarch64_cortex-a72_musl/root-bcm27xx/usr/sbin/hostapd
Using target aarch64_cortex-a72 (musl, )
GNU gdb (GDB) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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=aarch64-openwrt-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./staging_dir/target-aarch64_cortex-a72_musl/root-bcm27xx/usr/sbin/hostapd...
epoll_pwait (fd=<optimized out>, ev=0x7fb6f10c80, cnt=9, to=9999, sigs=0x0) at src/linux/epoll.c:31
31		return __syscall_ret(r);
(gdb) break main
Breakpoint 1 at 0x6960
(gdb) continue
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x6960

Command aborted.
(gdb)

gdb show it has some problem at memory address where i insert breakpoint.

i wrote a simple to do same remote debug. but, it is work. please check the below log.

./scripts/remote-gdb 192.168.1.19:5566 ./staging_dir/target-aarch64_cortex-a72_musl/root-bcm27xx/bin/test
Using target aarch64_cortex-a72 (musl, )
GNU gdb (GDB) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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=aarch64-openwrt-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./staging_dir/target-aarch64_cortex-a72_musl/root-bcm27xx/bin/test...
__syscall3 (c=<optimized out>, b=<optimized out>, a=<optimized out>, n=<optimized out>) at ./arch/aarch64/syscall_arch.h:38
38		__asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2));
(gdb) break main
Breakpoint 1 at 0x400680: file /openwrt/build_dir/target-aarch64_cortex-a72_musl/test/test.c, line 15.
(gdb) continue
Continuing.

i have two questions:

  1. i think the problem is memory address, 0x6960 and 0x400680.
    what is correct process memory layout on aarch64_cortex-a72?
    where can i find this information?

  2. why is it very different process memory layout between hostapd program and own sample code?

thanks.