From fe19f3f20c0f8be7f9f6bd2eebe2d3b421ab0080 Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Fri, 12 Jun 2015 14:04:14 -0500 Subject: [PATCH] Rename: s/EvalSymbol/EvalVariable/ --- proctl/proctl.go | 4 ++-- proctl/variables.go | 4 ++-- proctl/variables_test.go | 12 ++++++------ service/client.go | 8 ++++---- service/debugger/debugger.go | 4 ++-- service/rest/client.go | 4 ++-- service/rest/server.go | 4 ++-- terminal/command.go | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/proctl/proctl.go b/proctl/proctl.go index d6535d19..4dfdf52e 100644 --- a/proctl/proctl.go +++ b/proctl/proctl.go @@ -463,8 +463,8 @@ func (dbp *DebuggedProcess) CurrentBreakpoint() *BreakPoint { } // Returns the value of the named symbol. -func (dbp *DebuggedProcess) EvalSymbol(name string) (*Variable, error) { - return dbp.CurrentThread.EvalSymbol(name) +func (dbp *DebuggedProcess) EvalVariable(name string) (*Variable, error) { + return dbp.CurrentThread.EvalVariable(name) } // Returns a reader for the dwarf data diff --git a/proctl/variables.go b/proctl/variables.go index 55e3425b..91b71cb9 100644 --- a/proctl/variables.go +++ b/proctl/variables.go @@ -197,8 +197,8 @@ func parseG(thread *ThreadContext, gaddr uint64, deref bool) (*G, error) { return g, nil } -// Returns the value of the named symbol. -func (thread *ThreadContext) EvalSymbol(name string) (*Variable, error) { +// Returns the value of the named variable. +func (thread *ThreadContext) EvalVariable(name string) (*Variable, error) { pc, err := thread.PC() if err != nil { return nil, err diff --git a/proctl/variables_test.go b/proctl/variables_test.go index fda9c075..1aada13f 100644 --- a/proctl/variables_test.go +++ b/proctl/variables_test.go @@ -77,9 +77,9 @@ func TestVariableEvaluation(t *testing.T) { assertNoError(err, t, "Continue() returned an error") for _, tc := range testcases { - variable, err := p.EvalSymbol(tc.name) + variable, err := p.EvalVariable(tc.name) if tc.err == nil { - assertNoError(err, t, "EvalSymbol() returned an error") + assertNoError(err, t, "EvalVariable() returned an error") assertVariable(t, variable, tc) } else { if tc.err.Error() != err.Error() { @@ -101,10 +101,10 @@ func TestVariableFunctionScoping(t *testing.T) { assertNoError(err, t, "Continue() returned an error") p.Clear(pc) - _, err = p.EvalSymbol("a1") + _, err = p.EvalVariable("a1") assertNoError(err, t, "Unable to find variable a1") - _, err = p.EvalSymbol("a2") + _, err = p.EvalVariable("a2") assertNoError(err, t, "Unable to find variable a1") // Move scopes, a1 exists here by a2 does not @@ -116,10 +116,10 @@ func TestVariableFunctionScoping(t *testing.T) { err = p.Continue() assertNoError(err, t, "Continue() returned an error") - _, err = p.EvalSymbol("a1") + _, err = p.EvalVariable("a1") assertNoError(err, t, "Unable to find variable a1") - _, err = p.EvalSymbol("a2") + _, err = p.EvalVariable("a2") if err == nil { t.Fatalf("Can eval out of scope variable a2") } diff --git a/service/client.go b/service/client.go index 785f6f62..7234881d 100644 --- a/service/client.go +++ b/service/client.go @@ -40,12 +40,12 @@ type Client interface { // ListPackageVariables lists all package variables in the context of the current thread. ListPackageVariables(filter string) ([]api.Variable, error) - // EvalSymbol returns a variable in the context of the current thread. - EvalSymbol(symbol string) (*api.Variable, error) + // EvalVariable returns a variable in the context of the current thread. + EvalVariable(symbol string) (*api.Variable, error) // ListPackageVariablesFor lists all package variables in the context of a thread. ListPackageVariablesFor(threadID int, filter string) ([]api.Variable, error) - // EvalSymbolFor returns a variable in the context of the specified thread. - EvalSymbolFor(threadID int, symbol string) (*api.Variable, error) + // EvalVariableFor returns a variable in the context of the specified thread. + EvalVariableFor(threadID int, symbol string) (*api.Variable, error) // ListSources lists all source files in the process matching filter. ListSources(filter string) ([]string, error) diff --git a/service/debugger/debugger.go b/service/debugger/debugger.go index 7590c295..b04b26af 100644 --- a/service/debugger/debugger.go +++ b/service/debugger/debugger.go @@ -426,14 +426,14 @@ func (d *Debugger) FunctionArguments(threadID int) ([]api.Variable, error) { return vars, err } -func (d *Debugger) EvalSymbolInThread(threadID int, symbol string) (*api.Variable, error) { +func (d *Debugger) EvalVariableInThread(threadID int, symbol string) (*api.Variable, error) { var variable *api.Variable err := d.withProcess(func(p *proctl.DebuggedProcess) error { thread, found := p.Threads[threadID] if !found { return fmt.Errorf("couldn't find thread %d", threadID) } - v, err := thread.EvalSymbol(symbol) + v, err := thread.EvalVariable(symbol) if err != nil { return err } diff --git a/service/rest/client.go b/service/rest/client.go index e0e4ae01..24734133 100644 --- a/service/rest/client.go +++ b/service/rest/client.go @@ -160,7 +160,7 @@ func (c *RESTClient) GetThread(id int) (*api.Thread, error) { return thread, nil } -func (c *RESTClient) EvalSymbol(symbol string) (*api.Variable, error) { +func (c *RESTClient) EvalVariable(symbol string) (*api.Variable, error) { var v *api.Variable err := c.doGET(fmt.Sprintf("/eval/%s", symbol), &v) if err != nil { @@ -169,7 +169,7 @@ func (c *RESTClient) EvalSymbol(symbol string) (*api.Variable, error) { return v, nil } -func (c *RESTClient) EvalSymbolFor(threadID int, symbol string) (*api.Variable, error) { +func (c *RESTClient) EvalVariableFor(threadID int, symbol string) (*api.Variable, error) { var v *api.Variable err := c.doGET(fmt.Sprintf("/threads/%d/eval/%s", threadID, symbol), &v) if err != nil { diff --git a/service/rest/server.go b/service/rest/server.go index 164b0320..7f0b566d 100644 --- a/service/rest/server.go +++ b/service/rest/server.go @@ -354,7 +354,7 @@ func (s *RESTServer) evalSymbol(request *restful.Request, response *restful.Resp return } - v, err := s.debugger.EvalSymbolInThread(current.ID, symbol) + v, err := s.debugger.EvalVariableInThread(current.ID, symbol) if err != nil { writeError(response, http.StatusInternalServerError, err.Error()) return @@ -382,7 +382,7 @@ func (s *RESTServer) evalThreadSymbol(request *restful.Request, response *restfu return } - v, err := s.debugger.EvalSymbolInThread(id, symbol) + v, err := s.debugger.EvalVariableInThread(id, symbol) if err != nil { writeError(response, http.StatusInternalServerError, err.Error()) return diff --git a/terminal/command.go b/terminal/command.go index 248f1560..ef8ad5e6 100644 --- a/terminal/command.go +++ b/terminal/command.go @@ -308,7 +308,7 @@ func printVar(client service.Client, args ...string) error { return fmt.Errorf("not enough arguments") } - val, err := client.EvalSymbol(args[0]) + val, err := client.EvalVariable(args[0]) if err != nil { return err }