Giter VIP home page Giter VIP logo

c-worksheet-instrumentor's Introduction

About Me

I hail from New Zealand.

I studied my undergraduate degree BComp (Hon) at the National University of Singapore, 2011-2015.

I’m currently based in Vietnam.

Repositories

c-worksheet-instrumentor's People

Contributors

rgoulter avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

c-worksheet-instrumentor's Issues

Edge Case: Unable to Instrument Anonymous Struct Expressions

Really minor, but kinda annoying anyway. Doesn't output in the below situation.

One way to work around this is to inject another variable in the declaration (cf. as2).

An alternative way would be to do some memcpy magic, which would probably work. (But makes CTypeToDeclaration be more explicit about its assumptions).

#include <stdio.h>
#include <string.h>

int main(int argc, char** argv) {
    struct { int z; } as = { 9 }, as2;            //> as2 is struct { int z; }
    as.z;                                         //> 9

    // as; // won't instrument

    as2 = as;                                     //> as2 = {.z = 9}
    as2.z;                                        //> 9

    // No actual guarantee memcpy should work here,
    // but I suspect it will on most compilers.
    struct { int z; } az = { 4 };                 //> az is struct { int z; }
    memcpy(&az, &as, sizeof(as));

    az.z;                                         //> 9
}

Issue running on macOS

Running the unzipped tool as it downloaded on OSX yields the error below.

This is kindof annoying. + The tool isn't "robust" in the case where Java throws an exception like that. (i.e. Vim just hangs, which is quite unhelpful).

It seems running code from tmpdir is bad? (n.b. error also occurs from running gradle test, so..).

richardgoulter@r-7-105-25-172  ~/.vim/bundle/c-worksheet.vim/tool/cworksheet-proguard-0.2.4/bin$ ./c-worksheetify ~/hello.c
Exception in thread "main" java.io.IOException: Cannot run program "/var/folders/yt/xblbjsj91g3fh7_mqq0n2rn00000gn/T/cworksheet1178141796752375443.out": error=13, Permission denied
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
    at scala.i.a.o.a(Unknown Source)
    at edu.nus.worksheet.Worksheetify$.a(Unknown Source)
    at edu.nus.worksheet.Worksheetify.main(Unknown Source)
Caused by: java.io.IOException: error=13, Permission denied
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
    ... 3 more

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.