Skip to content

Instantly share code, notes, and snippets.

View vvuk's full-sized avatar

Vladimir Vukicevic vvuk

  • San Francisco, CA
View GitHub Profile
@vvuk
vvuk / Cargo.toml
Last active October 3, 2016 19:06
rustc flycheck macro errors
[package]
name = "rustc-error"
version = "0.1.1"
description = "Foo"
authors = ["Foo"]
license = "MIT/Apache-2.0"
[lib]
path = "lib.rs"
struct SomeStruct {
}
impl SomeStruct {
fn hello() {
println!("Hello");
}
}
fn main() {
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<!--
<Type Name="collections::vec::Vec&lt;*&gt;">
<DisplayString Condition="len == 0">empty</DisplayString>
<DisplayString Condition="len > 0">length = {len}, capacity = {buf.cap}</DisplayString>
<Expand>
<ArrayItems Condition="len &gt; 0">
<Size>len</Size>
diff --git a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index ebf80de..d787b2a 100644
--- a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -693,6 +693,26 @@ void CodeViewDebug::emitDebugInfoForFunction(const Function *GV,
if (SP != nullptr)
emitDebugInfoForUDTs(LocalUDTs);
+ // Emit a S_FRAMEPROC
+ OS.AddComment("Record length");
diff --git a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index ebf80de..96e1a85 100644
--- a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -571,6 +571,12 @@ void CodeViewDebug::emitInlinedCallSite(const FunctionInfo &FI,
emitLocalVariableList(Site.InlinedLocals);
+ // Close the scope.
+ OS.AddComment("Record length");
@vvuk
vvuk / hacking-setup.md
Last active December 7, 2021 11:50
webrender hacking setup doc

WebRender Hacking Setup

(not a tutorial for the innards, just the environment)

If you need help or have questions about any of this, please ask on #servo on irc.mozilla.org.

Rust

WebRender is written in the Rust programming language. There are a number of great resources for learning Rust, but you probably want to start with "The Book" and perhaps work through Rust by Example.

Setup

This document assumes that you have your preferred way of cloning git repositories from github, and that you have your platform's native compiler toolchain installed (e.g., Visual Studio 2015 on Windows).

@vvuk
vvuk / foo.rs
Created January 12, 2017 16:48
//// A
GetFileSize: {
unsafe extern "system" fn GetFileSize(
This: *mut IDWriteFontFileStream,
fileSize: *mut UINT64) -> HRESULT {
let this = FontFileStream::from_interface(This);
*fileSize = this.data.len() as UINT64;
S_OK
}
@vvuk
vvuk / headless-fix.patch
Created January 29, 2017 04:25
fix for headless kodi crash
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index c8bcd30..5cebc87 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -1241,6 +1241,8 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool
}
else if (cat.name == "skin")
{
+ if (g_application.IsHeadless())
+ return 0;
@vvuk
vvuk / foo.ts
Last active January 31, 2017 21:25
// == one.ts ==
export interface SomethingPublic {
foo(a: number): number;
}
// == two.ts ==
// error: SomethingPublic is not visible here
// this doesn't help:
using System;
using System.Collections.Generic;
using System.Linq;
using V8.Net;
namespace Test1
{
class GlobalUtils
{
public static void WriteLine(string s)