Summary: | vgdb should report process exit (or fatal signal) | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Mark Wielaard <mark> |
Component: | general | Assignee: | Julian Seward <jseward> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | philippe.waroquiers |
Priority: | NOR | ||
Version: | 3.9.0.SVN | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Patch and testcases for gdbserver exit reporting |
Description
Mark Wielaard
2012-10-13 19:30:25 UTC
Created attachment 74526 [details]
Patch and testcases for gdbserver exit reporting
Luckily the code was already mostly prepared to handle this case, just the final reporting was missing. valgrind_wait () already had a comment that it could return the exit code (but didn't). So all that had to be done was add an exit/fatal signal reporting function to gdbserver and invoke that before shutting down the gdbserver. And making sure that as soon as an exit process exit is reported we stop gdbserver processing. Some new test cases included for normal exit, exit code non-zero and abort signal. Existing testcases were modified to no longer expect a "Remote connection closed" on stderrB, but "Program exited normally." on stdoutB.
Tested against GDB 7.4.50.20120120-50.fc17, 7.2-56.el6 and 7.0.1-42.el5 (which showed gdb reported normal and exit code end of process slightly differently for remote targets, a small change to filter_gdb accounts for that).
Fixed in revision 13052. Thanks for the patch (slightly modified before applying e.g. to prefix the new tests with the 2 letters indicating the tool used for the test). |