1 ./testdata/hist.go
255: func test() {
357: l := line{point{1 + zero, 2 + zero}, point{3 + zero, 4 + zero}}
458: tinycall() // this forces l etc to stack
559: dx := l.end.x - l.begin.x //gdb-dbg=(l.begin.x,l.end.y)//gdb-opt=(l,dx/O,dy/O)
660: dy := l.end.y - l.begin.y //gdb-opt=(dx,dy/O)
761: sink = dx + dy //gdb-opt=(dx,dy)
863: hist := make([]int, 7) //gdb-opt=(dx/O,dy/O) // TODO sink is missing if this code is in 'test' instead of 'main'
964: var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A) // TODO cannedInput/A is missing if this code is in 'test' instead of 'main'
1065: if len(os.Args) > 1 {
1173: scanner := bufio.NewScanner(reader)
1274: for scanner.Scan() { //gdb-opt=(scanner/A)
1375: s := scanner.Text()
1476: i, err := strconv.ParseInt(s, 10, 64)
1577: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
1681: hist = ensure(int(i), hist)
1782: hist[int(i)]++
1874: for scanner.Scan() { //gdb-opt=(scanner/A)
1975: s := scanner.Text()
2076: i, err := strconv.ParseInt(s, 10, 64)
2177: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
2281: hist = ensure(int(i), hist)
2382: hist[int(i)]++
2474: for scanner.Scan() { //gdb-opt=(scanner/A)
2575: s := scanner.Text()
2676: i, err := strconv.ParseInt(s, 10, 64)
2777: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
2881: hist = ensure(int(i), hist)
2982: hist[int(i)]++
3074: for scanner.Scan() { //gdb-opt=(scanner/A)
3175: s := scanner.Text()
3276: i, err := strconv.ParseInt(s, 10, 64)
3377: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
3481: hist = ensure(int(i), hist)
3582: hist[int(i)]++
3674: for scanner.Scan() { //gdb-opt=(scanner/A)
3775: s := scanner.Text()
3876: i, err := strconv.ParseInt(s, 10, 64)
3977: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
4081: hist = ensure(int(i), hist)
4182: hist[int(i)]++
4274: for scanner.Scan() { //gdb-opt=(scanner/A)
4375: s := scanner.Text()
4476: i, err := strconv.ParseInt(s, 10, 64)
4577: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
4681: hist = ensure(int(i), hist)
4782: hist[int(i)]++
4874: for scanner.Scan() { //gdb-opt=(scanner/A)
4975: s := scanner.Text()
5076: i, err := strconv.ParseInt(s, 10, 64)
5177: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
5281: hist = ensure(int(i), hist)
5382: hist[int(i)]++
5474: for scanner.Scan() { //gdb-opt=(scanner/A)
5575: s := scanner.Text()
5676: i, err := strconv.ParseInt(s, 10, 64)
5777: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
5881: hist = ensure(int(i), hist)
5982: hist[int(i)]++
6074: for scanner.Scan() { //gdb-opt=(scanner/A)
6175: s := scanner.Text()
6276: i, err := strconv.ParseInt(s, 10, 64)
6377: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i)
6481: hist = ensure(int(i), hist)
6582: hist[int(i)]++
6674: for scanner.Scan() { //gdb-opt=(scanner/A)
6784: t := 0
6885: n := 0
6986: for i, a := range hist {
7087: if a == 0 { //gdb-opt=(a,n,t)
7188: continue
7286: for i, a := range hist {
7387: if a == 0 { //gdb-opt=(a,n,t)
7490: t += i * a
7591: n += a
7692: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
7786: for i, a := range hist {
7887: if a == 0 { //gdb-opt=(a,n,t)
7990: t += i * a
8091: n += a
8192: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
8286: for i, a := range hist {
8387: if a == 0 { //gdb-opt=(a,n,t)
8488: continue
8586: for i, a := range hist {
8687: if a == 0 { //gdb-opt=(a,n,t)
8790: t += i * a
8891: n += a
8992: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
9086: for i, a := range hist {
9187: if a == 0 { //gdb-opt=(a,n,t)
9290: t += i * a
9391: n += a
9492: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t)
9586: for i, a := range hist {
9687: if a == 0 { //gdb-opt=(a,n,t)
9788: continue
9886: for i, a := range hist {
9999: }
View as plain text