LEFT | RIGHT |
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 Loading... |
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 Loading... |
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 } |
LEFT | RIGHT |