Rename thread.Process -> thread.dbp

Process is an incorrect name for the DebuggedProcess struct that the
thread is "a part" of. Also, no need to export that field.
This commit is contained in:
Derek Parker
2015-05-27 12:16:45 -05:00
parent 8f4f54d22a
commit 49667f2302
10 changed files with 95 additions and 72 deletions

View File

@ -474,20 +474,24 @@ func convertBreakPoint(bp *proctl.BreakPoint) *api.BreakPoint {
// convertThread converts an internal thread to an API Thread.
func convertThread(th *proctl.ThreadContext) *api.Thread {
var function *api.Function
file, line := "", 0
var (
function *api.Function
file string
line int
pc uint64
)
pc, err := th.PC()
loc, err := th.Location()
if err == nil {
f, l, fn := th.Process.PCToLine(pc)
file = f
line = l
if fn != nil {
pc = loc.PC
file = loc.File
line = loc.Line
if loc.Fn != nil {
function = &api.Function{
Name: fn.Name,
Type: fn.Type,
Value: fn.Value,
GoType: fn.GoType,
Name: loc.Fn.Name,
Type: loc.Fn.Type,
Value: loc.Fn.Value,
GoType: loc.Fn.GoType,
}
}
}