GithubHelp home page GithubHelp logo

Comments (5)

raphw avatar raphw commented on July 28, 2024

ChatGTP is pretty much correct. There's no need to limit the scope here as the assignment can never yield an exception. I assume that it's a simple simplification.

from byte-buddy.

jiangyunpeng avatar jiangyunpeng commented on July 28, 2024

Thanks a lot for the detailed response.

Actually, i used ByteBuddy and asm to develop a online debug tools.

I decompile user's class to java source code, and user can debug at any source code line. We will record every variable before user debug code line . for example below code ,if user debug at L15, we will record the value of 'a' and 'b' variables.

L11    public void sum2() {
L12        int a = 25;
L13        try {
L14            int b = 8;
L15            if (a > 20) {
L16                int k = a + b;
L17                System.out.println("k=" + k);
L18            }
L19        } catch (Exception e) {
L20            e.printStackTrace();
L21        }
L22    }

But if user debug at L20. we will generate error bytecode base ' LocalVariableTable ' , Because our bytecode will try to record variable 'b' at catch statement but actually it can't be accessed.

So could you give some advice to me for this case?

from byte-buddy.

jiangyunpeng avatar jiangyunpeng commented on July 28, 2024

i think may be need parse source code manually for resolve this case

from byte-buddy.

raphw avatar raphw commented on July 28, 2024

I would argue that it would be possible to access the value using the Java debugger.

from byte-buddy.

jiangyunpeng avatar jiangyunpeng commented on July 28, 2024

Thanks , Have a nice day.

from byte-buddy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.