提交 fe19f3f2 编写于 作者: D Derek Parker

Rename: s/EvalSymbol/EvalVariable/

上级 f627044f
......@@ -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
......
......@@ -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
......
......@@ -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")
}
......
......@@ -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)
......
......@@ -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
}
......
......@@ -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 {
......
......@@ -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
......
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册