diff --git a/proctl/proctl.go b/proctl/proctl.go index d6535d194c12e26c537f10fb59c00a98644cb2b6..4dfdf52eaf431c3a1c63b87589a009d313b9721a 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 55e3425b338587f1733c69cdfb9355624c270bfc..91b71cb980beac2114f16d3b3bbd010f7aafb2d2 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 fda9c075ad9a30448c4f7e15b7b747b570481968..1aada13f66bf714ca50af98091136dea42277480 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 785f6f62fed0320c14017d2757a2c781024823e9..7234881d76cefc7d90c5052c1c9033a30af704ff 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 7590c2952cf5c5e42b48c9fd07b4043fc11bfe79..b04b26afbe9f1750011c2fd105c9ca0e3cea66e9 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 e0e4ae01d51c21400fb5389d957ffa411a614a84..24734133f8b35eb70bfae7d48d75a0528b36702a 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 164b03200fb94baa43e85ebcda2f3fd0f69cde74..7f0b566dffb2e5f763041ac60f438c3bc62d48c1 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 248f15603394be433d71cc1c91f44ec1a6b82292..ef8ad5e6d3d93c4a329d2b5df09a029520fa81e6 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 }