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

Delta Between Two Patch Sets: program/server/dwarf.go

Issue 109430043: code review 109430043: ogle: move symbol lookup into dwarf package (Closed)
Left Patch Set: diff -r 0418e9debffa https://code.google.com/p/ogle Created 9 years, 9 months ago
Right Patch Set: diff -r 0418e9debffa https://code.google.com/p/ogle Created 9 years, 8 months 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 | « debug/macho/file.go ('k') | no next file » | 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 package server 5 package server
6 6
7 import ( 7 import (
8 "regexp" 8 "regexp"
9 9
10 "code.google.com/p/ogle/debug/dwarf" 10 "code.google.com/p/ogle/debug/dwarf"
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 result = append(result, name) 36 result = append(result, name)
37 } 37 }
38 return result, nil 38 return result, nil
39 } 39 }
40 40
41 func (s *Server) lookupSym(name string) (uint64, error) { 41 func (s *Server) lookupSym(name string) (uint64, error) {
42 return s.dwarfData.LookupSym(name) 42 return s.dwarfData.LookupSym(name)
43 } 43 }
44 44
45 func (s *Server) entryForPC(pc uint64) (entry *Entry, lowpc uint64, err error) { 45 func (s *Server) lookupPC(pc uint64) (string, error) {
46 » return s.dwarfData.EntryForPC(pc) 46 » return s.dwarfData.LookupPC(pc)
47 } 47 }
48 48
49 func (s *Server) entryForPC(pc uint64) (string, error) { 49 func (s *Server) entryForPC(pc uint64) (entry *dwarf.Entry, lowpc uint64, err er ror) {
50 » return s.dwarfData.LookupPC(pc) 50 » return s.dwarfData.EntryForPC(pc)
51 } 51 }
52 52
53 // TODO: signedness? Return (x int64, ok bool)?? 53 // TODO: signedness? Return (x int64, ok bool)??
54 func evalLocation(v []uint8) int64 { 54 func evalLocation(v []uint8) int64 {
55 if len(v) == 0 { 55 if len(v) == 0 {
56 return 0 56 return 0
57 } 57 }
58 if v[0] != 0x9C { // DW_OP_call_frame_cfa 58 if v[0] != 0x9C { // DW_OP_call_frame_cfa
59 return 0 59 return 0
60 } 60 }
(...skipping 29 matching lines...) Expand all
90 if x&0x80 == 0 { 90 if x&0x80 == 0 {
91 if x&0x40 != 0 { 91 if x&0x40 != 0 {
92 s |= sign 92 s |= sign
93 } 93 }
94 break 94 break
95 } 95 }
96 } 96 }
97 // Sign extend? 97 // Sign extend?
98 return s 98 return s
99 } 99 }
LEFTRIGHT

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