Skip to content

Instantly share code, notes, and snippets.

View hackcasual's full-sized avatar

Charles Vaughn hackcasual

View GitHub Profile
package main
import (
"fmt"
"net"
"code.google.com/p/go.net/websocket"
"net/http"
)
func webHandler(ws *websocket.Conn) {
#!/usr/bin/python
import socket
import zlib
import numpy as np
WIDTH = 256
HEIGHT = 128
buf = np.zeros(WIDTH * HEIGHT * 3 + 1, np.uint8)
// SaltarelleCompiler Runtime (http://www.saltarelle-compiler.com)
// Modified version of Script# Core Runtime (http://projects.nikhilk.net/ScriptSharp)
if (typeof(global) === "undefined") {
if (typeof(window) !== "undefined")
global = window;
else if (typeof(self) !== "undefined")
global = self;
}
(function(global) {
function __ZN5lzham18lzham_decompressor10decompressILb0EEE25lzham_decompress_status_tv($this) {
$this = $this | 0;
var $$ = 0, $$0 = 0, $$40 = 0, $$41 = 0, $$42 = 0, $$43 = 0, $$44 = 0, $$45 = 0, $$46 = 0, $$49 = 0, $$50 = 0, $$57 = 0, $$58 = 0, $$60 = 0, $$61 = 0, $$lcssa = 0, $$lcssa637 = 0, $$lcssa638 = 0, $$lcssa644 = 0, $$lcssa645 = 0, $$lcssa651 = 0, $$lcssa657 = 0, $0 = 0, $10 = 0, $1000 = 0, $1002 = 0, $1004 = 0, $1006 = 0, $1008 = 0, $1010 = 0, $1012 = 0, $1014 = 0, $1016 = 0, $1018 = 0, $1020 = 0, $1033 = 0, $1034 = 0, $1053 = 0, $1056 = 0, $1076 = 0, $1078 = 0, $1081 = 0, $1084 = 0, $1086 = 0, $1087 = 0, $1089 = 0, $1098 = 0, $11 = 0, $1100 = 0, $1102 = 0, $1104 = 0, $1106 = 0, $1108 = 0, $1110 = 0, $1112 = 0, $1114 = 0, $1116 = 0, $1118 = 0, $1133 = 0, $1134 = 0, $1137 = 0, $1153 = 0, $1154 = 0, $1155 = 0, $1156 = 0, $1157 = 0, $1160 = 0, $1163 = 0, $1166 = 0, $1168 = 0, $1174 = 0, $1175 = 0, $1176 = 0, $1179 = 0, $1180 = 0, $1181 = 0, $1186 = 0, $1191 = 0, $1192 = 0, $1207 = 0, $1210 = 0, $1212

Emscripten Debugging System

ver -1

Proposal for debug tooling based on DWARF, purpose designed to be easy to integrate with Javascript and similar targets.

Scope

This document lays out a record format as well as several intrinsic style functions designed to support debugging transpiled C/C++.

Goals

  1. Support viewing heap allocated objects in a manner similar to existing C/C++ debug interfaces
if (typeof(document) !== "undefined") {
$.ready(function(){
var saveHeap = (function () {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
return function (fileName) {
#include <emscripten/bind.h>
#include <stdio.h>
#include <string.h>
using namespace emscripten;
int send_ajax_request(char *url, char *message) {
printf("Calling ajax: %s %s\n", url, message);
return 0;
}
// The Module object: Our interface to the outside world. We import
// and export values on it, and do the work to get that through
// closure compiler if necessary. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..generated code.. }
// 3. pre-run appended it, var Module = {}; ..generated code..
// 4. External script tag defines var Module.
// We need to do an eval in order to handle the closure compiler
// case, where this code here is minified but Module was defined
// elsewhere (e.g. case 4 above). We also need to check if Module
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp
index d1d83a4..bd0e6c4 100644
--- a/lib/Target/JSBackend/JSBackend.cpp
+++ b/lib/Target/JSBackend/JSBackend.cpp
@@ -152,6 +152,10 @@ WebAssembly("emscripten-wasm",
cl::desc("Generate asm.js which will later be compiled to WebAssembly (see emscripten BINARYEN setting)"),
cl::init(false));
+static cl::opt<bool>
+FunctionCoverage("function-coverage",
diff --git a/emcc.py b/emcc.py
index 18edda4..a598c5c 100755
--- a/emcc.py
+++ b/emcc.py
@@ -1923,6 +1923,10 @@ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR P
# Move final output to the js target
shutil.move(final, js_target)
+ # Bundle symbol data in with the cyberdwarf file
+ if shared.Settings.FUNCTION_COVERAGE: