This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Wrong PC after external interrupt.


Hi,

Sometime (means: too often) when I interrupt my running program with GDB,
the instruction pointer is not aligned on an assembler instruction but one
byte too far. So when I try to step after that I often get a SIGILL or a
SIGSEGV.

Example: Running an eCos program, the target is i386-elf, and I'm using
insight under Cygwin.

Console output:
================
Init device '/dev/ttydiag'
Init tty channel: 77D78
Init device '/dev/haldiag'
HAL/diag SERIAL init

Breakpoint 3, main () at main.c:22  
0x63c55 in Cyg_RealTimeClock::dsr (vector=32, count=0, data=590112) at
//E/cvswork/ecos/packages/kernel/current/src/common/clock.cxx:913

Program received signal SIGILL, Illegal instruction.
0x63c55 in Cyg_RealTimeClock::dsr (vector=32, count=0, data=590112) at
//E/cvswork/ecos/packages/kernel/current/src/common/clock.cxx:913
================

When I disassemble the Cyg_RealTimeClock::dsr function i have:
==============================
Dump of assembler code for function dsr__17Cyg_RealTimeClockUiUiUi:
0x63c40 <dsr__17Cyg_RealTimeClockUiUiUi>:	push   %ebp
0x63c41 <dsr__17Cyg_RealTimeClockUiUiUi+1>:	mov    %esp,%ebp
0x63c43 <dsr__17Cyg_RealTimeClockUiUiUi+3>:	sub    $0x8,%esp
0x63c46 <dsr__17Cyg_RealTimeClockUiUiUi+6>:	add    $0xfffffff8,%esp
0x63c49 <dsr__17Cyg_RealTimeClockUiUiUi+9>:	pushl  0xc(%ebp)
0x63c4c <dsr__17Cyg_RealTimeClockUiUiUi+12>:	pushl  0x10(%ebp)
0x63c4f <dsr__17Cyg_RealTimeClockUiUiUi+15>:	call   0x63804
<tick__11Cyg_CounterUi>
0x63c54 <dsr__17Cyg_RealTimeClockUiUiUi+20>:	add    $0xfffffff4,%esp
0x63c57 <dsr__17Cyg_RealTimeClockUiUiUi+23>:	push   $0x89f40
0x63c5c <dsr__17Cyg_RealTimeClockUiUiUi+28>:	call   0x5f3d8
<timeslice__28Cyg_Scheduler_Implementation>
0x63c61 <dsr__17Cyg_RealTimeClockUiUiUi+33>:	leave  
0x63c62 <dsr__17Cyg_RealTimeClockUiUiUi+34>:	ret    
End of assembler dump.
========================

So you see that the program should have been stopped on 0x63c54 and not
0x63c55

I've experienced many times this problem with eCos. I know at least another
person that have the same symptom (SIGILL or SIGSEGV when Continuing an
interrupted program) with linux.


Thanks

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]