Skip to content

Commit

Permalink
Move pitfalls discussion to its own section
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Dec 13, 2022
1 parent 0e51320 commit fc55004
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 35 deletions.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Developed by
overview
building
optimizations
pitfalls

.. toctree::
:caption: toolkits
Expand Down
35 changes: 0 additions & 35 deletions docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,3 @@
========
Overview
========

Common pitfalls
===============

This appendix is designed to point out some common pitfalls that users
have reported when using the Dyninst system. Many of these are either
due to limitations in the current implementations, or reflect design
decisions that may not produce the expected behavior from the system.

Attach followed by detach
-------------------------

If a mutator attaches to a mutatee, and immediately exits, the current
behavior is that the mutatee is left suspended. To make sure the
application continues, call detach with the appropriate flags.

Attaching to a program that has already been modified by Dyninst
----------------------------------------------------------------

If a mutator attaches to a program that has already been modified by a
previous mutator, a warning message will be issued. We are working to
fix this problem, but the correct semantics are still being specified.
Currently, a message is printed to indicate that this has been
attempted, and the attach will fail.

Dyninst is event-driven
-----------------------

Dyninst must sometimes handle events that take place in the mutatee, for
instance when a new shared library is loaded, or when the mutatee
executes a fork or exec. Dyninst handles events when it checks the
status of the mutatee, so to allow this the mutator should periodically
call one of the functions BPatch::pollForStatusChange,
BPatch::wait­ForStatusChange, BPatch_thread::isStopped, or
BPatch_­thread::is­Termin­ated.
36 changes: 36 additions & 0 deletions docs/pitfalls.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

===============
Common pitfalls
===============

These are some common pitfalls that users
have reported when using the Dyninst system. Many of these are either
due to limitations in the current implementations, or reflect design
decisions that may not produce the expected behavior from the system.

Attach followed by detach
-------------------------

If a mutator attaches to a mutatee, and immediately exits, the current
behavior is that the mutatee is left suspended. To make sure the
application continues, call detach with the appropriate flags.

Attaching to a program that has already been modified by Dyninst
----------------------------------------------------------------

If a mutator attaches to a program that has already been modified by a
previous mutator, a warning message will be issued. We are working to
fix this problem, but the correct semantics are still being specified.
Currently, a message is printed to indicate that this has been
attempted, and the attach will fail.

Dyninst is event-driven
-----------------------

Dyninst must sometimes handle events that take place in the mutatee, for
instance when a new shared library is loaded, or when the mutatee
executes a fork or exec. Dyninst handles events when it checks the
status of the mutatee, so to allow this the mutator should periodically
call one of the functions BPatch::pollForStatusChange,
BPatch::wait­ForStatusChange, BPatch_thread::isStopped, or
BPatch_­thread::is­Termin­ated.

0 comments on commit fc55004

Please sign in to comment.