OK.  Further poking around with what is going on.  It looks very much like
either gdb or gdb-proxy is getting confused about where the `next'
instruction actually is.  It may be that in the case of this particular
program that the mistaken location of the next instruction just happens to
be the first instruction in a timer interrupt routine or it may be that this
will always be the case.

Following is log of a gdb and gdb-proxy-debug session that demonstrates the
problem.  According to the gdb session what is happening is that the program
runs to the set breakpoint at line easyweb2.c:205 (0x00001832).  Then when a
`next' command is given gdb next halts at tcpip.c:915 (0x00002dec).  This is
unexpected as the next instruction is easyweb2.c:206 (0x0000183a).

According to the gdb-proxy-debug session either gdb or gdb-proxy decided to
set a breakpoint at (0x2DEC) after the next command.  The trace includes the
following two lines:
debug:     msp430: msp430_add_break(0, 0x1832, 0)
...
debug:     msp430: msp430_add_break(0, 0x2dec, 0)

Is it worthwhile mentioning that re-running the program and choosing to step
(rather than next) still has gdb halt at tcpip.c:915?

Where to from here?  aLUNZ does not know how to read the output of
msp430-gdbproxy-debug well enough to even identify the culprit.  If no-one
else knows the answer to this am willing to poke around a bit in the code
for gdb (or gdb-proxy) but would seriously need some pointers on where to
start with this.

Thanks for any help,
aLUNZ

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*** In gdb set a breakpoint, confirm that it is the only breakpoint
*** and then `continue' the program till the breakpoint is reached.

(gdb) b easyweb.c:205
Breakpoint 1 at 0x1832: file easyweb.c, line 205.
(gdb) i b
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x00001832 in main at easyweb.c:205
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
main () at easyweb.c:205
205             Delayx100us(50);
(gdb)

*** this is what appears in the gdb-proxy-debug session as the result of 
*** the above
debug:     msp430: msp430_wait_partial()
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430: msp430_wait_partial()
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 23 bytes:
$T0500:3218;04:2019;#0
1...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: z0,1832,2
debug:     msp430: msp430_remove_break(0, 0x1832, 0)
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 6 bytes: $OK#9a...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK

*** Now in gdb, do a list to confirm that the next instruction should
*** be easyweb2.c:206, then send a `next' command.  Note that we
*** actually stop at tcpip.c:915. 

(gdb) l
200     //        time_out = BUTTON_TIME;
201     //        while (time_out != 0)
202     //        if ((B2) == 0) time_out--;
203     //        else time_out = BUTTON_TIME;
204
205             Delayx100us(50);
206             RELAY1_ON;
207           }
208         else
209           {
(gdb) n

Program received signal SIGTRAP, Trace/breakpoint trap.
TCPClockHandler () at tcpip.c:915
915       if (TAIV == 10)                                // check for timer
over
flow, reset int.-flag
(gdb)

*** this is what appears in the gdb-proxy-debug session as the result of 
*** the above
debug:     msp430-gdbproxy.exe: packet received: m1774,4
debug:     msp430: msp430_read_mem(0x1774, ptr, 0, ptr)
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 12 bytes: $3140000a#b9...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: Hg0
debug:     msp430: msp430_set_gen_thread()
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 4 bytes: $#00...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: g
debug:     msp430: msp430_read_registers()
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 68 bytes:
$3218000a0a0000002019c
7df98c966ee00000000820232004200040001000100#00...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: Hc0
debug:     msp430: msp430_set_ctrl_thread()
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 4 bytes: $#00...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: s
debug:     msp430: msp430_resume_from_current(step, 0)
debug:     msp430: msp430_wait_partial()
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 23 bytes:
$T0500:ec2d;04:2019;#9
1...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: g
debug:     msp430: msp430_read_registers()
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 68 bytes:
$ec2dfc09000000002019c
7df98c966ee00000000820232004200040001003200#a4...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: Z0,1832,2
debug:     msp430: msp430_add_break(0, 0x1832, 0)
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 6 bytes: $OK#9a...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: Z0,2dec,2
debug:     msp430: msp430_add_break(0, 0x2dec, 0)
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 6 bytes: $OK#9a...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: Hc0
debug:     msp430: msp430_set_ctrl_thread()
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 4 bytes: $#00...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: c
debug:     msp430: msp430_resume_from_current(run, 0)
debug:     msp430: msp430_wait_partial()
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 23 bytes:
$T0500:ec2d;04:2019;#9
1...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: z0,2dec,2
debug:     msp430: msp430_remove_break(0, 0x2dec, 0)
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 6 bytes: $OK#9a...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK
debug:     msp430-gdbproxy.exe: packet received: z0,1832,2
debug:     msp430: msp430_remove_break(0, 0x1832, 0)
debug:     msp430-gdbproxy.exe: timeout while reading from GDB
debug:     msp430-gdbproxy.exe: sending packet: 6 bytes: $OK#9a...
debug:     msp430-gdbproxy.exe: ACK received
debug:     msp430-gdbproxy.exe: got ACK






Reply via email to