Coder Social home page Coder Social logo

Comments (12)

gaborcsardi avatar gaborcsardi commented on June 11, 2024

👍

Btw. I need to rethink debugme soon, because it seems to conflict with R-devel (https://cran.rstudio.com/web/checks/check_results_debugme.html), I suspect that this is because of the JIT being enabled in R-devel...

from debugme.

gaborcsardi avatar gaborcsardi commented on June 11, 2024

Recursing into environments needs to be done with care, because as soon as you have reference semantics, you might have circular references and circular data structures. So we need to keep track of which environments we are already instrumenting. Probably by using the address of the environment.

from debugme.

gaborcsardi avatar gaborcsardi commented on June 11, 2024

For R6 to work, I also need to go inside lists. Hopefully this won't cause any problems.

from debugme.

mllg avatar mllg commented on June 11, 2024

Thanks, this seems to work for batchtools.

However, I noticed that the instrumentation does not work properly with inheritance. Here is a simple example using https://github.com/mllg/bugme:

bar = Bar$new(x = 12)
print(bar$getxsquare)

getxsquare() gets instrumented twice.

from debugme.

gaborcsardi avatar gaborcsardi commented on June 11, 2024

Oh, yeah, of course. I will somehow mark the already instrumented functions to avoid instrumenting them again.

from debugme.

mllg avatar mllg commented on June 11, 2024

You could port data.table::address() to debugme which gives you addresses for functions and environments.

from debugme.

gaborcsardi avatar gaborcsardi commented on June 11, 2024

That requires C code, unfortunately, so I would avoid it if possible.

from debugme.

gaborcsardi avatar gaborcsardi commented on June 11, 2024

Unless I do some .Internal hack.....

from debugme.

mllg avatar mllg commented on June 11, 2024

5 lines of C code vs obscuring a call to .Internal() and violating CRAN policies? 😕

SEXP address(SEXP x) {
    char buffer[32];
    snprintf(buffer, 32, "%p", (void *)x);
    return(mkString(buffer));
}

What's wrong with C?

from debugme.

gaborcsardi avatar gaborcsardi commented on June 11, 2024

It makes debugme heavier, as you either need to rely on CRAN binaries or have a compiler.

from debugme.

gaborcsardi avatar gaborcsardi commented on June 11, 2024

Actually, I can also just change the debug string, so that the second run does not pick it up.

from debugme.

mllg avatar mllg commented on June 11, 2024

Actually, I can also just change the debug string, so that the second run does not pick it up.

👍

from debugme.

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.