Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(590)

Delta Between Two Patch Sets: cmd/ogleproxy/main.go

Issue 77580045: code review 77580045: ogle: add name->PC lookup for functions (Closed)
Left Patch Set: diff -r d44ba9529c0f https://code.google.com/p/ogle Created 10 years ago
Right Patch Set: diff -r d44ba9529c0f https://code.google.com/p/ogle Created 10 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | program/client/client.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2014 The Go Authors. All rights reserved. 1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // The ogleproxy connects to the target binary and serves an RPC 5 // The ogleproxy connects to the target binary and serves an RPC
6 // interface to access and control it. 6 // interface to access and control it.
7 package main 7 package main
8 8
9 import ( 9 import (
10 "flag" 10 "flag"
(...skipping 11 matching lines...) Expand all
22 22
23 func main() { 23 func main() {
24 log.SetFlags(0) 24 log.SetFlags(0)
25 log.SetPrefix("ogleproxy: ") 25 log.SetPrefix("ogleproxy: ")
26 flag.Parse() 26 flag.Parse()
27 if *textFlag == "" { 27 if *textFlag == "" {
28 fmt.Println("OGLE BAD\nUsage") 28 fmt.Println("OGLE BAD\nUsage")
29 flag.Usage() 29 flag.Usage()
30 os.Exit(2) 30 os.Exit(2)
31 } 31 }
32 » srv, err := server.New(*textFlag) 32 » s, err := server.New(*textFlag)
33 if err != nil { 33 if err != nil {
34 » » fmt.Printf("OGLE BAD\n%s\n", err) 34 » » fmt.Println("OGLE BAD\n%s\n", err)
35 os.Exit(2) 35 os.Exit(2)
36 } 36 }
37 » err = rpc.Register(srv) 37 » err = rpc.Register(s)
38 if err != nil { 38 if err != nil {
39 » » fmt.Printf("OGLE BAD\n%s\n", err) 39 » » fmt.Println("OGLE BAD\n%s\n", err)
40 os.Exit(2) 40 os.Exit(2)
41 } 41 }
42 fmt.Println("OGLE OK") 42 fmt.Println("OGLE OK")
43 log.Print("start server") 43 log.Print("start server")
44 // TODO: Usually done in a go. 44 // TODO: Usually done in a go.
45 rpc.ServeConn(&rwc{ 45 rpc.ServeConn(&rwc{
46 os.Stdin, 46 os.Stdin,
47 os.Stdout, 47 os.Stdout,
48 }) 48 })
49 log.Print("finish server") 49 log.Print("finish server")
(...skipping 15 matching lines...) Expand all
65 } 65 }
66 66
67 func (rwc *rwc) Close() error { 67 func (rwc *rwc) Close() error {
68 rerr := rwc.r.Close() 68 rerr := rwc.r.Close()
69 werr := rwc.w.Close() 69 werr := rwc.w.Close()
70 if rerr != nil { 70 if rerr != nil {
71 return rerr 71 return rerr
72 } 72 }
73 return werr 73 return werr
74 } 74 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b