问题
I'm trying to connect gdb
to a running simulavr
session. The commands used are:
simulavr -d atmega328 -f tiny.elf -B main -g
after which I get the message:
Waiting on port 1212 for gdb client to connect...
On sending ^C, I get:
^CSystemClock::Endless stopped
number of cpu cycles simulated: 909726536
which seems to be encouraging. When I try to connect to that session using gdb
I get:
(gdb) file tiny.elf
Reading symbols from tiny.elf...done.
(gdb) target remote localhost:1212
localhost:1212: Connection timed out. (This is after about 2')
Monitoring localhost
, I see connection requests (SYN
) being sent, but no reply from simulavr
Not sure if this is supposed to work, but I also tried to connect to simulavr
with netcat
- no luck either.
Anyone with ideas how to debug/solve this? Could this be a problem of the firewall?
EDIT: ifconfig lo
show activity though:
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 25540 bytes 2149477 (2.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 25540 bytes 2149477 (2.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Also, 127.0.0.1 is defined in /etc/hosts
EDIT2: This is the output of iptables -L -n
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT all -- 10.0.0.2 0.0.0.0/0
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:631
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3000
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
来源:https://stackoverflow.com/questions/51317961/no-connection-between-simulavr-and-gdb