From: Dafni & R. B. <da...@ho...> - 2000-08-04 18:13:45
|
Dear all, I encountered another problem with sdcdb (I took the latest version from CVS) To reproduce it, I attach four files and a copy of my session: BE_seria.c and BE_serial.h should look familiar to you, I took them from the lib and include directories of SDCC and just renamed them and all variables and functions inside. 1.) build it: >make sdcc -c -mmcs51 --model-small --debug --nogcse --noinvariant --noinduction --nojtbound --noloopreverse --no-peep BE_serial.c sdcc -mmcs51 --model-small --debug --nogcse --noinvariant --noinduction --nojtbound --noloopreverse --no-peep serial_test1.c BE_serial.rel library file /export/usr/local/share/lib/small/libsdcc.lib library file /export/usr/local/share/lib/small/libint.lib library file /export/usr/local/share/lib/small/liblong.lib library file /export/usr/local/share/lib/small/libfloat.lib 2.) run sdcdb > gmake debug 3.) set breakpoint in serial BE_serial_interrupt_handler and step (sdcdb) b BE_serial.c:BE_serial_interrupt_handler Breakpoint 1 at 0x94: file BE_serial.c, line 47. (sdcdb) run Starting program Breakpoint 1, BE_serial_interrupt_handler() at BE_serial.c:47 47 void BE_serial_interrupt_handler(void) interrupt 4 using 1 (sdcdb) s BE_serial_interrupt_handler () at BE_serial.c:49 49 ES=0; (sdcdb) s 50 if ( TI ) (sdcdb) s 52 TI = 0; (sdcdb) s 53 if (BE_stx_index_out == BE_stx_index_in ) (sdcdb) s 55 BE_tx_serial_buffer_empty = 1; (sdcdb) s 56 BE_work_flag_buffer_transfered = 1; (sdcdb) s 60 SBUF = BE_stx_buffer[BE_stx_index_out++]; (sdcdb) s 63 if ( RI ) (sdcdb) q If you look at the source code, you'll see, that the line 60 is in an else and should not be executed if the debugger goes into the if (line 53). Here is just this code snippet: if (BE_stx_index_out == BE_stx_index_in ) { BE_tx_serial_buffer_empty = 1; BE_work_flag_buffer_transfered = 1; } else { SBUF = BE_stx_buffer[BE_stx_index_out++]; } What's happening ?? Could you please help ? regards, Robert Dafni & Robert Berger Pharmacist & Embedded Systems Engineer Stratigou Rogakou 24 15125 Polydrosso - Maroussi Athens Greece Tel, Fax.: ++30 1 6847881 email: da...@ho... http://users.hol.gr/~dafniz/ |