Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:Test
ltrace
ltrace.trunk-r76.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ltrace.trunk-r76.patch of Package ltrace
------------------------------------------------------------------------ r76 | pmachata-guest | 2007-05-09 17:21:42 +0000 (Wed, 09 May 2007) | 7 lines Changed paths: M /ltrace/trunk/ChangeLog A /ltrace/trunk/testsuite/ltrace.torture/ia64-sigill.exp A /ltrace/trunk/testsuite/ltrace.torture/ia64-sigill.s M /ltrace/trunk/wait_for_something.c * wait_for_something.c (wait_for_something): Interpret SIGILL, SIGEMT and SIGSEGV as valid breakpoint signals, if instruction pointer referes to breakpoint. * testsuite/ltrace.torture/ia64-sigill.s, * testsuite/ltrace.torture/ia64-sigill.exp: Testcase for same. IA64-centric, because the only reproducer is there. ------------------------------------------------------------------------ Index: ChangeLog =================================================================== --- ChangeLog (revision 75) +++ ChangeLog (revision 76) @@ -1,3 +1,12 @@ +2007-05-09 Petr Machata <pmachata@redhat.com> + + * wait_for_something.c (wait_for_something): Interpret SIGILL, + SIGEMT and SIGSEGV as valid breakpoint signals, if instruction + pointer referes to breakpoint. + * testsuite/ltrace.torture/ia64-sigill.s, + * testsuite/ltrace.torture/ia64-sigill.exp: Testcase for same. + IA64-centric, because the only reproducer is there. + 2007-01-19 Petr Machata <pmachata@redhat.com> * sysdeps/linux-gnu/trace.c (trace_pid): wait for child to stop, Index: testsuite/ltrace.torture/ia64-sigill.exp =================================================================== --- testsuite/ltrace.torture/ia64-sigill.exp (revision 0) +++ testsuite/ltrace.torture/ia64-sigill.exp (revision 76) @@ -0,0 +1,33 @@ +# This file was written by Yao Qi <qiyao@cn.ibm.com>. + +set testfile "ia64-sigill" +set srcfile ${testfile}.s +set binfile ${testfile} + +if { [istarget ia64-*] } then { + verbose "compiling source file now....." + # Build the shared libraries this test case needs. + if { [ ltrace_compile "${srcdir}/${subdir}/${testfile}.s" "${srcdir}/${subdir}/${binfile}" executable {debug} ] != "" } { + send_user "Testcase compile failed, so all tests in this file will automatically fail\n." + } + + # Run PUT for ltarce. + set exec_output [ltrace_runtest $srcdir/$subdir $srcdir/$subdir/$binfile] + + # Check the output of this program. + verbose "ltrace runtest output: $exec_output\n" + if [regexp {ELF from incompatible architecture} $exec_output] { + fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!" + return + } elseif [ regexp {Couldn't get .hash data} $exec_output ] { + fail "Couldn't get .hash data!" + return + } + + catch "exec sh -c {grep SIGILL ${srcdir}/${subdir}/${testfile}.ltrace | wc -l ;exit}" output + if { $output == 0 } then { + pass "ltrace did interpret SIGILL as breakpoint." + } else { + fail "ltrace failed to interpret SIGILL as breakpoint." + } +} Index: testsuite/ltrace.torture/ia64-sigill.s =================================================================== --- testsuite/ltrace.torture/ia64-sigill.s (revision 0) +++ testsuite/ltrace.torture/ia64-sigill.s (revision 76) @@ -0,0 +1,43 @@ + .file "pokus.c" + .pred.safe_across_calls p1-p5,p16-p63 + .section .rodata + .align 8 +.LC0: + stringz "" + .text + .align 16 + .global main# + .proc main# +main: + .prologue 14, 32 + .save ar.pfs, r33 + alloc r33 = ar.pfs, 0, 4, 1, 0 + .vframe r34 + mov r34 = r12 + mov r35 = r1 + .save rp, r32 + mov r32 = b0 + .body + addl r36 = @ltoffx(.LC0), r1 + ;; + ld8.mov r36 = [r36], .LC0 + br.call.sptk.many b0 = printf# + nop.b 0x0 + nop.b 0x1 + nop.b 0x2 + nop.b 0x0 + nop.b 0x1 + nop.b 0x2 + mov r1 = r35 + addl r14 = 234, r0 + ;; + mov r8 = r14 + mov ar.pfs = r33 + mov b0 = r32 + .restore sp + mov r12 = r34 + br.ret.sptk.many b0 + ;; + .endp main# + .section .note.GNU-stack,"",@progbits + .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-3)" Index: wait_for_something.c =================================================================== --- wait_for_something.c (revision 75) +++ wait_for_something.c (revision 76) @@ -25,6 +25,7 @@ struct event *wait_for_something(void) pid_t pid; int status; int tmp; + int stop_signal; if (!list_of_processes) { debug(1, "No more children"); @@ -86,10 +87,31 @@ struct event *wait_for_something(void) event.thing = LT_EV_UNKNOWN; return &event; } - if ((WSTOPSIG(status) != (SIGTRAP | event.proc->tracesysgood)) && - (WSTOPSIG(status) != SIGTRAP)) { + + stop_signal = WSTOPSIG(status); + + /* On some targets, breakpoints are signalled not using + SIGTRAP, but also with SIGILL, SIGSEGV or SIGEMT. Check + for these. */ + if (stop_signal == SIGSEGV + || stop_signal == SIGILL +#ifdef SIGEMT + || stop_signal == SIGEMT +#endif + ) { + // If we didn't need to know IP so far, get it now. + void * addr = opt_i + ? event.proc->instruction_pointer + : (event.proc->instruction_pointer = get_instruction_pointer (event.proc)); + + if (address2bpstruct(event.proc, addr)) + stop_signal = SIGTRAP; + } + + if (stop_signal != (SIGTRAP | event.proc->tracesysgood) + && stop_signal != SIGTRAP) { event.thing = LT_EV_SIGNAL; - event.e_un.signum = WSTOPSIG(status); + event.e_un.signum = stop_signal; return &event; } event.thing = LT_EV_BREAKPOINT;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor