asan: score: global-buffer-overflow
[deliverable/binutils-gdb.git] / gdb / nat / amd64-linux-siginfo.h
index a3969663c8b148fe0a7331257986b5994a3e62bb..50d7fdc884f7cad17a4b29e46f5d7d7489bb4369 100644 (file)
@@ -1,6 +1,6 @@
 /* Low-level siginfo manipulation for amd64.
 
-   Copyright (C) 2016 Free Software Foundation, Inc.
+   Copyright (C) 2016-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef AMD64_LINUX_SIGINFO_H
-#define AMD64_LINUX_SIGINFO_H 1
+#ifndef NAT_AMD64_LINUX_SIGINFO_H
+#define NAT_AMD64_LINUX_SIGINFO_H
 
+#include <signal.h>  /* For siginfo_t.  */
 
 /* When GDB is built as a 64-bit application on Linux, the
    PTRACE_GETSIGINFO data is always presented in 64-bit layout.  Since
    debugging a 32-bit inferior with a 64-bit GDB should look the same
    as debugging it with a 32-bit GDB, we do the 32-bit <-> 64-bit
-   conversion in-place ourselves.  */
+   conversion in-place ourselves.
+   In other to make this conversion independent of the system where gdb
+   is compiled the most complete version of the siginfo, named as native
+   siginfo, is used internally as an intermediate step.
+
+   Conversion using nat_siginfo is exemplified below:
+   compat_siginfo_from_siginfo or compat_x32_siginfo_from_siginfo
+
+      buffer (from the kernel) -> nat_siginfo -> 32 / X32 siginfo
+
+   siginfo_from_compat_x32_siginfo or siginfo_from_compat_siginfo
+
+     32 / X32 siginfo -> nat_siginfo -> buffer (to the kernel)  */
+
 
 /* Kind of siginfo fixup to be performed.  */
 
@@ -41,4 +55,4 @@ int amd64_linux_siginfo_fixup_common (siginfo_t *native, gdb_byte *inf,
                                      int direction,
                                      enum amd64_siginfo_fixup_mode mode);
 
-#endif
+#endif /* NAT_AMD64_LINUX_SIGINFO_H */
This page took 0.024674 seconds and 4 git commands to generate.