< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java

Print this page
@@ -31,15 +31,17 @@
  import sun.jvm.hotspot.debugger.*;
  import sun.jvm.hotspot.debugger.cdbg.*;
  import sun.jvm.hotspot.debugger.x86.*;
  import sun.jvm.hotspot.debugger.amd64.*;
  import sun.jvm.hotspot.debugger.aarch64.*;
+ import sun.jvm.hotspot.debugger.riscv64.*;
  import sun.jvm.hotspot.debugger.ppc64.*;
  import sun.jvm.hotspot.debugger.linux.x86.*;
  import sun.jvm.hotspot.debugger.linux.amd64.*;
  import sun.jvm.hotspot.debugger.linux.ppc64.*;
  import sun.jvm.hotspot.debugger.linux.aarch64.*;
+ import sun.jvm.hotspot.debugger.linux.riscv64.*;
  import sun.jvm.hotspot.utilities.*;
  
  class LinuxCDebugger implements CDebugger {
    private LinuxDebugger dbg;
  

@@ -103,11 +105,18 @@
         Address fp = context.getRegisterAsAddress(AARCH64ThreadContext.FP);
         if (fp == null) return null;
         Address pc  = context.getRegisterAsAddress(AARCH64ThreadContext.PC);
         if (pc == null) return null;
         return new LinuxAARCH64CFrame(dbg, fp, pc);
-      } else {
+     } else if (cpu.equals("riscv64")) {
+        RISCV64ThreadContext context = (RISCV64ThreadContext) thread.getContext();
+        Address fp = context.getRegisterAsAddress(RISCV64ThreadContext.FP);
+        if (fp == null) return null;
+        Address pc  = context.getRegisterAsAddress(RISCV64ThreadContext.PC);
+        if (pc == null) return null;
+        return new LinuxRISCV64CFrame(dbg, fp, pc);
+     } else {
         // Runtime exception thrown by LinuxThreadContextFactory if unknown cpu
         ThreadContext context = (ThreadContext) thread.getContext();
         return context.getTopFrame(dbg);
      }
    }
< prev index next >