Skip to content

Instantly share code, notes, and snippets.

View aarzilli's full-sized avatar

Alessandro Arzilli aarzilli

View GitHub Profile
@aarzilli
aarzilli / gist:fcd2a0094f89c29256a9
Created September 18, 2014 09:37
SetupRequest conundrum
#include <stdlib.h>
#include <stdio.h>
#include "libxcb-1.11/src/xcb.h"
/*
gcc testxcb.c libxcb-1.11/src/.libs/libxcb.a -lXau; ./a.out
*/
char bytes[] = { ... capture data here...};

test test test

% dlv test
Type 'help' for list of commands.
(dlv) b vlq_test.go:8
b vlq_test.go:8
Breakpoint 1 set at 0x47e740 for _/home/a/temp/vlq.TestVarInt ./vlq_test.go:8
(dlv) c
> _/home/a/temp/vlq.TestVarInt() ./vlq_test.go:8 (hits goroutine(5):1 total:1)
3: import (
4: "bytes"
5: "testing"
TEXT main.changeMe(SB) /home/a/n/go/src/github.com/derekparker/delve/_fixtures/issue332.go
issue332.go:12 0x4012e0 64488b0c25f8ffffff FS MOVQ FS:0xfffffff8, CX
issue332.go:12 0x4012e9 488d4424f8 LEAQ -0x8(SP), AX
issue332.go:12 0x4012ee 483b4110 CMPQ 0x10(CX), AX
issue332.go:12 0x4012f2 0f8638010000 JBE 0x401430
issue332.go:12 0x4012f8 4881ec88000000 SUBQ $0x88, SP
issue332.go:13 0x4012ff 488b9c2490000000 MOVQ 0x90(SP), BX
issue332.go:13 0x401307 4883bc249800000000 CMPQ $0x0, 0x98(SP)
issue332.go:13 0x401310 0f8613010000 JBE 0x401429
issue332.go:13 0x401316 488d2da3521000 LEAQ 0x1052a3(IP), BP
Process 24607 has exited with status 0
$ ~/n/go/src/github.com/derekparker/delve/dlv-new debug -- ciao.txt
Type 'help' for list of commands.
(dlv) vars strconv
strconv.statictmp_0739 = [16]uint16 [...]
strconv.statictmp_0738 = [73]uint16 [...]
strconv.statictmp_0737 = [342]uint32 [...]
strconv.statictmp_0736 = [136]uint16 [...]
strconv.statictmp_0735 = [470]uint16 [...]
strconv.statictmp_0734 = [61]struct strconv.leftCheat [...]
$ ~/n/go/src/github.com/derekparker/delve/dlv debug -- ciao.txt
Type 'help' for list of commands.
(dlv) vars strconv
strconv.ErrRange = error nil
strconv.ErrSyntax = error nil
strconv.float32info = struct strconv.floatInfo {mantbits: 23, expbits: 8, bias: -127}
strconv.float64info = strconv.floatInfo {mantbits: 52, expbits: 11, bias: -1023}
strconv.initdone· = 0
strconv.isGraphic = []uint16 len: 16, cap: 16, [160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288]
strconv.isNotPrint16 = []uint16 len: 136, cap: 136, [173,907,909,930,1328,1376,1416,1424,1757,2111,2436,2473,2481,2526,2564,2601,2609,2612,2615,2621,2653,2692,2702,2706,2729,2737,2740,2758,2762,2820,2857,2865,2868,2910,2948,2961,2971,2973,3017,3076,3085,3089,3113,3141,3145,3159,3200,3204,3213,3217,3241,3252,3269,3273,3295,3312,3332,3341,3345,3397,3401,3460,3506,3516,...+72 more]
@aarzilli
aarzilli / errorfeedback.md
Last active September 6, 2018 04:14
Feedback for Go2 error handling design

Check as an operator

I don't see why check should work like a unary operator and have its own special syntax rule instead of acting like any function call.

Go doesn't have anything like the proposed check, it has unary operators but they are all symbolic (for example !, unary * and &). It would be the first thing in the go language to look like C's sizeof.

Test bla-bla

  1. 1. blah blah something

blah blah

onetwo
blahbloh
VSCodeGoLand
Version VSCode 1.34.0, VSCode-go 0.10.2 GoLand 2019.2 EAP (192.4205.56) Vim-go 1.20 (vim 8.1)
package main
import (
"fmt"
"runtime"
)
var globalvar1 = 0
var globalvar2 = 0