Re: Stepping of multithreaded application

Tomas Martinec
2011-05-11T06:06:26Z

> Can you paste the relevant logs again, but with "set debug infrun 1"
> enabled in addition to "set debug remote 1" ? It's probably possible to
> infer what's going on from the remote log alone, but the infrun
> log should make it easier.

Here is the log with the infrun debug. I cannot see much from it on
the first sight.

-exec-next --thread 3 1
&"Sending packet: $Hg3#e2..."
&"Ack\n"
&"Packet received: OK\n"
&"Sending packet: $g#67..."
&"Ack\n"
&"Packet received:
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000200000000000080d8060080000000004c030080040040000000000000000000000000000000000054260080\n"
&"infrun: clear_proceed_status_thread (Thread 3)\n"
&"infrun: clear_proceed_status_thread (Thread 2)\n"
&"infrun: clear_proceed_status_thread (Thread 1)\n"
&"infrun: proceed (addr=0xffffffff, signal=144, step=1)\n"
&"Sending packet: $Hg1#e0..."
&"Ack\n"
&"Packet received: OK\n"
&"Sending packet: $g#67..."
&"Ack\n"
&"Packet received:
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000080d8040080d804008038030080040040000000000000000000000000000000000040250080\n"
&"Sending packet: $g#67..."
&"Ack\n"
&"Packet received:
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000080d8040080d804008038030080040040000000000000000000000000000000000040250080\n"
&"infrun: resume (step=1, signal=0), trap_expected=1\n"
&"Sending packet: $Hc1#dc..."
&"Ack\n"
&"Packet received: OK\n"
&"Sending packet: $s#73..."
&"Ack\n"
^running
*running,thread-id="1"
(gdb)
&"infrun: wait_for_inferior (treat_exec_as_sigtrap=0)\n"
&"Packet received: T05thread:00000001;25:44250080;\n"
&"infrun: target_wait (-1, status) =\ninfrun: 42000 [Thread
1],\ninfrun: status->kind = stopped, signal = SIGTRAP\n"
&"infrun: infwait_normal_state\n"
&"infrun: TARGET_WAITKIND_STOPPED\n"
&"infrun: stop_pc = 0x80002544\n"
&"infrun: handling deferred step\n"
&"Sending packet: $Hg3#e2..."
&"Ack\n"
&"Packet received: OK\n"
&"Sending packet: $g#67..."
&"Ack\n"
&"Packet received:
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000200000000000080d8060080000000004c030080040040000000000000000000000000000000000058260080\n"
&"infrun: resume (step=1, signal=0), trap_expected=0\n"
&"Sending packet: $Hc0#db..."
&"Ack\n"
&"Packet received: \n"
&"Sending packet: $s#73..."
&"Ack\n"
*running,thread-id="all"
&"infrun: prepare_to_wait\n"
&"Packet received: T05thread:00000001;25:48250080;\n"
&"infrun: target_wait (-1, status) =\ninfrun: 42000 [Thread
1],\ninfrun: status->kind = stopped, signal = SIGTRAP\n"
&"infrun: infwait_normal_state\n"
&"infrun: TARGET_WAITKIND_STOPPED\n"
&"infrun: stop_pc = 0x80002548\n"
&"infrun: context switch\n"
&"infrun: Switching context from Thread 3 to Thread 1\n"
&"Sending packet: $g#67..."
&"Ack\n"
&"Packet received:
0000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000080d8040080d80400804c250080040040000000000000000000000000000000000048250080\n"
&"Sending packet: $T3#87..."
&"Ack\n"
&"Packet received: OK\n"
&"infrun: switching back to stepped thread\n"
&"infrun: Switching context from Thread 1 to Thread 3\n"
&"Sending packet: $Hg3#e2..."
&"Ack\n"
&"Packet received: OK\n"
&"Sending packet: $g#67..."
&"Ack\n"
&"Packet received:
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000200000000000080d8060080d80600804c03008004004000000000000000000000000000000000005c260080\n"
&"Sending packet: $Hg1#e0..."
&"Ack\n"
&"Packet received: OK\n"
&"Sending packet: $g#67..."
&"Ack\n"
&"Packet received:
0000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000080d8040080d80400804c250080040040000000000000000000000000000000000048250080\n"
&"Sending packet: $Z0,80002540,4#a9..."
&"Ack\n"
&"Packet received: OK\n"
&"Sending packet: $Hg3#e2..."
&"Ack\n"
&"Packet received: OK\n"
&"Sending packet: $g#67..."
&"Ack\n"
&"Packet received:
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000200000000000080d8060080d80600804c03008004004000000000000000000000000000000000005c260080\n"
&"infrun: resume (step=1, signal=0), trap_expected=0\n"
&"Sending packet: $s#73..."
&"Ack\n"
&"infrun: prepare_to_wait\n"
&"Packet received: T05thread:00000001;25:54430080;\n"
&"infrun: target_wait (-1, status) =\ninfrun: 42000 [Thread
1],\ninfrun: status->kind = stopped, signal = SIGTRAP\n"
&"infrun: infwait_normal_state\n"
&"infrun: TARGET_WAITKIND_STOPPED\n"
&"infrun: stop_pc = 0x80004354\n"
&"infrun: context switch\n"
&"infrun: Switching context from Thread 3 to Thread 1\n"
&"Sending packet: $g#67..."
&"Ack\n"
&"Packet received:
00000000000000000000008000000000ec430080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000080d8040080d80400804c250080040040000000000000000000000000000000000054430080\n"
&"infrun: random signal 5\n"
&"infrun: stop_stepping\n"
~"[Switching to Thread 1]\n"
&"Sending packet: $z0,80002540,4#c9..."
&"Ack\n"
&"Packet received: OK\n"
&"Sending packet: $m800004c0,40#bc..."
&"Ack\n"
&"Packet received:
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000038030080\n"
*stopped,reason="signal-received",signal-name="SIGTRAP",signal-meaning="Trace/breakpoint
trap",frame={addr="0x80004354",func="print",args=[{name="text",value="0x0"}],file="drivers/printer.c",fullname="/home/tomas/runtime-EclipseApplication/kalisto/kernel/drivers/printer.c",line="27"},thread-id="1",stopped-threads="all"
=thread-selected,id="1"
(gdb)

Tomas