This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/gdb-7.12-branch] x32: gdbserver's agent bytecode JIT: fix "call" emission


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7b42e25f7cac78821b6efea2890fe725c59250fc

commit 7b42e25f7cac78821b6efea2890fe725c59250fc
Author: Pedro Alves <palves@redhat.com>
Date:   Tue Aug 23 23:17:13 2016 +0100

    x32: gdbserver's agent bytecode JIT: fix "call" emission
    
    Running fast tracepoint tests on x32 exposes a latent bug in the agent
    bytecode jitting.  There's a code path that forgets to emit the call
    opcode...  Whoops.  Fixes a bunch of gdb.trace/trace-condition.exp
    FAILs, like:
    
      (gdb)
      continue
      Continuing.
    
      Thread 1 "trace-condition" received signal SIGSEGV, Segmentation fault.
      0x7ffec016 in ?? ()
      (gdb) FAIL: gdb.trace/trace-condition.exp: ftrace: $rip == *set_point: advance through tracing
    
    gdb/gdbserver/ChangeLog:
    2016-08-23  Pedro Alves  <palves@redhat.com>
    
    	* linux-x86-low.c (amd64_emit_call): Emit missing call opcode.

Diff:
---
 gdb/gdbserver/ChangeLog       | 4 ++++
 gdb/gdbserver/linux-x86-low.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index b09f802..332bc03 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,9 @@
 2016-08-23  Pedro Alves  <palves@redhat.com>
 
+	* linux-x86-low.c (amd64_emit_call): Emit missing call opcode.
+
+2016-08-23  Pedro Alves  <palves@redhat.com>
+
 	* linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Fix
 	comment.  Use memcpy instead of casting through unsigned long.
 
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index 1ba98ba..d847b93 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -1842,6 +1842,8 @@ amd64_emit_call (CORE_ADDR fn)
   else
     {
       int offset32 = offset64; /* we know we can't overflow here.  */
+
+      buf[i++] = 0xe8; /* call <reladdr> */
       memcpy (buf + i, &offset32, 4);
       i += 4;
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]