Now that I've understand hot to get the beginning of the text section ....
I go on wishing to get some useful info about the exception in my NOMMU
world (m68k-elf-gcc),
but it seems that the register values retrieved in this way are not correct.
I've verified in the .map symbol file by the :
printf("sighandler1=%08x\n", sighandler1-(unsigned long)&_stext) ;
that info about _stext are ok, but the (PC -_stext) point to a neg
number !!!
So I deduce that :
1) I've not retrieved registers values in the right way
2) In my environ (coldfire, uclinux, m68-elf-gcc) it doesn't work.
Has anyone used the SIGSEV handler to get the register info successfully ?
PS:
running the same program by the m68k-elf-gdb the exception is correctly
managed and is displayed the right information about the line number of
the events.
thanks,
CODE SNIPPETS:
to generate the exception:
static char *add=(char *)0x90000000;
void forza_sig11(void)
{
add += 100;
*add = 0;
}
the handler:
void sighandler1(int signal, siginfo_t *info, void *dummy)
{
ucontext_t *uc=dummy;
int i;
greg_t *gr = uc->uc_mcontext.gregs;
printf("sighandler1 Got signal %d!\n", signal);
printf("text=%lx data=%lx bss=%lx\n", (unsigned long)&_stext,
(unsigned long)&_sdata, (unsigned long)&_sbss);
printf("PCr=%08x\n", gr[R_PC]-(unsigned long)&_stext);
printf("sighandler1=%08x %08x \n", sighandler1-(unsigned
long)&_stext, (unsigned long)sighandler1);
printf("SP=%08x PC=%08x PS=%08x \n", gr[R_SP], gr[R_PC], gr[R_PS]);
printf("D0-7: %08x %08x %08x %08x %08x %08x %08x %08x\n", gr[R_D0],
gr[R_D1], gr[R_D2], gr[R_D3], gr[R_D4], gr[R_D5], gr[R_D6], gr[R_D7]);
printf("A0-7: %08x %08x %08x %08x %08x %08x %08x %08x\n", gr[R_A0],
gr[R_A1], gr[R_A2], gr[R_A3], gr[R_A4], gr[R_A5], gr[R_A6], gr[R_A7]);
printf("\n");
}
void sigahndler1_init(void)
{
sact1.sa_sigaction = sighandler1;
sigaction(11, &sact1, &sact1_old);
}
--
/Cordiali saluti,/
*Daniele Ziglioli*
www.signal-elettronica.it <http://www.signal-elettronica.it/>
___________________________________________________________________________
Il contenuto di questo messaggio e ogni file eventualmente allegato è
confidenziale e riservato.
La comunicazione, la diffusione o la riproduzione del messaggio senza
esplicita autorizzazione è vietata.
The content of this message and any attached files are reserved and
confidential.
The communication, the spread or the reproduction of the message without
explicit authorization is prohibited.
__________________________________________________________________________
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev