Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 577270 Details for
Bug 810668
ptrace: GDB inferior calls with floats fail
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Reproducer
fp2.c (text/plain), 1.21 KB, created by
Chuck Ebbert
on 2012-04-13 08:34:09 UTC
(
hide
)
Description:
Reproducer
Filename:
MIME Type:
Creator:
Chuck Ebbert
Created:
2012-04-13 08:34:09 UTC
Size:
1.21 KB
patch
obsolete
>#define _GNU_SOURCE >#include <unistd.h> >#include <assert.h> >#include <sys/wait.h> >#include <sys/procfs.h> >#include <sys/ptrace.h> > >int main(int argc, char **argv) >{ > pid_t child; > elf_fpregset_t fpregs; > int i, j, status; > > child = fork(); > assert(child != -1); > > if (child == 0) { > ptrace(PTRACE_TRACEME, 0, NULL, NULL); > __asm__ __volatile__("fldz; fld1; fld1; fadd %st,%st"); /* stack: 0 1 2 <--top */ > > for (i = 0; i < 20; i++) { > kill(getpid(), SIGSTOP); > __asm__ __volatile__("fadd %st(2), %st;"); /* use FPU; do nothing */ > } > > return 0; > } > >#define fpstack(n) (*(__float80 *)((char *)(&fpregs.st_space) + (n)*16)) > for (j = 0; j < 20+1; j++) { > waitpid(child, &status, 0); > if (WIFEXITED(status) || WIFSIGNALED(status)) > break; > > assert(!ptrace(PTRACE_GETFPREGS, child, NULL, &fpregs)); > assert(fpstack(1) == 1.0 && fpstack(2) == 0.0); > > if (j == 10) { /* replace 2 on stack top with 42 */ > assert(fpstack(0) == 2.0); > fpstack(0) = 42.0; > assert(!ptrace(PTRACE_SETFPREGS, child, NULL, &fpregs)); > } else if (j > 10) /* parent should now be seeing 42 */ > assert(fpstack(0) == 42.0); > > usleep(1000); /* let other processes run */ > ptrace(PTRACE_CONT, child, NULL, NULL); > } > > assert(j == 20); > return 0; >} > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 810668
:
575976
|
577270
|
577491
|
578300