문제

Is there a utility similar to OllyDbg / SoftICE for java? I.e. execute class (from jar / with class path) and, without source code, show the disassembly of the intermediate code with ability to step through / step over / search for references / edit specific intermediate code in memory / apply edit to file...

If not, is it even possible to write something like this (assuming we're willing to live without hotspot for the debug duration)?

Edit: I'm not talking about JAD or JD or Cavaj. These are fine decompilers, but I don't want a decompiler for several reasons, most notable is that their output is incorrect (at best, sometimes just plain wrong). I'm not looking for a magical "compiled bytes to java code" - I want to see the actual bytes that are about to be executed. Also, I'd like the ability to change those bytes (just like in an assembly debugger) and, hopefully, write the changed part back to the class file.

Edit2: I know javap exists - but it does only one way (and without any sort of analysis). Example (code taken from the vmspec documentation): From java code, we use "javac" to compile this:

void setIt(int value) {
    i = value;
}
int getIt() {
    return i;
}

to a java .class file. Using javap -c I can get this output:

    Method void setIt(int)
   0    aload_0
   1    iload_1
   2    putfield #4
   5    return
    Method int getIt()
   0    aload_0
   1    getfield #4
   4    ireturn

This is OK for the disassembly part (not really good without analysis - "field #4 is Example.i"), but I can't find the two other "tools":

  1. A debugger that goes over the instructions themselves (with stack, memory dumps, etc), allowing me to examine the actual code and environment.
  2. A way to reverse the process - edit the disassembled code and recreate the .class file (with the edited code).
도움이 되었습니까?

해결책

ScriptLink 사용

<sharepoint:scriptlink defer="false " id="SPScriptLink " localizable="false " name="jquery-x.x.x.js " runat="server"></sharepoint:scriptlink> 
.

또는

<SharePoint:Scriptlink runat="server" Name="~sitecollection/Style Library/[YOUR SITE]/js/jquery.js" Language="javascript" />
.

ScriptLink 컨트롤은 스크립트가 한 번만로드되고 또한 다른 종속성이 먼저로드되었는지 확인합니다

다른 팁

Take a look at JAD Decomplier for decompiling Java code. You can then run an IDE's built-in debugger using produced sources. IDE can be IntelliJ, Eclipse or NetBeans. This approach is not completely automatic, but it should do the job.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top