id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
127,600 | labstack/echo | echo.go | File | func (e *Echo) File(path, file string, m ...MiddlewareFunc) *Route {
return e.file(path, file, e.GET, m...)
} | go | func (e *Echo) File(path, file string, m ...MiddlewareFunc) *Route {
return e.file(path, file, e.GET, m...)
} | [
"func",
"(",
"e",
"*",
"Echo",
")",
"File",
"(",
"path",
",",
"file",
"string",
",",
"m",
"...",
"MiddlewareFunc",
")",
"*",
"Route",
"{",
"return",
"e",
".",
"file",
"(",
"path",
",",
"file",
",",
"e",
".",
"GET",
",",
"m",
"...",
")",
"\n",
... | // File registers a new route with path to serve a static file with optional route-level middleware. | [
"File",
"registers",
"a",
"new",
"route",
"with",
"path",
"to",
"serve",
"a",
"static",
"file",
"with",
"optional",
"route",
"-",
"level",
"middleware",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L489-L491 |
127,601 | labstack/echo | echo.go | Add | func (e *Echo) Add(method, path string, handler HandlerFunc, middleware ...MiddlewareFunc) *Route {
return e.add("", method, path, handler, middleware...)
} | go | func (e *Echo) Add(method, path string, handler HandlerFunc, middleware ...MiddlewareFunc) *Route {
return e.add("", method, path, handler, middleware...)
} | [
"func",
"(",
"e",
"*",
"Echo",
")",
"Add",
"(",
"method",
",",
"path",
"string",
",",
"handler",
"HandlerFunc",
",",
"middleware",
"...",
"MiddlewareFunc",
")",
"*",
"Route",
"{",
"return",
"e",
".",
"add",
"(",
"\"",
"\"",
",",
"method",
",",
"path"... | // Add registers a new route for an HTTP method and path with matching handler
// in the router with optional route-level middleware. | [
"Add",
"registers",
"a",
"new",
"route",
"for",
"an",
"HTTP",
"method",
"and",
"path",
"with",
"matching",
"handler",
"in",
"the",
"router",
"with",
"optional",
"route",
"-",
"level",
"middleware",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L515-L517 |
127,602 | labstack/echo | echo.go | Host | func (e *Echo) Host(name string, m ...MiddlewareFunc) (g *Group) {
e.routers[name] = NewRouter(e)
g = &Group{host: name, echo: e}
g.Use(m...)
return
} | go | func (e *Echo) Host(name string, m ...MiddlewareFunc) (g *Group) {
e.routers[name] = NewRouter(e)
g = &Group{host: name, echo: e}
g.Use(m...)
return
} | [
"func",
"(",
"e",
"*",
"Echo",
")",
"Host",
"(",
"name",
"string",
",",
"m",
"...",
"MiddlewareFunc",
")",
"(",
"g",
"*",
"Group",
")",
"{",
"e",
".",
"routers",
"[",
"name",
"]",
"=",
"NewRouter",
"(",
"e",
")",
"\n",
"g",
"=",
"&",
"Group",
... | // Host creates a new router group for the provided host and optional host-level middleware. | [
"Host",
"creates",
"a",
"new",
"router",
"group",
"for",
"the",
"provided",
"host",
"and",
"optional",
"host",
"-",
"level",
"middleware",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L520-L525 |
127,603 | labstack/echo | echo.go | Group | func (e *Echo) Group(prefix string, m ...MiddlewareFunc) (g *Group) {
g = &Group{prefix: prefix, echo: e}
g.Use(m...)
return
} | go | func (e *Echo) Group(prefix string, m ...MiddlewareFunc) (g *Group) {
g = &Group{prefix: prefix, echo: e}
g.Use(m...)
return
} | [
"func",
"(",
"e",
"*",
"Echo",
")",
"Group",
"(",
"prefix",
"string",
",",
"m",
"...",
"MiddlewareFunc",
")",
"(",
"g",
"*",
"Group",
")",
"{",
"g",
"=",
"&",
"Group",
"{",
"prefix",
":",
"prefix",
",",
"echo",
":",
"e",
"}",
"\n",
"g",
".",
... | // Group creates a new router group with prefix and optional group-level middleware. | [
"Group",
"creates",
"a",
"new",
"router",
"group",
"with",
"prefix",
"and",
"optional",
"group",
"-",
"level",
"middleware",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L528-L532 |
127,604 | labstack/echo | echo.go | URL | func (e *Echo) URL(h HandlerFunc, params ...interface{}) string {
return e.URI(h, params...)
} | go | func (e *Echo) URL(h HandlerFunc, params ...interface{}) string {
return e.URI(h, params...)
} | [
"func",
"(",
"e",
"*",
"Echo",
")",
"URL",
"(",
"h",
"HandlerFunc",
",",
"params",
"...",
"interface",
"{",
"}",
")",
"string",
"{",
"return",
"e",
".",
"URI",
"(",
"h",
",",
"params",
"...",
")",
"\n",
"}"
] | // URL is an alias for `URI` function. | [
"URL",
"is",
"an",
"alias",
"for",
"URI",
"function",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L541-L543 |
127,605 | labstack/echo | echo.go | Reverse | func (e *Echo) Reverse(name string, params ...interface{}) string {
uri := new(bytes.Buffer)
ln := len(params)
n := 0
for _, r := range e.router.routes {
if r.Name == name {
for i, l := 0, len(r.Path); i < l; i++ {
if r.Path[i] == ':' && n < ln {
for ; i < l && r.Path[i] != '/'; i++ {
}
uri.... | go | func (e *Echo) Reverse(name string, params ...interface{}) string {
uri := new(bytes.Buffer)
ln := len(params)
n := 0
for _, r := range e.router.routes {
if r.Name == name {
for i, l := 0, len(r.Path); i < l; i++ {
if r.Path[i] == ':' && n < ln {
for ; i < l && r.Path[i] != '/'; i++ {
}
uri.... | [
"func",
"(",
"e",
"*",
"Echo",
")",
"Reverse",
"(",
"name",
"string",
",",
"params",
"...",
"interface",
"{",
"}",
")",
"string",
"{",
"uri",
":=",
"new",
"(",
"bytes",
".",
"Buffer",
")",
"\n",
"ln",
":=",
"len",
"(",
"params",
")",
"\n",
"n",
... | // Reverse generates an URL from route name and provided parameters. | [
"Reverse",
"generates",
"an",
"URL",
"from",
"route",
"name",
"and",
"provided",
"parameters",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L546-L567 |
127,606 | labstack/echo | echo.go | Routes | func (e *Echo) Routes() []*Route {
routes := make([]*Route, 0, len(e.router.routes))
for _, v := range e.router.routes {
routes = append(routes, v)
}
return routes
} | go | func (e *Echo) Routes() []*Route {
routes := make([]*Route, 0, len(e.router.routes))
for _, v := range e.router.routes {
routes = append(routes, v)
}
return routes
} | [
"func",
"(",
"e",
"*",
"Echo",
")",
"Routes",
"(",
")",
"[",
"]",
"*",
"Route",
"{",
"routes",
":=",
"make",
"(",
"[",
"]",
"*",
"Route",
",",
"0",
",",
"len",
"(",
"e",
".",
"router",
".",
"routes",
")",
")",
"\n",
"for",
"_",
",",
"v",
... | // Routes returns the registered routes. | [
"Routes",
"returns",
"the",
"registered",
"routes",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L570-L576 |
127,607 | labstack/echo | echo.go | Start | func (e *Echo) Start(address string) error {
e.Server.Addr = address
return e.StartServer(e.Server)
} | go | func (e *Echo) Start(address string) error {
e.Server.Addr = address
return e.StartServer(e.Server)
} | [
"func",
"(",
"e",
"*",
"Echo",
")",
"Start",
"(",
"address",
"string",
")",
"error",
"{",
"e",
".",
"Server",
".",
"Addr",
"=",
"address",
"\n",
"return",
"e",
".",
"StartServer",
"(",
"e",
".",
"Server",
")",
"\n",
"}"
] | // Start starts an HTTP server. | [
"Start",
"starts",
"an",
"HTTP",
"server",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L622-L625 |
127,608 | labstack/echo | echo.go | StartServer | func (e *Echo) StartServer(s *http.Server) (err error) {
// Setup
e.colorer.SetOutput(e.Logger.Output())
s.ErrorLog = e.StdLogger
s.Handler = e
if e.Debug {
e.Logger.SetLevel(log.DEBUG)
}
if !e.HideBanner {
e.colorer.Printf(banner, e.colorer.Red("v"+Version), e.colorer.Blue(website))
}
if s.TLSConfig == ... | go | func (e *Echo) StartServer(s *http.Server) (err error) {
// Setup
e.colorer.SetOutput(e.Logger.Output())
s.ErrorLog = e.StdLogger
s.Handler = e
if e.Debug {
e.Logger.SetLevel(log.DEBUG)
}
if !e.HideBanner {
e.colorer.Printf(banner, e.colorer.Red("v"+Version), e.colorer.Blue(website))
}
if s.TLSConfig == ... | [
"func",
"(",
"e",
"*",
"Echo",
")",
"StartServer",
"(",
"s",
"*",
"http",
".",
"Server",
")",
"(",
"err",
"error",
")",
"{",
"// Setup",
"e",
".",
"colorer",
".",
"SetOutput",
"(",
"e",
".",
"Logger",
".",
"Output",
"(",
")",
")",
"\n",
"s",
".... | // StartServer starts a custom http server. | [
"StartServer",
"starts",
"a",
"custom",
"http",
"server",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L681-L717 |
127,609 | labstack/echo | echo.go | NewHTTPError | func NewHTTPError(code int, message ...interface{}) *HTTPError {
he := &HTTPError{Code: code, Message: http.StatusText(code)}
if len(message) > 0 {
he.Message = message[0]
}
return he
} | go | func NewHTTPError(code int, message ...interface{}) *HTTPError {
he := &HTTPError{Code: code, Message: http.StatusText(code)}
if len(message) > 0 {
he.Message = message[0]
}
return he
} | [
"func",
"NewHTTPError",
"(",
"code",
"int",
",",
"message",
"...",
"interface",
"{",
"}",
")",
"*",
"HTTPError",
"{",
"he",
":=",
"&",
"HTTPError",
"{",
"Code",
":",
"code",
",",
"Message",
":",
"http",
".",
"StatusText",
"(",
"code",
")",
"}",
"\n",... | // NewHTTPError creates a new HTTPError instance. | [
"NewHTTPError",
"creates",
"a",
"new",
"HTTPError",
"instance",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L738-L744 |
127,610 | labstack/echo | echo.go | Error | func (he *HTTPError) Error() string {
return fmt.Sprintf("code=%d, message=%v", he.Code, he.Message)
} | go | func (he *HTTPError) Error() string {
return fmt.Sprintf("code=%d, message=%v", he.Code, he.Message)
} | [
"func",
"(",
"he",
"*",
"HTTPError",
")",
"Error",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"he",
".",
"Code",
",",
"he",
".",
"Message",
")",
"\n",
"}"
] | // Error makes it compatible with `error` interface. | [
"Error",
"makes",
"it",
"compatible",
"with",
"error",
"interface",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L747-L749 |
127,611 | labstack/echo | echo.go | SetInternal | func (he *HTTPError) SetInternal(err error) *HTTPError {
he.Internal = err
return he
} | go | func (he *HTTPError) SetInternal(err error) *HTTPError {
he.Internal = err
return he
} | [
"func",
"(",
"he",
"*",
"HTTPError",
")",
"SetInternal",
"(",
"err",
"error",
")",
"*",
"HTTPError",
"{",
"he",
".",
"Internal",
"=",
"err",
"\n",
"return",
"he",
"\n",
"}"
] | // SetInternal sets error to HTTPError.Internal | [
"SetInternal",
"sets",
"error",
"to",
"HTTPError",
".",
"Internal"
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L752-L755 |
127,612 | labstack/echo | echo.go | WrapHandler | func WrapHandler(h http.Handler) HandlerFunc {
return func(c Context) error {
h.ServeHTTP(c.Response(), c.Request())
return nil
}
} | go | func WrapHandler(h http.Handler) HandlerFunc {
return func(c Context) error {
h.ServeHTTP(c.Response(), c.Request())
return nil
}
} | [
"func",
"WrapHandler",
"(",
"h",
"http",
".",
"Handler",
")",
"HandlerFunc",
"{",
"return",
"func",
"(",
"c",
"Context",
")",
"error",
"{",
"h",
".",
"ServeHTTP",
"(",
"c",
".",
"Response",
"(",
")",
",",
"c",
".",
"Request",
"(",
")",
")",
"\n",
... | // WrapHandler wraps `http.Handler` into `echo.HandlerFunc`. | [
"WrapHandler",
"wraps",
"http",
".",
"Handler",
"into",
"echo",
".",
"HandlerFunc",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/echo.go#L758-L763 |
127,613 | labstack/echo | middleware/jwt.go | jwtFromHeader | func jwtFromHeader(header string, authScheme string) jwtExtractor {
return func(c echo.Context) (string, error) {
auth := c.Request().Header.Get(header)
l := len(authScheme)
if len(auth) > l+1 && auth[:l] == authScheme {
return auth[l+1:], nil
}
return "", ErrJWTMissing
}
} | go | func jwtFromHeader(header string, authScheme string) jwtExtractor {
return func(c echo.Context) (string, error) {
auth := c.Request().Header.Get(header)
l := len(authScheme)
if len(auth) > l+1 && auth[:l] == authScheme {
return auth[l+1:], nil
}
return "", ErrJWTMissing
}
} | [
"func",
"jwtFromHeader",
"(",
"header",
"string",
",",
"authScheme",
"string",
")",
"jwtExtractor",
"{",
"return",
"func",
"(",
"c",
"echo",
".",
"Context",
")",
"(",
"string",
",",
"error",
")",
"{",
"auth",
":=",
"c",
".",
"Request",
"(",
")",
".",
... | // jwtFromHeader returns a `jwtExtractor` that extracts token from the request header. | [
"jwtFromHeader",
"returns",
"a",
"jwtExtractor",
"that",
"extracts",
"token",
"from",
"the",
"request",
"header",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/middleware/jwt.go#L196-L205 |
127,614 | labstack/echo | middleware/jwt.go | jwtFromQuery | func jwtFromQuery(param string) jwtExtractor {
return func(c echo.Context) (string, error) {
token := c.QueryParam(param)
if token == "" {
return "", ErrJWTMissing
}
return token, nil
}
} | go | func jwtFromQuery(param string) jwtExtractor {
return func(c echo.Context) (string, error) {
token := c.QueryParam(param)
if token == "" {
return "", ErrJWTMissing
}
return token, nil
}
} | [
"func",
"jwtFromQuery",
"(",
"param",
"string",
")",
"jwtExtractor",
"{",
"return",
"func",
"(",
"c",
"echo",
".",
"Context",
")",
"(",
"string",
",",
"error",
")",
"{",
"token",
":=",
"c",
".",
"QueryParam",
"(",
"param",
")",
"\n",
"if",
"token",
"... | // jwtFromQuery returns a `jwtExtractor` that extracts token from the query string. | [
"jwtFromQuery",
"returns",
"a",
"jwtExtractor",
"that",
"extracts",
"token",
"from",
"the",
"query",
"string",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/middleware/jwt.go#L208-L216 |
127,615 | labstack/echo | middleware/jwt.go | jwtFromCookie | func jwtFromCookie(name string) jwtExtractor {
return func(c echo.Context) (string, error) {
cookie, err := c.Cookie(name)
if err != nil {
return "", ErrJWTMissing
}
return cookie.Value, nil
}
} | go | func jwtFromCookie(name string) jwtExtractor {
return func(c echo.Context) (string, error) {
cookie, err := c.Cookie(name)
if err != nil {
return "", ErrJWTMissing
}
return cookie.Value, nil
}
} | [
"func",
"jwtFromCookie",
"(",
"name",
"string",
")",
"jwtExtractor",
"{",
"return",
"func",
"(",
"c",
"echo",
".",
"Context",
")",
"(",
"string",
",",
"error",
")",
"{",
"cookie",
",",
"err",
":=",
"c",
".",
"Cookie",
"(",
"name",
")",
"\n",
"if",
... | // jwtFromCookie returns a `jwtExtractor` that extracts token from the named cookie. | [
"jwtFromCookie",
"returns",
"a",
"jwtExtractor",
"that",
"extracts",
"token",
"from",
"the",
"named",
"cookie",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/middleware/jwt.go#L219-L227 |
127,616 | labstack/echo | middleware/static.go | Static | func Static(root string) echo.MiddlewareFunc {
c := DefaultStaticConfig
c.Root = root
return StaticWithConfig(c)
} | go | func Static(root string) echo.MiddlewareFunc {
c := DefaultStaticConfig
c.Root = root
return StaticWithConfig(c)
} | [
"func",
"Static",
"(",
"root",
"string",
")",
"echo",
".",
"MiddlewareFunc",
"{",
"c",
":=",
"DefaultStaticConfig",
"\n",
"c",
".",
"Root",
"=",
"root",
"\n",
"return",
"StaticWithConfig",
"(",
"c",
")",
"\n",
"}"
] | // Static returns a Static middleware to serves static content from the provided
// root directory. | [
"Static",
"returns",
"a",
"Static",
"middleware",
"to",
"serves",
"static",
"content",
"from",
"the",
"provided",
"root",
"directory",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/middleware/static.go#L124-L128 |
127,617 | labstack/echo | middleware/request_id.go | RequestIDWithConfig | func RequestIDWithConfig(config RequestIDConfig) echo.MiddlewareFunc {
// Defaults
if config.Skipper == nil {
config.Skipper = DefaultRequestIDConfig.Skipper
}
if config.Generator == nil {
config.Generator = generator
}
return func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error... | go | func RequestIDWithConfig(config RequestIDConfig) echo.MiddlewareFunc {
// Defaults
if config.Skipper == nil {
config.Skipper = DefaultRequestIDConfig.Skipper
}
if config.Generator == nil {
config.Generator = generator
}
return func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error... | [
"func",
"RequestIDWithConfig",
"(",
"config",
"RequestIDConfig",
")",
"echo",
".",
"MiddlewareFunc",
"{",
"// Defaults",
"if",
"config",
".",
"Skipper",
"==",
"nil",
"{",
"config",
".",
"Skipper",
"=",
"DefaultRequestIDConfig",
".",
"Skipper",
"\n",
"}",
"\n",
... | // RequestIDWithConfig returns a X-Request-ID middleware with config. | [
"RequestIDWithConfig",
"returns",
"a",
"X",
"-",
"Request",
"-",
"ID",
"middleware",
"with",
"config",
"."
] | 5d2c33ad5dbb78540a56dd08d09d91f991bc3156 | https://github.com/labstack/echo/blob/5d2c33ad5dbb78540a56dd08d09d91f991bc3156/middleware/request_id.go#L34-L60 |
127,618 | go-delve/delve | pkg/dwarf/frame/table.go | executeDwarfProgramUntilPC | func executeDwarfProgramUntilPC(fde *FrameDescriptionEntry, pc uint64) *FrameContext {
frame := executeCIEInstructions(fde.CIE)
frame.order = fde.order
frame.loc = fde.Begin()
frame.address = pc
frame.ExecuteUntilPC(fde.Instructions)
return frame
} | go | func executeDwarfProgramUntilPC(fde *FrameDescriptionEntry, pc uint64) *FrameContext {
frame := executeCIEInstructions(fde.CIE)
frame.order = fde.order
frame.loc = fde.Begin()
frame.address = pc
frame.ExecuteUntilPC(fde.Instructions)
return frame
} | [
"func",
"executeDwarfProgramUntilPC",
"(",
"fde",
"*",
"FrameDescriptionEntry",
",",
"pc",
"uint64",
")",
"*",
"FrameContext",
"{",
"frame",
":=",
"executeCIEInstructions",
"(",
"fde",
".",
"CIE",
")",
"\n",
"frame",
".",
"order",
"=",
"fde",
".",
"order",
"... | // Unwind the stack to find the return address register. | [
"Unwind",
"the",
"stack",
"to",
"find",
"the",
"return",
"address",
"register",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/frame/table.go#L135-L143 |
127,619 | go-delve/delve | pkg/dwarf/frame/table.go | ExecuteUntilPC | func (frame *FrameContext) ExecuteUntilPC(instructions []byte) {
frame.buf.Truncate(0)
frame.buf.Write(instructions)
// We only need to execute the instructions until
// ctx.loc > ctx.address (which is the address we
// are currently at in the traced process).
for frame.address >= frame.loc && frame.buf.Len() > ... | go | func (frame *FrameContext) ExecuteUntilPC(instructions []byte) {
frame.buf.Truncate(0)
frame.buf.Write(instructions)
// We only need to execute the instructions until
// ctx.loc > ctx.address (which is the address we
// are currently at in the traced process).
for frame.address >= frame.loc && frame.buf.Len() > ... | [
"func",
"(",
"frame",
"*",
"FrameContext",
")",
"ExecuteUntilPC",
"(",
"instructions",
"[",
"]",
"byte",
")",
"{",
"frame",
".",
"buf",
".",
"Truncate",
"(",
"0",
")",
"\n",
"frame",
".",
"buf",
".",
"Write",
"(",
"instructions",
")",
"\n\n",
"// We on... | // Execute dwarf instructions. | [
"Execute",
"dwarf",
"instructions",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/frame/table.go#L152-L162 |
127,620 | go-delve/delve | pkg/dwarf/frame/entries.go | Cover | func (fde *FrameDescriptionEntry) Cover(addr uint64) bool {
return (addr - fde.begin) < fde.size
} | go | func (fde *FrameDescriptionEntry) Cover(addr uint64) bool {
return (addr - fde.begin) < fde.size
} | [
"func",
"(",
"fde",
"*",
"FrameDescriptionEntry",
")",
"Cover",
"(",
"addr",
"uint64",
")",
"bool",
"{",
"return",
"(",
"addr",
"-",
"fde",
".",
"begin",
")",
"<",
"fde",
".",
"size",
"\n",
"}"
] | // Returns whether or not the given address is within the
// bounds of this frame. | [
"Returns",
"whether",
"or",
"not",
"the",
"given",
"address",
"is",
"within",
"the",
"bounds",
"of",
"this",
"frame",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/frame/entries.go#L35-L37 |
127,621 | go-delve/delve | pkg/dwarf/frame/entries.go | FDEForPC | func (fdes FrameDescriptionEntries) FDEForPC(pc uint64) (*FrameDescriptionEntry, error) {
idx := sort.Search(len(fdes), func(i int) bool {
return fdes[i].Cover(pc) || fdes[i].Begin() >= pc
})
if idx == len(fdes) || !fdes[idx].Cover(pc) {
return nil, &ErrNoFDEForPC{pc}
}
return fdes[idx], nil
} | go | func (fdes FrameDescriptionEntries) FDEForPC(pc uint64) (*FrameDescriptionEntry, error) {
idx := sort.Search(len(fdes), func(i int) bool {
return fdes[i].Cover(pc) || fdes[i].Begin() >= pc
})
if idx == len(fdes) || !fdes[idx].Cover(pc) {
return nil, &ErrNoFDEForPC{pc}
}
return fdes[idx], nil
} | [
"func",
"(",
"fdes",
"FrameDescriptionEntries",
")",
"FDEForPC",
"(",
"pc",
"uint64",
")",
"(",
"*",
"FrameDescriptionEntry",
",",
"error",
")",
"{",
"idx",
":=",
"sort",
".",
"Search",
"(",
"len",
"(",
"fdes",
")",
",",
"func",
"(",
"i",
"int",
")",
... | // Returns the Frame Description Entry for the given PC. | [
"Returns",
"the",
"Frame",
"Description",
"Entry",
"for",
"the",
"given",
"PC",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/frame/entries.go#L69-L77 |
127,622 | go-delve/delve | pkg/proc/native/ptrace_darwin.go | PtraceDetach | func PtraceDetach(tid, sig int) error {
return ptrace(sys.PT_DETACH, tid, 1, uintptr(sig))
} | go | func PtraceDetach(tid, sig int) error {
return ptrace(sys.PT_DETACH, tid, 1, uintptr(sig))
} | [
"func",
"PtraceDetach",
"(",
"tid",
",",
"sig",
"int",
")",
"error",
"{",
"return",
"ptrace",
"(",
"sys",
".",
"PT_DETACH",
",",
"tid",
",",
"1",
",",
"uintptr",
"(",
"sig",
")",
")",
"\n",
"}"
] | // PtraceDetach executes the PT_DETACH ptrace call. | [
"PtraceDetach",
"executes",
"the",
"PT_DETACH",
"ptrace",
"call",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/ptrace_darwin.go#L13-L15 |
127,623 | go-delve/delve | pkg/dwarf/godwarf/type.go | ReadType | func ReadType(d *dwarf.Data, off dwarf.Offset, typeCache map[dwarf.Offset]Type) (Type, error) {
return readType(d, "info", d.Reader(), off, typeCache)
} | go | func ReadType(d *dwarf.Data, off dwarf.Offset, typeCache map[dwarf.Offset]Type) (Type, error) {
return readType(d, "info", d.Reader(), off, typeCache)
} | [
"func",
"ReadType",
"(",
"d",
"*",
"dwarf",
".",
"Data",
",",
"off",
"dwarf",
".",
"Offset",
",",
"typeCache",
"map",
"[",
"dwarf",
".",
"Offset",
"]",
"Type",
")",
"(",
"Type",
",",
"error",
")",
"{",
"return",
"readType",
"(",
"d",
",",
"\"",
"... | // Type reads the type at off in the DWARF ``info'' section. | [
"Type",
"reads",
"the",
"type",
"at",
"off",
"in",
"the",
"DWARF",
"info",
"section",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/dwarf/godwarf/type.go#L481-L483 |
127,624 | go-delve/delve | pkg/proc/gdbserial/rr.go | Record | func Record(cmd []string, wd string, quiet bool) (tracedir string, err error) {
if err := checkRRAvailabe(); err != nil {
return "", err
}
rfd, wfd, err := os.Pipe()
if err != nil {
return "", err
}
args := make([]string, 0, len(cmd)+2)
args = append(args, "record", "--print-trace-dir=3")
args = append(ar... | go | func Record(cmd []string, wd string, quiet bool) (tracedir string, err error) {
if err := checkRRAvailabe(); err != nil {
return "", err
}
rfd, wfd, err := os.Pipe()
if err != nil {
return "", err
}
args := make([]string, 0, len(cmd)+2)
args = append(args, "record", "--print-trace-dir=3")
args = append(ar... | [
"func",
"Record",
"(",
"cmd",
"[",
"]",
"string",
",",
"wd",
"string",
",",
"quiet",
"bool",
")",
"(",
"tracedir",
"string",
",",
"err",
"error",
")",
"{",
"if",
"err",
":=",
"checkRRAvailabe",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"\""... | // Record uses rr to record the execution of the specified program and
// returns the trace directory's path. | [
"Record",
"uses",
"rr",
"to",
"record",
"the",
"execution",
"of",
"the",
"specified",
"program",
"and",
"returns",
"the",
"trace",
"directory",
"s",
"path",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/rr.go#L18-L52 |
127,625 | go-delve/delve | pkg/proc/gdbserial/rr.go | Replay | func Replay(tracedir string, quiet bool, debugInfoDirs []string) (*Process, error) {
if err := checkRRAvailabe(); err != nil {
return nil, err
}
rrcmd := exec.Command("rr", "replay", "--dbgport=0", tracedir)
rrcmd.Stdout = os.Stdout
stderr, err := rrcmd.StderrPipe()
if err != nil {
return nil, err
}
rrcmd.... | go | func Replay(tracedir string, quiet bool, debugInfoDirs []string) (*Process, error) {
if err := checkRRAvailabe(); err != nil {
return nil, err
}
rrcmd := exec.Command("rr", "replay", "--dbgport=0", tracedir)
rrcmd.Stdout = os.Stdout
stderr, err := rrcmd.StderrPipe()
if err != nil {
return nil, err
}
rrcmd.... | [
"func",
"Replay",
"(",
"tracedir",
"string",
",",
"quiet",
"bool",
",",
"debugInfoDirs",
"[",
"]",
"string",
")",
"(",
"*",
"Process",
",",
"error",
")",
"{",
"if",
"err",
":=",
"checkRRAvailabe",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"ni... | // Replay starts an instance of rr in replay mode, with the specified trace
// directory, and connects to it. | [
"Replay",
"starts",
"an",
"instance",
"of",
"rr",
"in",
"replay",
"mode",
"with",
"the",
"specified",
"trace",
"directory",
"and",
"connects",
"to",
"it",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/rr.go#L56-L92 |
127,626 | go-delve/delve | pkg/proc/gdbserial/rr.go | RecordAndReplay | func RecordAndReplay(cmd []string, wd string, quiet bool, debugInfoDirs []string) (p *Process, tracedir string, err error) {
tracedir, err = Record(cmd, wd, quiet)
if tracedir == "" {
return nil, "", err
}
p, err = Replay(tracedir, quiet, debugInfoDirs)
return p, tracedir, err
} | go | func RecordAndReplay(cmd []string, wd string, quiet bool, debugInfoDirs []string) (p *Process, tracedir string, err error) {
tracedir, err = Record(cmd, wd, quiet)
if tracedir == "" {
return nil, "", err
}
p, err = Replay(tracedir, quiet, debugInfoDirs)
return p, tracedir, err
} | [
"func",
"RecordAndReplay",
"(",
"cmd",
"[",
"]",
"string",
",",
"wd",
"string",
",",
"quiet",
"bool",
",",
"debugInfoDirs",
"[",
"]",
"string",
")",
"(",
"p",
"*",
"Process",
",",
"tracedir",
"string",
",",
"err",
"error",
")",
"{",
"tracedir",
",",
... | // RecordAndReplay acts like calling Record and then Replay. | [
"RecordAndReplay",
"acts",
"like",
"calling",
"Record",
"and",
"then",
"Replay",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/rr.go#L260-L267 |
127,627 | go-delve/delve | service/listenerpipe.go | ListenerPipe | func ListenerPipe() (net.Listener, net.Conn) {
conn0, conn1 := net.Pipe()
return &preconnectedListener{conn: conn0, closech: make(chan struct{})}, conn1
} | go | func ListenerPipe() (net.Listener, net.Conn) {
conn0, conn1 := net.Pipe()
return &preconnectedListener{conn: conn0, closech: make(chan struct{})}, conn1
} | [
"func",
"ListenerPipe",
"(",
")",
"(",
"net",
".",
"Listener",
",",
"net",
".",
"Conn",
")",
"{",
"conn0",
",",
"conn1",
":=",
"net",
".",
"Pipe",
"(",
")",
"\n",
"return",
"&",
"preconnectedListener",
"{",
"conn",
":",
"conn0",
",",
"closech",
":",
... | // ListenerPipe returns a full-duplex in-memory connection, like net.Pipe.
// Unlike net.Pipe one end of the connection is returned as an object
// satisfying the net.Listener interface.
// The first call to the Accept method of this object will return a net.Conn
// connected to the other net.Conn returned by ListenerP... | [
"ListenerPipe",
"returns",
"a",
"full",
"-",
"duplex",
"in",
"-",
"memory",
"connection",
"like",
"net",
".",
"Pipe",
".",
"Unlike",
"net",
".",
"Pipe",
"one",
"end",
"of",
"the",
"connection",
"is",
"returned",
"as",
"an",
"object",
"satisfying",
"the",
... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/listenerpipe.go#L15-L18 |
127,628 | go-delve/delve | service/listenerpipe.go | Accept | func (l *preconnectedListener) Accept() (net.Conn, error) {
l.acceptMu.Lock()
defer l.acceptMu.Unlock()
if !l.accepted {
l.accepted = true
return l.conn, nil
}
<-l.closech
return nil, errors.New("accept failed: listener closed")
} | go | func (l *preconnectedListener) Accept() (net.Conn, error) {
l.acceptMu.Lock()
defer l.acceptMu.Unlock()
if !l.accepted {
l.accepted = true
return l.conn, nil
}
<-l.closech
return nil, errors.New("accept failed: listener closed")
} | [
"func",
"(",
"l",
"*",
"preconnectedListener",
")",
"Accept",
"(",
")",
"(",
"net",
".",
"Conn",
",",
"error",
")",
"{",
"l",
".",
"acceptMu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"acceptMu",
".",
"Unlock",
"(",
")",
"\n",
"if",
"!",
... | // Accept returns the pre-established connection the first time it's called,
// it blocks until the listener is closed on every subsequent call. | [
"Accept",
"returns",
"the",
"pre",
"-",
"established",
"connection",
"the",
"first",
"time",
"it",
"s",
"called",
"it",
"blocks",
"until",
"the",
"listener",
"is",
"closed",
"on",
"every",
"subsequent",
"call",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/listenerpipe.go#L34-L43 |
127,629 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | New | func New(process *os.Process) *Process {
logger := logflags.GdbWireLogger()
p := &Process{
conn: gdbConn{
maxTransmitAttempts: maxTransmitAttempts,
inbuf: make([]byte, 0, initialInputBufferSize),
direction: proc.Forward,
log: logger,
},
threads: make(ma... | go | func New(process *os.Process) *Process {
logger := logflags.GdbWireLogger()
p := &Process{
conn: gdbConn{
maxTransmitAttempts: maxTransmitAttempts,
inbuf: make([]byte, 0, initialInputBufferSize),
direction: proc.Forward,
log: logger,
},
threads: make(ma... | [
"func",
"New",
"(",
"process",
"*",
"os",
".",
"Process",
")",
"*",
"Process",
"{",
"logger",
":=",
"logflags",
".",
"GdbWireLogger",
"(",
")",
"\n",
"p",
":=",
"&",
"Process",
"{",
"conn",
":",
"gdbConn",
"{",
"maxTransmitAttempts",
":",
"maxTransmitAtt... | // New creates a new Process instance.
// If process is not nil it is the stub's process and will be killed after
// Detach.
// Use Listen, Dial or Connect to complete connection. | [
"New",
"creates",
"a",
"new",
"Process",
"instance",
".",
"If",
"process",
"is",
"not",
"nil",
"it",
"is",
"the",
"stub",
"s",
"process",
"and",
"will",
"be",
"killed",
"after",
"Detach",
".",
"Use",
"Listen",
"Dial",
"or",
"Connect",
"to",
"complete",
... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L170-L197 |
127,630 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Listen | func (p *Process) Listen(listener net.Listener, path string, pid int, debugInfoDirs []string) error {
acceptChan := make(chan net.Conn)
go func() {
conn, _ := listener.Accept()
acceptChan <- conn
}()
select {
case conn := <-acceptChan:
listener.Close()
if conn == nil {
return errors.New("could not con... | go | func (p *Process) Listen(listener net.Listener, path string, pid int, debugInfoDirs []string) error {
acceptChan := make(chan net.Conn)
go func() {
conn, _ := listener.Accept()
acceptChan <- conn
}()
select {
case conn := <-acceptChan:
listener.Close()
if conn == nil {
return errors.New("could not con... | [
"func",
"(",
"p",
"*",
"Process",
")",
"Listen",
"(",
"listener",
"net",
".",
"Listener",
",",
"path",
"string",
",",
"pid",
"int",
",",
"debugInfoDirs",
"[",
"]",
"string",
")",
"error",
"{",
"acceptChan",
":=",
"make",
"(",
"chan",
"net",
".",
"Con... | // Listen waits for a connection from the stub. | [
"Listen",
"waits",
"for",
"a",
"connection",
"from",
"the",
"stub",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L200-L219 |
127,631 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Dial | func (p *Process) Dial(addr string, path string, pid int, debugInfoDirs []string) error {
for {
conn, err := net.Dial("tcp", addr)
if err == nil {
return p.Connect(conn, path, pid, debugInfoDirs)
}
select {
case status := <-p.waitChan:
return fmt.Errorf("stub exited while attempting to connect: %v", st... | go | func (p *Process) Dial(addr string, path string, pid int, debugInfoDirs []string) error {
for {
conn, err := net.Dial("tcp", addr)
if err == nil {
return p.Connect(conn, path, pid, debugInfoDirs)
}
select {
case status := <-p.waitChan:
return fmt.Errorf("stub exited while attempting to connect: %v", st... | [
"func",
"(",
"p",
"*",
"Process",
")",
"Dial",
"(",
"addr",
"string",
",",
"path",
"string",
",",
"pid",
"int",
",",
"debugInfoDirs",
"[",
"]",
"string",
")",
"error",
"{",
"for",
"{",
"conn",
",",
"err",
":=",
"net",
".",
"Dial",
"(",
"\"",
"\""... | // Dial attempts to connect to the stub. | [
"Dial",
"attempts",
"to",
"connect",
"to",
"the",
"stub",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L222-L235 |
127,632 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Connect | func (p *Process) Connect(conn net.Conn, path string, pid int, debugInfoDirs []string) error {
p.conn.conn = conn
p.conn.pid = pid
err := p.conn.handshake()
if err != nil {
conn.Close()
return err
}
if verbuf, err := p.conn.exec([]byte("$qGDBServerVersion"), "init"); err == nil {
for _, v := range strings.... | go | func (p *Process) Connect(conn net.Conn, path string, pid int, debugInfoDirs []string) error {
p.conn.conn = conn
p.conn.pid = pid
err := p.conn.handshake()
if err != nil {
conn.Close()
return err
}
if verbuf, err := p.conn.exec([]byte("$qGDBServerVersion"), "init"); err == nil {
for _, v := range strings.... | [
"func",
"(",
"p",
"*",
"Process",
")",
"Connect",
"(",
"conn",
"net",
".",
"Conn",
",",
"path",
"string",
",",
"pid",
"int",
",",
"debugInfoDirs",
"[",
"]",
"string",
")",
"error",
"{",
"p",
".",
"conn",
".",
"conn",
"=",
"conn",
"\n",
"p",
".",
... | // Connect connects to a stub and performs a handshake.
//
// Path and pid are, respectively, the path to the executable of the target
// program and the PID of the target process, both are optional, however
// some stubs do not provide ways to determine path and pid automatically
// and Connect will be unable to funct... | [
"Connect",
"connects",
"to",
"a",
"stub",
"and",
"performs",
"a",
"handshake",
".",
"Path",
"and",
"pid",
"are",
"respectively",
"the",
"path",
"to",
"the",
"executable",
"of",
"the",
"target",
"program",
"and",
"the",
"PID",
"of",
"the",
"target",
"proces... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L243-L282 |
127,633 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | initialize | func (p *Process) initialize(path string, debugInfoDirs []string) error {
var err error
if path == "" {
// If we are attaching to a running process and the user didn't specify
// the executable file manually we must ask the stub for it.
// We support both qXfer:exec-file:read:: (the gdb way) and calling
// qP... | go | func (p *Process) initialize(path string, debugInfoDirs []string) error {
var err error
if path == "" {
// If we are attaching to a running process and the user didn't specify
// the executable file manually we must ask the stub for it.
// We support both qXfer:exec-file:read:: (the gdb way) and calling
// qP... | [
"func",
"(",
"p",
"*",
"Process",
")",
"initialize",
"(",
"path",
"string",
",",
"debugInfoDirs",
"[",
"]",
"string",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"if",
"path",
"==",
"\"",
"\"",
"{",
"// If we are attaching to a running process and the user... | // initialize uses qProcessInfo to load the inferior's PID and
// executable path. This command is not supported by all stubs and not all
// stubs will report both the PID and executable path. | [
"initialize",
"uses",
"qProcessInfo",
"to",
"load",
"the",
"inferior",
"s",
"PID",
"and",
"executable",
"path",
".",
"This",
"command",
"is",
"not",
"supported",
"by",
"all",
"stubs",
"and",
"not",
"all",
"stubs",
"will",
"report",
"both",
"the",
"PID",
"a... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L476-L531 |
127,634 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Valid | func (p *Process) Valid() (bool, error) {
if p.detached {
return false, &proc.ProcessDetachedError{}
}
if p.exited {
return false, &proc.ErrProcessExited{Pid: p.Pid()}
}
return true, nil
} | go | func (p *Process) Valid() (bool, error) {
if p.detached {
return false, &proc.ProcessDetachedError{}
}
if p.exited {
return false, &proc.ErrProcessExited{Pid: p.Pid()}
}
return true, nil
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"Valid",
"(",
")",
"(",
"bool",
",",
"error",
")",
"{",
"if",
"p",
".",
"detached",
"{",
"return",
"false",
",",
"&",
"proc",
".",
"ProcessDetachedError",
"{",
"}",
"\n",
"}",
"\n",
"if",
"p",
".",
"exited",... | // Valid returns true if we are not detached
// and the process has not exited. | [
"Valid",
"returns",
"true",
"if",
"we",
"are",
"not",
"detached",
"and",
"the",
"process",
"has",
"not",
"exited",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L563-L571 |
127,635 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | FindThread | func (p *Process) FindThread(threadID int) (proc.Thread, bool) {
thread, ok := p.threads[threadID]
return thread, ok
} | go | func (p *Process) FindThread(threadID int) (proc.Thread, bool) {
thread, ok := p.threads[threadID]
return thread, ok
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"FindThread",
"(",
"threadID",
"int",
")",
"(",
"proc",
".",
"Thread",
",",
"bool",
")",
"{",
"thread",
",",
"ok",
":=",
"p",
".",
"threads",
"[",
"threadID",
"]",
"\n",
"return",
"thread",
",",
"ok",
"\n",
... | // FindThread returns the thread with the given ID. | [
"FindThread",
"returns",
"the",
"thread",
"with",
"the",
"given",
"ID",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L580-L583 |
127,636 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | ThreadList | func (p *Process) ThreadList() []proc.Thread {
r := make([]proc.Thread, 0, len(p.threads))
for _, thread := range p.threads {
r = append(r, thread)
}
return r
} | go | func (p *Process) ThreadList() []proc.Thread {
r := make([]proc.Thread, 0, len(p.threads))
for _, thread := range p.threads {
r = append(r, thread)
}
return r
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"ThreadList",
"(",
")",
"[",
"]",
"proc",
".",
"Thread",
"{",
"r",
":=",
"make",
"(",
"[",
"]",
"proc",
".",
"Thread",
",",
"0",
",",
"len",
"(",
"p",
".",
"threads",
")",
")",
"\n",
"for",
"_",
",",
"... | // ThreadList returns all threads in the process. | [
"ThreadList",
"returns",
"all",
"threads",
"in",
"the",
"process",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L586-L592 |
127,637 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | ContinueOnce | func (p *Process) ContinueOnce() (proc.Thread, error) {
if p.exited {
return nil, &proc.ErrProcessExited{Pid: p.conn.pid}
}
if p.conn.direction == proc.Forward {
// step threads stopped at any breakpoint over their breakpoint
for _, thread := range p.threads {
if thread.CurrentBreakpoint.Breakpoint != nil ... | go | func (p *Process) ContinueOnce() (proc.Thread, error) {
if p.exited {
return nil, &proc.ErrProcessExited{Pid: p.conn.pid}
}
if p.conn.direction == proc.Forward {
// step threads stopped at any breakpoint over their breakpoint
for _, thread := range p.threads {
if thread.CurrentBreakpoint.Breakpoint != nil ... | [
"func",
"(",
"p",
"*",
"Process",
")",
"ContinueOnce",
"(",
")",
"(",
"proc",
".",
"Thread",
",",
"error",
")",
"{",
"if",
"p",
".",
"exited",
"{",
"return",
"nil",
",",
"&",
"proc",
".",
"ErrProcessExited",
"{",
"Pid",
":",
"p",
".",
"conn",
"."... | // ContinueOnce will continue execution of the process until
// a breakpoint is hit or signal is received. | [
"ContinueOnce",
"will",
"continue",
"execution",
"of",
"the",
"process",
"until",
"a",
"breakpoint",
"is",
"hit",
"or",
"signal",
"is",
"received",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L619-L731 |
127,638 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | StepInstruction | func (p *Process) StepInstruction() error {
thread := p.currentThread
if p.selectedGoroutine != nil {
if p.selectedGoroutine.Thread == nil {
if _, err := p.SetBreakpoint(p.selectedGoroutine.PC, proc.NextBreakpoint, proc.SameGoroutineCondition(p.selectedGoroutine)); err != nil {
return err
}
return proc... | go | func (p *Process) StepInstruction() error {
thread := p.currentThread
if p.selectedGoroutine != nil {
if p.selectedGoroutine.Thread == nil {
if _, err := p.SetBreakpoint(p.selectedGoroutine.PC, proc.NextBreakpoint, proc.SameGoroutineCondition(p.selectedGoroutine)); err != nil {
return err
}
return proc... | [
"func",
"(",
"p",
"*",
"Process",
")",
"StepInstruction",
"(",
")",
"error",
"{",
"thread",
":=",
"p",
".",
"currentThread",
"\n",
"if",
"p",
".",
"selectedGoroutine",
"!=",
"nil",
"{",
"if",
"p",
".",
"selectedGoroutine",
".",
"Thread",
"==",
"nil",
"... | // StepInstruction will step exactly one CPU instruction. | [
"StepInstruction",
"will",
"step",
"exactly",
"one",
"CPU",
"instruction",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L741-L769 |
127,639 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | SwitchThread | func (p *Process) SwitchThread(tid int) error {
if p.exited {
return proc.ErrProcessExited{Pid: p.conn.pid}
}
if th, ok := p.threads[tid]; ok {
p.currentThread = th
p.selectedGoroutine, _ = proc.GetG(p.CurrentThread())
return nil
}
return fmt.Errorf("thread %d does not exist", tid)
} | go | func (p *Process) SwitchThread(tid int) error {
if p.exited {
return proc.ErrProcessExited{Pid: p.conn.pid}
}
if th, ok := p.threads[tid]; ok {
p.currentThread = th
p.selectedGoroutine, _ = proc.GetG(p.CurrentThread())
return nil
}
return fmt.Errorf("thread %d does not exist", tid)
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"SwitchThread",
"(",
"tid",
"int",
")",
"error",
"{",
"if",
"p",
".",
"exited",
"{",
"return",
"proc",
".",
"ErrProcessExited",
"{",
"Pid",
":",
"p",
".",
"conn",
".",
"pid",
"}",
"\n",
"}",
"\n",
"if",
"th"... | // SwitchThread will change the internal selected thread. | [
"SwitchThread",
"will",
"change",
"the",
"internal",
"selected",
"thread",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L772-L782 |
127,640 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | SwitchGoroutine | func (p *Process) SwitchGoroutine(gid int) error {
g, err := proc.FindGoroutine(p, gid)
if err != nil {
return err
}
if g == nil {
// user specified -1 and selectedGoroutine is nil
return nil
}
if g.Thread != nil {
return p.SwitchThread(g.Thread.ThreadID())
}
p.selectedGoroutine = g
return nil
} | go | func (p *Process) SwitchGoroutine(gid int) error {
g, err := proc.FindGoroutine(p, gid)
if err != nil {
return err
}
if g == nil {
// user specified -1 and selectedGoroutine is nil
return nil
}
if g.Thread != nil {
return p.SwitchThread(g.Thread.ThreadID())
}
p.selectedGoroutine = g
return nil
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"SwitchGoroutine",
"(",
"gid",
"int",
")",
"error",
"{",
"g",
",",
"err",
":=",
"proc",
".",
"FindGoroutine",
"(",
"p",
",",
"gid",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",... | // SwitchGoroutine will change the internal selected goroutine. | [
"SwitchGoroutine",
"will",
"change",
"the",
"internal",
"selected",
"goroutine",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L785-L799 |
127,641 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | RequestManualStop | func (p *Process) RequestManualStop() error {
p.conn.manualStopMutex.Lock()
p.manualStopRequested = true
if !p.conn.running {
p.conn.manualStopMutex.Unlock()
return nil
}
p.ctrlC = true
p.conn.manualStopMutex.Unlock()
return p.conn.sendCtrlC()
} | go | func (p *Process) RequestManualStop() error {
p.conn.manualStopMutex.Lock()
p.manualStopRequested = true
if !p.conn.running {
p.conn.manualStopMutex.Unlock()
return nil
}
p.ctrlC = true
p.conn.manualStopMutex.Unlock()
return p.conn.sendCtrlC()
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"RequestManualStop",
"(",
")",
"error",
"{",
"p",
".",
"conn",
".",
"manualStopMutex",
".",
"Lock",
"(",
")",
"\n",
"p",
".",
"manualStopRequested",
"=",
"true",
"\n",
"if",
"!",
"p",
".",
"conn",
".",
"running"... | // RequestManualStop will attempt to stop the process
// without a breakpoint or signal having been recieved. | [
"RequestManualStop",
"will",
"attempt",
"to",
"stop",
"the",
"process",
"without",
"a",
"breakpoint",
"or",
"signal",
"having",
"been",
"recieved",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L803-L813 |
127,642 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | CheckAndClearManualStopRequest | func (p *Process) CheckAndClearManualStopRequest() bool {
p.conn.manualStopMutex.Lock()
msr := p.manualStopRequested
p.manualStopRequested = false
p.conn.manualStopMutex.Unlock()
return msr
} | go | func (p *Process) CheckAndClearManualStopRequest() bool {
p.conn.manualStopMutex.Lock()
msr := p.manualStopRequested
p.manualStopRequested = false
p.conn.manualStopMutex.Unlock()
return msr
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"CheckAndClearManualStopRequest",
"(",
")",
"bool",
"{",
"p",
".",
"conn",
".",
"manualStopMutex",
".",
"Lock",
"(",
")",
"\n",
"msr",
":=",
"p",
".",
"manualStopRequested",
"\n",
"p",
".",
"manualStopRequested",
"=",... | // CheckAndClearManualStopRequest will check for a manual
// stop and then clear that state. | [
"CheckAndClearManualStopRequest",
"will",
"check",
"for",
"a",
"manual",
"stop",
"and",
"then",
"clear",
"that",
"state",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L817-L823 |
127,643 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Detach | func (p *Process) Detach(kill bool) error {
if kill && !p.exited {
err := p.conn.kill()
if err != nil {
if _, exited := err.(proc.ErrProcessExited); !exited {
return err
}
p.exited = true
}
}
if !p.exited {
if err := p.conn.detach(); err != nil {
return err
}
}
if p.process != nil {
p.p... | go | func (p *Process) Detach(kill bool) error {
if kill && !p.exited {
err := p.conn.kill()
if err != nil {
if _, exited := err.(proc.ErrProcessExited); !exited {
return err
}
p.exited = true
}
}
if !p.exited {
if err := p.conn.detach(); err != nil {
return err
}
}
if p.process != nil {
p.p... | [
"func",
"(",
"p",
"*",
"Process",
")",
"Detach",
"(",
"kill",
"bool",
")",
"error",
"{",
"if",
"kill",
"&&",
"!",
"p",
".",
"exited",
"{",
"err",
":=",
"p",
".",
"conn",
".",
"kill",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"_",
... | // Detach will detach from the target process,
// if 'kill' is true it will also kill the process. | [
"Detach",
"will",
"detach",
"from",
"the",
"target",
"process",
"if",
"kill",
"is",
"true",
"it",
"will",
"also",
"kill",
"the",
"process",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L839-L861 |
127,644 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Restart | func (p *Process) Restart(pos string) error {
if p.tracedir == "" {
return proc.ErrNotRecorded
}
p.exited = false
p.common.ClearAllGCache()
for _, th := range p.threads {
th.clearBreakpointState()
}
p.setCtrlC(false)
err := p.conn.restart(pos)
if err != nil {
return err
}
// for some reason we hav... | go | func (p *Process) Restart(pos string) error {
if p.tracedir == "" {
return proc.ErrNotRecorded
}
p.exited = false
p.common.ClearAllGCache()
for _, th := range p.threads {
th.clearBreakpointState()
}
p.setCtrlC(false)
err := p.conn.restart(pos)
if err != nil {
return err
}
// for some reason we hav... | [
"func",
"(",
"p",
"*",
"Process",
")",
"Restart",
"(",
"pos",
"string",
")",
"error",
"{",
"if",
"p",
".",
"tracedir",
"==",
"\"",
"\"",
"{",
"return",
"proc",
".",
"ErrNotRecorded",
"\n",
"}",
"\n\n",
"p",
".",
"exited",
"=",
"false",
"\n\n",
"p",... | // Restart will restart the process from the given position. | [
"Restart",
"will",
"restart",
"the",
"process",
"from",
"the",
"given",
"position",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L864-L901 |
127,645 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | When | func (p *Process) When() (string, error) {
if p.tracedir == "" {
return "", proc.ErrNotRecorded
}
event, err := p.conn.qRRCmd("when")
if err != nil {
return "", err
}
return strings.TrimSpace(event), nil
} | go | func (p *Process) When() (string, error) {
if p.tracedir == "" {
return "", proc.ErrNotRecorded
}
event, err := p.conn.qRRCmd("when")
if err != nil {
return "", err
}
return strings.TrimSpace(event), nil
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"When",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"p",
".",
"tracedir",
"==",
"\"",
"\"",
"{",
"return",
"\"",
"\"",
",",
"proc",
".",
"ErrNotRecorded",
"\n",
"}",
"\n",
"event",
",",
"err",
"... | // When executes the 'when' command for the Mozilla RR backend.
// This command will return rr's internal event number. | [
"When",
"executes",
"the",
"when",
"command",
"for",
"the",
"Mozilla",
"RR",
"backend",
".",
"This",
"command",
"will",
"return",
"rr",
"s",
"internal",
"event",
"number",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L905-L914 |
127,646 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Checkpoint | func (p *Process) Checkpoint(where string) (int, error) {
if p.tracedir == "" {
return -1, proc.ErrNotRecorded
}
resp, err := p.conn.qRRCmd("checkpoint", where)
if err != nil {
return -1, err
}
if !strings.HasPrefix(resp, checkpointPrefix) {
return -1, fmt.Errorf("can not parse checkpoint response %q", res... | go | func (p *Process) Checkpoint(where string) (int, error) {
if p.tracedir == "" {
return -1, proc.ErrNotRecorded
}
resp, err := p.conn.qRRCmd("checkpoint", where)
if err != nil {
return -1, err
}
if !strings.HasPrefix(resp, checkpointPrefix) {
return -1, fmt.Errorf("can not parse checkpoint response %q", res... | [
"func",
"(",
"p",
"*",
"Process",
")",
"Checkpoint",
"(",
"where",
"string",
")",
"(",
"int",
",",
"error",
")",
"{",
"if",
"p",
".",
"tracedir",
"==",
"\"",
"\"",
"{",
"return",
"-",
"1",
",",
"proc",
".",
"ErrNotRecorded",
"\n",
"}",
"\n",
"res... | // Checkpoint creates a checkpoint from which you can restart the program. | [
"Checkpoint",
"creates",
"a",
"checkpoint",
"from",
"which",
"you",
"can",
"restart",
"the",
"program",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L921-L946 |
127,647 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Checkpoints | func (p *Process) Checkpoints() ([]proc.Checkpoint, error) {
if p.tracedir == "" {
return nil, proc.ErrNotRecorded
}
resp, err := p.conn.qRRCmd("info checkpoints")
if err != nil {
return nil, err
}
lines := strings.Split(resp, "\n")
r := make([]proc.Checkpoint, 0, len(lines)-1)
for _, line := range lines[1:... | go | func (p *Process) Checkpoints() ([]proc.Checkpoint, error) {
if p.tracedir == "" {
return nil, proc.ErrNotRecorded
}
resp, err := p.conn.qRRCmd("info checkpoints")
if err != nil {
return nil, err
}
lines := strings.Split(resp, "\n")
r := make([]proc.Checkpoint, 0, len(lines)-1)
for _, line := range lines[1:... | [
"func",
"(",
"p",
"*",
"Process",
")",
"Checkpoints",
"(",
")",
"(",
"[",
"]",
"proc",
".",
"Checkpoint",
",",
"error",
")",
"{",
"if",
"p",
".",
"tracedir",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"proc",
".",
"ErrNotRecorded",
"\n",
"}",
"... | // Checkpoints returns a list of all checkpoints set. | [
"Checkpoints",
"returns",
"a",
"list",
"of",
"all",
"checkpoints",
"set",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L949-L974 |
127,648 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | ClearCheckpoint | func (p *Process) ClearCheckpoint(id int) error {
if p.tracedir == "" {
return proc.ErrNotRecorded
}
resp, err := p.conn.qRRCmd("delete checkpoint", strconv.Itoa(id))
if err != nil {
return err
}
if !strings.HasPrefix(resp, deleteCheckpointPrefix) {
return errors.New(resp)
}
return nil
} | go | func (p *Process) ClearCheckpoint(id int) error {
if p.tracedir == "" {
return proc.ErrNotRecorded
}
resp, err := p.conn.qRRCmd("delete checkpoint", strconv.Itoa(id))
if err != nil {
return err
}
if !strings.HasPrefix(resp, deleteCheckpointPrefix) {
return errors.New(resp)
}
return nil
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"ClearCheckpoint",
"(",
"id",
"int",
")",
"error",
"{",
"if",
"p",
".",
"tracedir",
"==",
"\"",
"\"",
"{",
"return",
"proc",
".",
"ErrNotRecorded",
"\n",
"}",
"\n",
"resp",
",",
"err",
":=",
"p",
".",
"conn",
... | // ClearCheckpoint clears the checkpoint for the given ID. | [
"ClearCheckpoint",
"clears",
"the",
"checkpoint",
"for",
"the",
"given",
"ID",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L979-L991 |
127,649 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Direction | func (p *Process) Direction(dir proc.Direction) error {
if p.tracedir == "" {
return proc.ErrNotRecorded
}
if p.conn.conn == nil {
return proc.ErrProcessExited{Pid: p.conn.pid}
}
if p.conn.direction == dir {
return nil
}
if p.Breakpoints().HasInternalBreakpoints() {
return ErrDirChange
}
p.conn.directi... | go | func (p *Process) Direction(dir proc.Direction) error {
if p.tracedir == "" {
return proc.ErrNotRecorded
}
if p.conn.conn == nil {
return proc.ErrProcessExited{Pid: p.conn.pid}
}
if p.conn.direction == dir {
return nil
}
if p.Breakpoints().HasInternalBreakpoints() {
return ErrDirChange
}
p.conn.directi... | [
"func",
"(",
"p",
"*",
"Process",
")",
"Direction",
"(",
"dir",
"proc",
".",
"Direction",
")",
"error",
"{",
"if",
"p",
".",
"tracedir",
"==",
"\"",
"\"",
"{",
"return",
"proc",
".",
"ErrNotRecorded",
"\n",
"}",
"\n",
"if",
"p",
".",
"conn",
".",
... | // Direction sets whether to run the program forwards or in reverse execution. | [
"Direction",
"sets",
"whether",
"to",
"run",
"the",
"program",
"forwards",
"or",
"in",
"reverse",
"execution",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L994-L1009 |
127,650 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | SetBreakpoint | func (p *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error) {
if p.exited {
return nil, &proc.ErrProcessExited{Pid: p.conn.pid}
}
return p.breakpoints.Set(addr, kind, cond, p.writeBreakpoint)
} | go | func (p *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error) {
if p.exited {
return nil, &proc.ErrProcessExited{Pid: p.conn.pid}
}
return p.breakpoints.Set(addr, kind, cond, p.writeBreakpoint)
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"SetBreakpoint",
"(",
"addr",
"uint64",
",",
"kind",
"proc",
".",
"BreakpointKind",
",",
"cond",
"ast",
".",
"Expr",
")",
"(",
"*",
"proc",
".",
"Breakpoint",
",",
"error",
")",
"{",
"if",
"p",
".",
"exited",
... | // SetBreakpoint creates a new breakpoint. | [
"SetBreakpoint",
"creates",
"a",
"new",
"breakpoint",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1040-L1045 |
127,651 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | ClearBreakpoint | func (p *Process) ClearBreakpoint(addr uint64) (*proc.Breakpoint, error) {
if p.exited {
return nil, &proc.ErrProcessExited{Pid: p.conn.pid}
}
return p.breakpoints.Clear(addr, func(bp *proc.Breakpoint) error {
return p.conn.clearBreakpoint(bp.Addr)
})
} | go | func (p *Process) ClearBreakpoint(addr uint64) (*proc.Breakpoint, error) {
if p.exited {
return nil, &proc.ErrProcessExited{Pid: p.conn.pid}
}
return p.breakpoints.Clear(addr, func(bp *proc.Breakpoint) error {
return p.conn.clearBreakpoint(bp.Addr)
})
} | [
"func",
"(",
"p",
"*",
"Process",
")",
"ClearBreakpoint",
"(",
"addr",
"uint64",
")",
"(",
"*",
"proc",
".",
"Breakpoint",
",",
"error",
")",
"{",
"if",
"p",
".",
"exited",
"{",
"return",
"nil",
",",
"&",
"proc",
".",
"ErrProcessExited",
"{",
"Pid",
... | // ClearBreakpoint clears a breakpoint at the given address. | [
"ClearBreakpoint",
"clears",
"a",
"breakpoint",
"at",
"the",
"given",
"address",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1048-L1055 |
127,652 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | ClearInternalBreakpoints | func (p *Process) ClearInternalBreakpoints() error {
return p.breakpoints.ClearInternalBreakpoints(func(bp *proc.Breakpoint) error {
if err := p.conn.clearBreakpoint(bp.Addr); err != nil {
return err
}
for _, thread := range p.threads {
if thread.CurrentBreakpoint.Breakpoint == bp {
thread.clearBreakpo... | go | func (p *Process) ClearInternalBreakpoints() error {
return p.breakpoints.ClearInternalBreakpoints(func(bp *proc.Breakpoint) error {
if err := p.conn.clearBreakpoint(bp.Addr); err != nil {
return err
}
for _, thread := range p.threads {
if thread.CurrentBreakpoint.Breakpoint == bp {
thread.clearBreakpo... | [
"func",
"(",
"p",
"*",
"Process",
")",
"ClearInternalBreakpoints",
"(",
")",
"error",
"{",
"return",
"p",
".",
"breakpoints",
".",
"ClearInternalBreakpoints",
"(",
"func",
"(",
"bp",
"*",
"proc",
".",
"Breakpoint",
")",
"error",
"{",
"if",
"err",
":=",
"... | // ClearInternalBreakpoints clear all internal use breakpoints like those set by 'next'. | [
"ClearInternalBreakpoints",
"clear",
"all",
"internal",
"use",
"breakpoints",
"like",
"those",
"set",
"by",
"next",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1058-L1070 |
127,653 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | updateThreadList | func (p *Process) updateThreadList(tu *threadUpdater) error {
if !tu.done {
first := true
for {
threads, err := p.conn.queryThreads(first)
if err != nil {
return err
}
if len(threads) == 0 {
break
}
first = false
if err := tu.Add(threads); err != nil {
return err
}
}
tu.Fin... | go | func (p *Process) updateThreadList(tu *threadUpdater) error {
if !tu.done {
first := true
for {
threads, err := p.conn.queryThreads(first)
if err != nil {
return err
}
if len(threads) == 0 {
break
}
first = false
if err := tu.Add(threads); err != nil {
return err
}
}
tu.Fin... | [
"func",
"(",
"p",
"*",
"Process",
")",
"updateThreadList",
"(",
"tu",
"*",
"threadUpdater",
")",
"error",
"{",
"if",
"!",
"tu",
".",
"done",
"{",
"first",
":=",
"true",
"\n",
"for",
"{",
"threads",
",",
"err",
":=",
"p",
".",
"conn",
".",
"queryThr... | // updateThreadsList retrieves the list of inferior threads from the stub
// and passes it to the threadUpdater.
// Then it reloads the register information for all running threads.
// Some stubs will return the list of running threads in the stop packet, if
// this happens the threadUpdater will know that we have alre... | [
"updateThreadsList",
"retrieves",
"the",
"list",
"of",
"inferior",
"threads",
"from",
"the",
"stub",
"and",
"passes",
"it",
"to",
"the",
"threadUpdater",
".",
"Then",
"it",
"reloads",
"the",
"register",
"information",
"for",
"all",
"running",
"threads",
".",
"... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1141-L1181 |
127,654 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | ReadMemory | func (t *Thread) ReadMemory(data []byte, addr uintptr) (n int, err error) {
err = t.p.conn.readMemory(data, addr)
if err != nil {
return 0, err
}
return len(data), nil
} | go | func (t *Thread) ReadMemory(data []byte, addr uintptr) (n int, err error) {
err = t.p.conn.readMemory(data, addr)
if err != nil {
return 0, err
}
return len(data), nil
} | [
"func",
"(",
"t",
"*",
"Thread",
")",
"ReadMemory",
"(",
"data",
"[",
"]",
"byte",
",",
"addr",
"uintptr",
")",
"(",
"n",
"int",
",",
"err",
"error",
")",
"{",
"err",
"=",
"t",
".",
"p",
".",
"conn",
".",
"readMemory",
"(",
"data",
",",
"addr",... | // ReadMemory will read into 'data' memory at the address provided. | [
"ReadMemory",
"will",
"read",
"into",
"data",
"memory",
"at",
"the",
"address",
"provided",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1208-L1214 |
127,655 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | WriteMemory | func (t *Thread) WriteMemory(addr uintptr, data []byte) (written int, err error) {
return t.p.conn.writeMemory(addr, data)
} | go | func (t *Thread) WriteMemory(addr uintptr, data []byte) (written int, err error) {
return t.p.conn.writeMemory(addr, data)
} | [
"func",
"(",
"t",
"*",
"Thread",
")",
"WriteMemory",
"(",
"addr",
"uintptr",
",",
"data",
"[",
"]",
"byte",
")",
"(",
"written",
"int",
",",
"err",
"error",
")",
"{",
"return",
"t",
".",
"p",
".",
"conn",
".",
"writeMemory",
"(",
"addr",
",",
"da... | // WriteMemory will write into the memory at 'addr' the data provided. | [
"WriteMemory",
"will",
"write",
"into",
"the",
"memory",
"at",
"addr",
"the",
"data",
"provided",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1217-L1219 |
127,656 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Registers | func (t *Thread) Registers(floatingPoint bool) (proc.Registers, error) {
return &t.regs, nil
} | go | func (t *Thread) Registers(floatingPoint bool) (proc.Registers, error) {
return &t.regs, nil
} | [
"func",
"(",
"t",
"*",
"Thread",
")",
"Registers",
"(",
"floatingPoint",
"bool",
")",
"(",
"proc",
".",
"Registers",
",",
"error",
")",
"{",
"return",
"&",
"t",
".",
"regs",
",",
"nil",
"\n",
"}"
] | // Registers returns the CPU registers for this thread. | [
"Registers",
"returns",
"the",
"CPU",
"registers",
"for",
"this",
"thread",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1243-L1245 |
127,657 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | RestoreRegisters | func (t *Thread) RestoreRegisters(savedRegs proc.Registers) error {
copy(t.regs.buf, savedRegs.(*gdbRegisters).buf)
return t.writeRegisters()
} | go | func (t *Thread) RestoreRegisters(savedRegs proc.Registers) error {
copy(t.regs.buf, savedRegs.(*gdbRegisters).buf)
return t.writeRegisters()
} | [
"func",
"(",
"t",
"*",
"Thread",
")",
"RestoreRegisters",
"(",
"savedRegs",
"proc",
".",
"Registers",
")",
"error",
"{",
"copy",
"(",
"t",
".",
"regs",
".",
"buf",
",",
"savedRegs",
".",
"(",
"*",
"gdbRegisters",
")",
".",
"buf",
")",
"\n",
"return",... | // RestoreRegisters will set the CPU registers the value of those provided. | [
"RestoreRegisters",
"will",
"set",
"the",
"CPU",
"registers",
"the",
"value",
"of",
"those",
"provided",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1248-L1251 |
127,658 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | StepInstruction | func (t *Thread) StepInstruction() error {
if err := t.stepInstruction(&threadUpdater{p: t.p}); err != nil {
return err
}
return t.reloadRegisters()
} | go | func (t *Thread) StepInstruction() error {
if err := t.stepInstruction(&threadUpdater{p: t.p}); err != nil {
return err
}
return t.reloadRegisters()
} | [
"func",
"(",
"t",
"*",
"Thread",
")",
"StepInstruction",
"(",
")",
"error",
"{",
"if",
"err",
":=",
"t",
".",
"stepInstruction",
"(",
"&",
"threadUpdater",
"{",
"p",
":",
"t",
".",
"p",
"}",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n... | // StepInstruction will step exactly 1 CPU instruction. | [
"StepInstruction",
"will",
"step",
"exactly",
"1",
"CPU",
"instruction",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1282-L1287 |
127,659 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | Blocked | func (t *Thread) Blocked() bool {
regs, err := t.Registers(false)
if err != nil {
return false
}
pc := regs.PC()
f, ln, fn := t.BinInfo().PCToLine(pc)
if fn == nil {
if f == "" && ln == 0 {
return true
}
return false
}
switch fn.Name {
case "runtime.futex", "runtime.usleep", "runtime.clone":
retur... | go | func (t *Thread) Blocked() bool {
regs, err := t.Registers(false)
if err != nil {
return false
}
pc := regs.PC()
f, ln, fn := t.BinInfo().PCToLine(pc)
if fn == nil {
if f == "" && ln == 0 {
return true
}
return false
}
switch fn.Name {
case "runtime.futex", "runtime.usleep", "runtime.clone":
retur... | [
"func",
"(",
"t",
"*",
"Thread",
")",
"Blocked",
"(",
")",
"bool",
"{",
"regs",
",",
"err",
":=",
"t",
".",
"Registers",
"(",
"false",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"pc",
":=",
"regs",
".",
"PC",
... | // Blocked returns true if the thread is blocked in runtime or kernel code. | [
"Blocked",
"returns",
"true",
"if",
"the",
"thread",
"is",
"blocked",
"in",
"runtime",
"or",
"kernel",
"code",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1290-L1313 |
127,660 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | reloadRegisters | func (t *Thread) reloadRegisters() error {
if t.regs.regs == nil {
t.regs.init(t.p.conn.regsInfo)
}
if t.p.gcmdok {
if err := t.p.conn.readRegisters(t.strID, t.regs.buf); err != nil {
if isProtocolErrorUnsupported(err) {
t.p.gcmdok = false
} else {
return err
}
}
}
if !t.p.gcmdok {
for _,... | go | func (t *Thread) reloadRegisters() error {
if t.regs.regs == nil {
t.regs.init(t.p.conn.regsInfo)
}
if t.p.gcmdok {
if err := t.p.conn.readRegisters(t.strID, t.regs.buf); err != nil {
if isProtocolErrorUnsupported(err) {
t.p.gcmdok = false
} else {
return err
}
}
}
if !t.p.gcmdok {
for _,... | [
"func",
"(",
"t",
"*",
"Thread",
")",
"reloadRegisters",
"(",
")",
"error",
"{",
"if",
"t",
".",
"regs",
".",
"regs",
"==",
"nil",
"{",
"t",
".",
"regs",
".",
"init",
"(",
"t",
".",
"p",
".",
"conn",
".",
"regsInfo",
")",
"\n",
"}",
"\n\n",
"... | // reloadRegisters loads the current value of the thread's registers.
// It will also load the address of the thread's G.
// Loading the address of G can be done in one of two ways reloadGAlloc, if
// the stub can allocate memory, or reloadGAtPC, if the stub can't. | [
"reloadRegisters",
"loads",
"the",
"current",
"value",
"of",
"the",
"thread",
"s",
"registers",
".",
"It",
"will",
"also",
"load",
"the",
"address",
"of",
"the",
"thread",
"s",
"G",
".",
"Loading",
"the",
"address",
"of",
"G",
"can",
"be",
"done",
"in",
... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1359-L1395 |
127,661 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | reloadGAtPC | func (t *Thread) reloadGAtPC() error {
movinstr := t.p.loadGInstr()
if t.Blocked() {
t.regs.tls = 0
t.regs.gaddr = 0
t.regs.hasgaddr = true
return nil
}
cx := t.regs.CX()
pc := t.regs.PC()
// We are partially replicating the code of GdbserverThread.stepInstruction
// here.
// The reason is that lldb-... | go | func (t *Thread) reloadGAtPC() error {
movinstr := t.p.loadGInstr()
if t.Blocked() {
t.regs.tls = 0
t.regs.gaddr = 0
t.regs.hasgaddr = true
return nil
}
cx := t.regs.CX()
pc := t.regs.PC()
// We are partially replicating the code of GdbserverThread.stepInstruction
// here.
// The reason is that lldb-... | [
"func",
"(",
"t",
"*",
"Thread",
")",
"reloadGAtPC",
"(",
")",
"error",
"{",
"movinstr",
":=",
"t",
".",
"p",
".",
"loadGInstr",
"(",
")",
"\n\n",
"if",
"t",
".",
"Blocked",
"(",
")",
"{",
"t",
".",
"regs",
".",
"tls",
"=",
"0",
"\n",
"t",
".... | // reloadGAtPC overwrites the instruction that the thread is stopped at with
// the MOV instruction used to load current G, executes this single
// instruction and then puts everything back the way it was. | [
"reloadGAtPC",
"overwrites",
"the",
"instruction",
"that",
"the",
"thread",
"is",
"stopped",
"at",
"with",
"the",
"MOV",
"instruction",
"used",
"to",
"load",
"current",
"G",
"executes",
"this",
"single",
"instruction",
"and",
"then",
"puts",
"everything",
"back"... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1437-L1510 |
127,662 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | reloadGAlloc | func (t *Thread) reloadGAlloc() error {
if t.Blocked() {
t.regs.tls = 0
t.regs.gaddr = 0
t.regs.hasgaddr = true
return nil
}
cx := t.regs.CX()
pc := t.regs.PC()
t.regs.setPC(t.p.loadGInstrAddr)
if err := t.writeSomeRegisters(regnamePC); err != nil {
return err
}
var err error
defer func() {
t.r... | go | func (t *Thread) reloadGAlloc() error {
if t.Blocked() {
t.regs.tls = 0
t.regs.gaddr = 0
t.regs.hasgaddr = true
return nil
}
cx := t.regs.CX()
pc := t.regs.PC()
t.regs.setPC(t.p.loadGInstrAddr)
if err := t.writeSomeRegisters(regnamePC); err != nil {
return err
}
var err error
defer func() {
t.r... | [
"func",
"(",
"t",
"*",
"Thread",
")",
"reloadGAlloc",
"(",
")",
"error",
"{",
"if",
"t",
".",
"Blocked",
"(",
")",
"{",
"t",
".",
"regs",
".",
"tls",
"=",
"0",
"\n",
"t",
".",
"regs",
".",
"gaddr",
"=",
"0",
"\n",
"t",
".",
"regs",
".",
"ha... | // reloadGAlloc makes the specified thread execute one instruction stored at
// t.p.loadGInstrAddr then restores the value of the thread's registers.
// t.p.loadGInstrAddr must point to valid memory on the inferior, containing
// a MOV instruction that loads the address of the current G in the RCX
// register. | [
"reloadGAlloc",
"makes",
"the",
"specified",
"thread",
"execute",
"one",
"instruction",
"stored",
"at",
"t",
".",
"p",
".",
"loadGInstrAddr",
"then",
"restores",
"the",
"value",
"of",
"the",
"thread",
"s",
"registers",
".",
"t",
".",
"p",
".",
"loadGInstrAdd... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1517-L1563 |
127,663 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | SetCurrentBreakpoint | func (t *Thread) SetCurrentBreakpoint() error {
t.clearBreakpointState()
regs, err := t.Registers(false)
if err != nil {
return err
}
pc := regs.PC()
if bp, ok := t.p.FindBreakpoint(pc); ok {
if t.regs.PC() != bp.Addr {
if err := t.SetPC(bp.Addr); err != nil {
return err
}
}
t.CurrentBreakpoint ... | go | func (t *Thread) SetCurrentBreakpoint() error {
t.clearBreakpointState()
regs, err := t.Registers(false)
if err != nil {
return err
}
pc := regs.PC()
if bp, ok := t.p.FindBreakpoint(pc); ok {
if t.regs.PC() != bp.Addr {
if err := t.SetPC(bp.Addr); err != nil {
return err
}
}
t.CurrentBreakpoint ... | [
"func",
"(",
"t",
"*",
"Thread",
")",
"SetCurrentBreakpoint",
"(",
")",
"error",
"{",
"t",
".",
"clearBreakpointState",
"(",
")",
"\n",
"regs",
",",
"err",
":=",
"t",
".",
"Registers",
"(",
"false",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",... | // SetCurrentBreakpoint will find and set the threads current breakpoint. | [
"SetCurrentBreakpoint",
"will",
"find",
"and",
"set",
"the",
"threads",
"current",
"breakpoint",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1571-L1593 |
127,664 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | SetPC | func (t *Thread) SetPC(pc uint64) error {
t.regs.setPC(pc)
if t.p.gcmdok {
return t.p.conn.writeRegisters(t.strID, t.regs.buf)
}
reg := t.regs.regs[regnamePC]
return t.p.conn.writeRegister(t.strID, reg.regnum, reg.value)
} | go | func (t *Thread) SetPC(pc uint64) error {
t.regs.setPC(pc)
if t.p.gcmdok {
return t.p.conn.writeRegisters(t.strID, t.regs.buf)
}
reg := t.regs.regs[regnamePC]
return t.p.conn.writeRegister(t.strID, reg.regnum, reg.value)
} | [
"func",
"(",
"t",
"*",
"Thread",
")",
"SetPC",
"(",
"pc",
"uint64",
")",
"error",
"{",
"t",
".",
"regs",
".",
"setPC",
"(",
"pc",
")",
"\n",
"if",
"t",
".",
"p",
".",
"gcmdok",
"{",
"return",
"t",
".",
"p",
".",
"conn",
".",
"writeRegisters",
... | // SetPC will set the value of the PC register to the given value. | [
"SetPC",
"will",
"set",
"the",
"value",
"of",
"the",
"PC",
"register",
"to",
"the",
"given",
"value",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1800-L1807 |
127,665 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | SetSP | func (t *Thread) SetSP(sp uint64) error {
t.regs.setSP(sp)
if t.p.gcmdok {
return t.p.conn.writeRegisters(t.strID, t.regs.buf)
}
reg := t.regs.regs[regnameSP]
return t.p.conn.writeRegister(t.strID, reg.regnum, reg.value)
} | go | func (t *Thread) SetSP(sp uint64) error {
t.regs.setSP(sp)
if t.p.gcmdok {
return t.p.conn.writeRegisters(t.strID, t.regs.buf)
}
reg := t.regs.regs[regnameSP]
return t.p.conn.writeRegister(t.strID, reg.regnum, reg.value)
} | [
"func",
"(",
"t",
"*",
"Thread",
")",
"SetSP",
"(",
"sp",
"uint64",
")",
"error",
"{",
"t",
".",
"regs",
".",
"setSP",
"(",
"sp",
")",
"\n",
"if",
"t",
".",
"p",
".",
"gcmdok",
"{",
"return",
"t",
".",
"p",
".",
"conn",
".",
"writeRegisters",
... | // SetSP will set the value of the SP register to the given value. | [
"SetSP",
"will",
"set",
"the",
"value",
"of",
"the",
"SP",
"register",
"to",
"the",
"given",
"value",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1810-L1817 |
127,666 | go-delve/delve | pkg/proc/gdbserial/gdbserver.go | SetDX | func (t *Thread) SetDX(dx uint64) error {
t.regs.setDX(dx)
if t.p.gcmdok {
return t.p.conn.writeRegisters(t.strID, t.regs.buf)
}
reg := t.regs.regs[regnameDX]
return t.p.conn.writeRegister(t.strID, reg.regnum, reg.value)
} | go | func (t *Thread) SetDX(dx uint64) error {
t.regs.setDX(dx)
if t.p.gcmdok {
return t.p.conn.writeRegisters(t.strID, t.regs.buf)
}
reg := t.regs.regs[regnameDX]
return t.p.conn.writeRegister(t.strID, reg.regnum, reg.value)
} | [
"func",
"(",
"t",
"*",
"Thread",
")",
"SetDX",
"(",
"dx",
"uint64",
")",
"error",
"{",
"t",
".",
"regs",
".",
"setDX",
"(",
"dx",
")",
"\n",
"if",
"t",
".",
"p",
".",
"gcmdok",
"{",
"return",
"t",
".",
"p",
".",
"conn",
".",
"writeRegisters",
... | // SetDX will set the value of the DX register to the given value. | [
"SetDX",
"will",
"set",
"the",
"value",
"of",
"the",
"DX",
"register",
"to",
"the",
"given",
"value",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver.go#L1820-L1827 |
127,667 | go-delve/delve | pkg/proc/breakpoints.go | CheckCondition | func (bp *Breakpoint) CheckCondition(thread Thread) BreakpointState {
bpstate := BreakpointState{Breakpoint: bp, Active: false, Internal: false, CondError: nil}
if bp.Cond == nil && bp.internalCond == nil {
bpstate.Active = true
bpstate.Internal = bp.IsInternal()
return bpstate
}
nextDeferOk := true
if bp.Ki... | go | func (bp *Breakpoint) CheckCondition(thread Thread) BreakpointState {
bpstate := BreakpointState{Breakpoint: bp, Active: false, Internal: false, CondError: nil}
if bp.Cond == nil && bp.internalCond == nil {
bpstate.Active = true
bpstate.Internal = bp.IsInternal()
return bpstate
}
nextDeferOk := true
if bp.Ki... | [
"func",
"(",
"bp",
"*",
"Breakpoint",
")",
"CheckCondition",
"(",
"thread",
"Thread",
")",
"BreakpointState",
"{",
"bpstate",
":=",
"BreakpointState",
"{",
"Breakpoint",
":",
"bp",
",",
"Active",
":",
"false",
",",
"Internal",
":",
"false",
",",
"CondError",... | // CheckCondition evaluates bp's condition on thread. | [
"CheckCondition",
"evaluates",
"bp",
"s",
"condition",
"on",
"thread",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/breakpoints.go#L118-L156 |
127,668 | go-delve/delve | pkg/proc/breakpoints.go | Set | func (bpmap *BreakpointMap) Set(addr uint64, kind BreakpointKind, cond ast.Expr, writeBreakpoint WriteBreakpointFn) (*Breakpoint, error) {
if bp, ok := bpmap.M[addr]; ok {
// We can overlap one internal breakpoint with one user breakpoint, we
// need to support this otherwise a conditional breakpoint can mask a
... | go | func (bpmap *BreakpointMap) Set(addr uint64, kind BreakpointKind, cond ast.Expr, writeBreakpoint WriteBreakpointFn) (*Breakpoint, error) {
if bp, ok := bpmap.M[addr]; ok {
// We can overlap one internal breakpoint with one user breakpoint, we
// need to support this otherwise a conditional breakpoint can mask a
... | [
"func",
"(",
"bpmap",
"*",
"BreakpointMap",
")",
"Set",
"(",
"addr",
"uint64",
",",
"kind",
"BreakpointKind",
",",
"cond",
"ast",
".",
"Expr",
",",
"writeBreakpoint",
"WriteBreakpointFn",
")",
"(",
"*",
"Breakpoint",
",",
"error",
")",
"{",
"if",
"bp",
"... | // Set creates a breakpoint at addr calling writeBreakpoint. Do not call this
// function, call proc.Process.SetBreakpoint instead, this function exists
// to implement proc.Process.SetBreakpoint. | [
"Set",
"creates",
"a",
"breakpoint",
"at",
"addr",
"calling",
"writeBreakpoint",
".",
"Do",
"not",
"call",
"this",
"function",
"call",
"proc",
".",
"Process",
".",
"SetBreakpoint",
"instead",
"this",
"function",
"exists",
"to",
"implement",
"proc",
".",
"Proce... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/breakpoints.go#L233-L283 |
127,669 | go-delve/delve | pkg/proc/breakpoints.go | SetWithID | func (bpmap *BreakpointMap) SetWithID(id int, addr uint64, writeBreakpoint WriteBreakpointFn) (*Breakpoint, error) {
bp, err := bpmap.Set(addr, UserBreakpoint, nil, writeBreakpoint)
if err == nil {
bp.ID = id
bpmap.breakpointIDCounter--
}
return bp, err
} | go | func (bpmap *BreakpointMap) SetWithID(id int, addr uint64, writeBreakpoint WriteBreakpointFn) (*Breakpoint, error) {
bp, err := bpmap.Set(addr, UserBreakpoint, nil, writeBreakpoint)
if err == nil {
bp.ID = id
bpmap.breakpointIDCounter--
}
return bp, err
} | [
"func",
"(",
"bpmap",
"*",
"BreakpointMap",
")",
"SetWithID",
"(",
"id",
"int",
",",
"addr",
"uint64",
",",
"writeBreakpoint",
"WriteBreakpointFn",
")",
"(",
"*",
"Breakpoint",
",",
"error",
")",
"{",
"bp",
",",
"err",
":=",
"bpmap",
".",
"Set",
"(",
"... | // SetWithID creates a breakpoint at addr, with the specified ID. | [
"SetWithID",
"creates",
"a",
"breakpoint",
"at",
"addr",
"with",
"the",
"specified",
"ID",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/breakpoints.go#L286-L293 |
127,670 | go-delve/delve | pkg/proc/breakpoints.go | Clear | func (bpmap *BreakpointMap) Clear(addr uint64, clearBreakpoint clearBreakpointFn) (*Breakpoint, error) {
bp, ok := bpmap.M[addr]
if !ok {
return nil, NoBreakpointError{Addr: addr}
}
bp.Kind &= ^UserBreakpoint
bp.Cond = nil
if bp.Kind != 0 {
return bp, nil
}
if err := clearBreakpoint(bp); err != nil {
re... | go | func (bpmap *BreakpointMap) Clear(addr uint64, clearBreakpoint clearBreakpointFn) (*Breakpoint, error) {
bp, ok := bpmap.M[addr]
if !ok {
return nil, NoBreakpointError{Addr: addr}
}
bp.Kind &= ^UserBreakpoint
bp.Cond = nil
if bp.Kind != 0 {
return bp, nil
}
if err := clearBreakpoint(bp); err != nil {
re... | [
"func",
"(",
"bpmap",
"*",
"BreakpointMap",
")",
"Clear",
"(",
"addr",
"uint64",
",",
"clearBreakpoint",
"clearBreakpointFn",
")",
"(",
"*",
"Breakpoint",
",",
"error",
")",
"{",
"bp",
",",
"ok",
":=",
"bpmap",
".",
"M",
"[",
"addr",
"]",
"\n",
"if",
... | // Clear clears the breakpoint at addr.
// Do not call this function call proc.Process.ClearBreakpoint instead. | [
"Clear",
"clears",
"the",
"breakpoint",
"at",
"addr",
".",
"Do",
"not",
"call",
"this",
"function",
"call",
"proc",
".",
"Process",
".",
"ClearBreakpoint",
"instead",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/breakpoints.go#L297-L316 |
127,671 | go-delve/delve | pkg/proc/breakpoints.go | ClearInternalBreakpoints | func (bpmap *BreakpointMap) ClearInternalBreakpoints(clearBreakpoint clearBreakpointFn) error {
for addr, bp := range bpmap.M {
bp.Kind = bp.Kind & UserBreakpoint
bp.internalCond = nil
bp.returnInfo = nil
if bp.Kind != 0 {
continue
}
if err := clearBreakpoint(bp); err != nil {
return err
}
delete... | go | func (bpmap *BreakpointMap) ClearInternalBreakpoints(clearBreakpoint clearBreakpointFn) error {
for addr, bp := range bpmap.M {
bp.Kind = bp.Kind & UserBreakpoint
bp.internalCond = nil
bp.returnInfo = nil
if bp.Kind != 0 {
continue
}
if err := clearBreakpoint(bp); err != nil {
return err
}
delete... | [
"func",
"(",
"bpmap",
"*",
"BreakpointMap",
")",
"ClearInternalBreakpoints",
"(",
"clearBreakpoint",
"clearBreakpointFn",
")",
"error",
"{",
"for",
"addr",
",",
"bp",
":=",
"range",
"bpmap",
".",
"M",
"{",
"bp",
".",
"Kind",
"=",
"bp",
".",
"Kind",
"&",
... | // ClearInternalBreakpoints removes all internal breakpoints from the map,
// calling clearBreakpoint on each one.
// Do not call this function, call proc.Process.ClearInternalBreakpoints
// instead, this function is used to implement that. | [
"ClearInternalBreakpoints",
"removes",
"all",
"internal",
"breakpoints",
"from",
"the",
"map",
"calling",
"clearBreakpoint",
"on",
"each",
"one",
".",
"Do",
"not",
"call",
"this",
"function",
"call",
"proc",
".",
"Process",
".",
"ClearInternalBreakpoints",
"instead"... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/breakpoints.go#L322-L336 |
127,672 | go-delve/delve | pkg/proc/breakpoints.go | HasInternalBreakpoints | func (bpmap *BreakpointMap) HasInternalBreakpoints() bool {
for _, bp := range bpmap.M {
if bp.IsInternal() {
return true
}
}
return false
} | go | func (bpmap *BreakpointMap) HasInternalBreakpoints() bool {
for _, bp := range bpmap.M {
if bp.IsInternal() {
return true
}
}
return false
} | [
"func",
"(",
"bpmap",
"*",
"BreakpointMap",
")",
"HasInternalBreakpoints",
"(",
")",
"bool",
"{",
"for",
"_",
",",
"bp",
":=",
"range",
"bpmap",
".",
"M",
"{",
"if",
"bp",
".",
"IsInternal",
"(",
")",
"{",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\... | // HasInternalBreakpoints returns true if bpmap has at least one internal
// breakpoint set. | [
"HasInternalBreakpoints",
"returns",
"true",
"if",
"bpmap",
"has",
"at",
"least",
"one",
"internal",
"breakpoint",
"set",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/breakpoints.go#L340-L347 |
127,673 | go-delve/delve | pkg/proc/breakpoints.go | Clear | func (bpstate *BreakpointState) Clear() {
bpstate.Breakpoint = nil
bpstate.Active = false
bpstate.Internal = false
bpstate.CondError = nil
} | go | func (bpstate *BreakpointState) Clear() {
bpstate.Breakpoint = nil
bpstate.Active = false
bpstate.Internal = false
bpstate.CondError = nil
} | [
"func",
"(",
"bpstate",
"*",
"BreakpointState",
")",
"Clear",
"(",
")",
"{",
"bpstate",
".",
"Breakpoint",
"=",
"nil",
"\n",
"bpstate",
".",
"Active",
"=",
"false",
"\n",
"bpstate",
".",
"Internal",
"=",
"false",
"\n",
"bpstate",
".",
"CondError",
"=",
... | // Clear zeros the struct. | [
"Clear",
"zeros",
"the",
"struct",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/breakpoints.go#L363-L368 |
127,674 | go-delve/delve | pkg/proc/linutil/dynamic.go | dynamicSearchDebug | func dynamicSearchDebug(p proc.Process) (uint64, error) {
bi := p.BinInfo()
mem := p.CurrentThread()
dynbuf := make([]byte, bi.ElfDynamicSection.Size)
_, err := mem.ReadMemory(dynbuf, uintptr(bi.ElfDynamicSection.Addr))
if err != nil {
return 0, err
}
rd := bytes.NewReader(dynbuf)
for {
var tag, val uint... | go | func dynamicSearchDebug(p proc.Process) (uint64, error) {
bi := p.BinInfo()
mem := p.CurrentThread()
dynbuf := make([]byte, bi.ElfDynamicSection.Size)
_, err := mem.ReadMemory(dynbuf, uintptr(bi.ElfDynamicSection.Addr))
if err != nil {
return 0, err
}
rd := bytes.NewReader(dynbuf)
for {
var tag, val uint... | [
"func",
"dynamicSearchDebug",
"(",
"p",
"proc",
".",
"Process",
")",
"(",
"uint64",
",",
"error",
")",
"{",
"bi",
":=",
"p",
".",
"BinInfo",
"(",
")",
"\n",
"mem",
":=",
"p",
".",
"CurrentThread",
"(",
")",
"\n\n",
"dynbuf",
":=",
"make",
"(",
"[",... | // dynamicSearchDebug searches for the DT_DEBUG entry in the .dynamic section | [
"dynamicSearchDebug",
"searches",
"for",
"the",
"DT_DEBUG",
"entry",
"in",
"the",
".",
"dynamic",
"section"
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/linutil/dynamic.go#L25-L52 |
127,675 | go-delve/delve | pkg/proc/arch.go | AMD64Arch | func AMD64Arch(goos string) *AMD64 {
var breakInstr = []byte{0xCC}
return &AMD64{
ptrSize: 8,
breakInstruction: breakInstr,
breakInstructionLen: len(breakInstr),
hardwareBreakpointUsage: make([]bool, 4),
goos: goos,
}
} | go | func AMD64Arch(goos string) *AMD64 {
var breakInstr = []byte{0xCC}
return &AMD64{
ptrSize: 8,
breakInstruction: breakInstr,
breakInstructionLen: len(breakInstr),
hardwareBreakpointUsage: make([]bool, 4),
goos: goos,
}
} | [
"func",
"AMD64Arch",
"(",
"goos",
"string",
")",
"*",
"AMD64",
"{",
"var",
"breakInstr",
"=",
"[",
"]",
"byte",
"{",
"0xCC",
"}",
"\n\n",
"return",
"&",
"AMD64",
"{",
"ptrSize",
":",
"8",
",",
"breakInstruction",
":",
"breakInstr",
",",
"breakInstruction... | // AMD64Arch returns an initialized AMD64
// struct. | [
"AMD64Arch",
"returns",
"an",
"initialized",
"AMD64",
"struct",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/arch.go#L53-L63 |
127,676 | go-delve/delve | pkg/proc/arch.go | FixFrameUnwindContext | func (a *AMD64) FixFrameUnwindContext(fctxt *frame.FrameContext, pc uint64, bi *BinaryInfo) *frame.FrameContext {
if a.sigreturnfn == nil {
a.sigreturnfn = bi.LookupFunc["runtime.sigreturn"]
}
if fctxt == nil || (a.sigreturnfn != nil && pc >= a.sigreturnfn.Entry && pc < a.sigreturnfn.End) {
//if true {
// Whe... | go | func (a *AMD64) FixFrameUnwindContext(fctxt *frame.FrameContext, pc uint64, bi *BinaryInfo) *frame.FrameContext {
if a.sigreturnfn == nil {
a.sigreturnfn = bi.LookupFunc["runtime.sigreturn"]
}
if fctxt == nil || (a.sigreturnfn != nil && pc >= a.sigreturnfn.Entry && pc < a.sigreturnfn.End) {
//if true {
// Whe... | [
"func",
"(",
"a",
"*",
"AMD64",
")",
"FixFrameUnwindContext",
"(",
"fctxt",
"*",
"frame",
".",
"FrameContext",
",",
"pc",
"uint64",
",",
"bi",
"*",
"BinaryInfo",
")",
"*",
"frame",
".",
"FrameContext",
"{",
"if",
"a",
".",
"sigreturnfn",
"==",
"nil",
"... | // FixFrameUnwindContext adds default architecture rules to fctxt or returns
// the default frame unwind context if fctxt is nil. | [
"FixFrameUnwindContext",
"adds",
"default",
"architecture",
"rules",
"to",
"fctxt",
"or",
"returns",
"the",
"default",
"frame",
"unwind",
"context",
"if",
"fctxt",
"is",
"nil",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/arch.go#L97-L176 |
127,677 | go-delve/delve | pkg/proc/arch.go | RegistersToDwarfRegisters | func (a *AMD64) RegistersToDwarfRegisters(regs Registers, staticBase uint64) op.DwarfRegisters {
dregs := make([]*op.DwarfRegister, maxAmd64DwarfRegister()+1)
dregs[amd64DwarfIPRegNum] = op.DwarfRegisterFromUint64(regs.PC())
dregs[amd64DwarfSPRegNum] = op.DwarfRegisterFromUint64(regs.SP())
dregs[amd64DwarfBPRegNum... | go | func (a *AMD64) RegistersToDwarfRegisters(regs Registers, staticBase uint64) op.DwarfRegisters {
dregs := make([]*op.DwarfRegister, maxAmd64DwarfRegister()+1)
dregs[amd64DwarfIPRegNum] = op.DwarfRegisterFromUint64(regs.PC())
dregs[amd64DwarfSPRegNum] = op.DwarfRegisterFromUint64(regs.SP())
dregs[amd64DwarfBPRegNum... | [
"func",
"(",
"a",
"*",
"AMD64",
")",
"RegistersToDwarfRegisters",
"(",
"regs",
"Registers",
",",
"staticBase",
"uint64",
")",
"op",
".",
"DwarfRegisters",
"{",
"dregs",
":=",
"make",
"(",
"[",
"]",
"*",
"op",
".",
"DwarfRegister",
",",
"maxAmd64DwarfRegister... | // RegistersToDwarfRegisters converts hardware registers to the format used
// by the DWARF expression interpreter. | [
"RegistersToDwarfRegisters",
"converts",
"hardware",
"registers",
"to",
"the",
"format",
"used",
"by",
"the",
"DWARF",
"expression",
"interpreter",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/arch.go#L273-L296 |
127,678 | go-delve/delve | pkg/proc/arch.go | GoroutineToDwarfRegisters | func (a *AMD64) GoroutineToDwarfRegisters(g *G) op.DwarfRegisters {
dregs := make([]*op.DwarfRegister, amd64DwarfIPRegNum+1)
dregs[amd64DwarfIPRegNum] = op.DwarfRegisterFromUint64(g.PC)
dregs[amd64DwarfSPRegNum] = op.DwarfRegisterFromUint64(g.SP)
dregs[amd64DwarfBPRegNum] = op.DwarfRegisterFromUint64(g.BP)
return ... | go | func (a *AMD64) GoroutineToDwarfRegisters(g *G) op.DwarfRegisters {
dregs := make([]*op.DwarfRegister, amd64DwarfIPRegNum+1)
dregs[amd64DwarfIPRegNum] = op.DwarfRegisterFromUint64(g.PC)
dregs[amd64DwarfSPRegNum] = op.DwarfRegisterFromUint64(g.SP)
dregs[amd64DwarfBPRegNum] = op.DwarfRegisterFromUint64(g.BP)
return ... | [
"func",
"(",
"a",
"*",
"AMD64",
")",
"GoroutineToDwarfRegisters",
"(",
"g",
"*",
"G",
")",
"op",
".",
"DwarfRegisters",
"{",
"dregs",
":=",
"make",
"(",
"[",
"]",
"*",
"op",
".",
"DwarfRegister",
",",
"amd64DwarfIPRegNum",
"+",
"1",
")",
"\n",
"dregs",... | // GoroutineToDwarfRegisters extract the saved DWARF registers from a parked
// goroutine in the format used by the DWARF expression interpreter. | [
"GoroutineToDwarfRegisters",
"extract",
"the",
"saved",
"DWARF",
"registers",
"from",
"a",
"parked",
"goroutine",
"in",
"the",
"format",
"used",
"by",
"the",
"DWARF",
"expression",
"interpreter",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/arch.go#L300-L306 |
127,679 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | qSupported | func (conn *gdbConn) qSupported(multiprocess bool) (features map[string]bool, err error) {
q := qSupportedSimple
if multiprocess {
q = qSupportedMultiprocess
}
respBuf, err := conn.exec([]byte(q), "init/qSupported")
if err != nil {
return nil, err
}
resp := strings.Split(string(respBuf), ";")
features = mak... | go | func (conn *gdbConn) qSupported(multiprocess bool) (features map[string]bool, err error) {
q := qSupportedSimple
if multiprocess {
q = qSupportedMultiprocess
}
respBuf, err := conn.exec([]byte(q), "init/qSupported")
if err != nil {
return nil, err
}
resp := strings.Split(string(respBuf), ";")
features = mak... | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"qSupported",
"(",
"multiprocess",
"bool",
")",
"(",
"features",
"map",
"[",
"string",
"]",
"bool",
",",
"err",
"error",
")",
"{",
"q",
":=",
"qSupportedSimple",
"\n",
"if",
"multiprocess",
"{",
"q",
"=",
"qSup... | // qSupported interprets qSupported responses. | [
"qSupported",
"interprets",
"qSupported",
"responses",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L180-L205 |
127,680 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | disableAck | func (conn *gdbConn) disableAck() error {
_, err := conn.exec([]byte("$QStartNoAckMode"), "init/disableAck")
if err == nil {
conn.ack = false
}
return err
} | go | func (conn *gdbConn) disableAck() error {
_, err := conn.exec([]byte("$QStartNoAckMode"), "init/disableAck")
if err == nil {
conn.ack = false
}
return err
} | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"disableAck",
"(",
")",
"error",
"{",
"_",
",",
"err",
":=",
"conn",
".",
"exec",
"(",
"[",
"]",
"byte",
"(",
"\"",
"\"",
")",
",",
"\"",
"\"",
")",
"\n",
"if",
"err",
"==",
"nil",
"{",
"conn",
".",
... | // disableAck disables protocol acks. | [
"disableAck",
"disables",
"protocol",
"acks",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L208-L214 |
127,681 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | resume | func (conn *gdbConn) resume(sig uint8, tu *threadUpdater) (string, uint8, error) {
if conn.direction == proc.Forward {
conn.outbuf.Reset()
if sig == 0 {
fmt.Fprint(&conn.outbuf, "$vCont;c")
} else {
fmt.Fprintf(&conn.outbuf, "$vCont;C%02x", sig)
}
} else {
if err := conn.selectThread('c', "p-1.-1", "r... | go | func (conn *gdbConn) resume(sig uint8, tu *threadUpdater) (string, uint8, error) {
if conn.direction == proc.Forward {
conn.outbuf.Reset()
if sig == 0 {
fmt.Fprint(&conn.outbuf, "$vCont;c")
} else {
fmt.Fprintf(&conn.outbuf, "$vCont;C%02x", sig)
}
} else {
if err := conn.selectThread('c', "p-1.-1", "r... | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"resume",
"(",
"sig",
"uint8",
",",
"tu",
"*",
"threadUpdater",
")",
"(",
"string",
",",
"uint8",
",",
"error",
")",
"{",
"if",
"conn",
".",
"direction",
"==",
"proc",
".",
"Forward",
"{",
"conn",
".",
"out... | // resume executes a 'vCont' command on all threads with action 'c' if sig
// is 0 or 'C' if it isn't. | [
"resume",
"executes",
"a",
"vCont",
"command",
"on",
"all",
"threads",
"with",
"action",
"c",
"if",
"sig",
"is",
"0",
"or",
"C",
"if",
"it",
"isn",
"t",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L543-L575 |
127,682 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | step | func (conn *gdbConn) step(threadID string, tu *threadUpdater) (string, uint8, error) {
if conn.direction == proc.Forward {
conn.outbuf.Reset()
fmt.Fprintf(&conn.outbuf, "$vCont;s:%s", threadID)
} else {
if err := conn.selectThread('c', threadID, "step"); err != nil {
return "", 0, err
}
conn.outbuf.Reset... | go | func (conn *gdbConn) step(threadID string, tu *threadUpdater) (string, uint8, error) {
if conn.direction == proc.Forward {
conn.outbuf.Reset()
fmt.Fprintf(&conn.outbuf, "$vCont;s:%s", threadID)
} else {
if err := conn.selectThread('c', threadID, "step"); err != nil {
return "", 0, err
}
conn.outbuf.Reset... | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"step",
"(",
"threadID",
"string",
",",
"tu",
"*",
"threadUpdater",
")",
"(",
"string",
",",
"uint8",
",",
"error",
")",
"{",
"if",
"conn",
".",
"direction",
"==",
"proc",
".",
"Forward",
"{",
"conn",
".",
... | // step executes a 'vCont' command on the specified thread with 's' action. | [
"step",
"executes",
"a",
"vCont",
"command",
"on",
"the",
"specified",
"thread",
"with",
"s",
"action",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L578-L593 |
127,683 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | sendCtrlC | func (conn *gdbConn) sendCtrlC() error {
conn.log.Debug("<- interrupt")
_, err := conn.conn.Write([]byte{ctrlC})
return err
} | go | func (conn *gdbConn) sendCtrlC() error {
conn.log.Debug("<- interrupt")
_, err := conn.conn.Write([]byte{ctrlC})
return err
} | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"sendCtrlC",
"(",
")",
"error",
"{",
"conn",
".",
"log",
".",
"Debug",
"(",
"\"",
"\"",
")",
"\n",
"_",
",",
"err",
":=",
"conn",
".",
"conn",
".",
"Write",
"(",
"[",
"]",
"byte",
"{",
"ctrlC",
"}",
"... | // executes a ctrl-C on the line | [
"executes",
"a",
"ctrl",
"-",
"C",
"on",
"the",
"line"
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L721-L725 |
127,684 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | threadStopInfo | func (conn *gdbConn) threadStopInfo(threadID string) (sig uint8, reason string, err error) {
conn.outbuf.Reset()
fmt.Fprintf(&conn.outbuf, "$qThreadStopInfo%s", threadID)
resp, err := conn.exec(conn.outbuf.Bytes(), "thread stop info")
if err != nil {
return 0, "", err
}
_, sp, err := conn.parseStopPacket(resp, ... | go | func (conn *gdbConn) threadStopInfo(threadID string) (sig uint8, reason string, err error) {
conn.outbuf.Reset()
fmt.Fprintf(&conn.outbuf, "$qThreadStopInfo%s", threadID)
resp, err := conn.exec(conn.outbuf.Bytes(), "thread stop info")
if err != nil {
return 0, "", err
}
_, sp, err := conn.parseStopPacket(resp, ... | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"threadStopInfo",
"(",
"threadID",
"string",
")",
"(",
"sig",
"uint8",
",",
"reason",
"string",
",",
"err",
"error",
")",
"{",
"conn",
".",
"outbuf",
".",
"Reset",
"(",
")",
"\n",
"fmt",
".",
"Fprintf",
"(",
... | // threadStopInfo executes a 'qThreadStopInfo' and returns the reason the
// thread stopped. | [
"threadStopInfo",
"executes",
"a",
"qThreadStopInfo",
"and",
"returns",
"the",
"reason",
"the",
"thread",
"stopped",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L908-L920 |
127,685 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | restart | func (conn *gdbConn) restart(pos string) error {
conn.outbuf.Reset()
fmt.Fprint(&conn.outbuf, "$vRun;")
if pos != "" {
fmt.Fprint(&conn.outbuf, ";")
writeAsciiBytes(&conn.outbuf, []byte(pos))
}
_, err := conn.exec(conn.outbuf.Bytes(), "restart")
return err
} | go | func (conn *gdbConn) restart(pos string) error {
conn.outbuf.Reset()
fmt.Fprint(&conn.outbuf, "$vRun;")
if pos != "" {
fmt.Fprint(&conn.outbuf, ";")
writeAsciiBytes(&conn.outbuf, []byte(pos))
}
_, err := conn.exec(conn.outbuf.Bytes(), "restart")
return err
} | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"restart",
"(",
"pos",
"string",
")",
"error",
"{",
"conn",
".",
"outbuf",
".",
"Reset",
"(",
")",
"\n",
"fmt",
".",
"Fprint",
"(",
"&",
"conn",
".",
"outbuf",
",",
"\"",
"\"",
")",
"\n",
"if",
"pos",
"... | // restart executes a 'vRun' command. | [
"restart",
"executes",
"a",
"vRun",
"command",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L923-L932 |
127,686 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | qRRCmd | func (conn *gdbConn) qRRCmd(args ...string) (string, error) {
if len(args) == 0 {
panic("must specify at least one argument for qRRCmd")
}
conn.outbuf.Reset()
fmt.Fprint(&conn.outbuf, "$qRRCmd")
for _, arg := range args {
fmt.Fprint(&conn.outbuf, ":")
writeAsciiBytes(&conn.outbuf, []byte(arg))
}
resp, err ... | go | func (conn *gdbConn) qRRCmd(args ...string) (string, error) {
if len(args) == 0 {
panic("must specify at least one argument for qRRCmd")
}
conn.outbuf.Reset()
fmt.Fprint(&conn.outbuf, "$qRRCmd")
for _, arg := range args {
fmt.Fprint(&conn.outbuf, ":")
writeAsciiBytes(&conn.outbuf, []byte(arg))
}
resp, err ... | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"qRRCmd",
"(",
"args",
"...",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"if",
"len",
"(",
"args",
")",
"==",
"0",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"conn",
".",
"outbuf",
... | // qRRCmd executes a qRRCmd command | [
"qRRCmd",
"executes",
"a",
"qRRCmd",
"command"
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L935-L955 |
127,687 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | getLoadedDynamicLibraries | func (conn *gdbConn) getLoadedDynamicLibraries() ([]imageDescription, error) {
cmd := []byte("$jGetLoadedDynamicLibrariesInfos:{\"fetch_all_solibs\":true}")
if err := conn.send(cmd); err != nil {
return nil, err
}
resp, err := conn.recv(cmd, "get dynamic libraries", true)
if err != nil {
return nil, err
}
va... | go | func (conn *gdbConn) getLoadedDynamicLibraries() ([]imageDescription, error) {
cmd := []byte("$jGetLoadedDynamicLibrariesInfos:{\"fetch_all_solibs\":true}")
if err := conn.send(cmd); err != nil {
return nil, err
}
resp, err := conn.recv(cmd, "get dynamic libraries", true)
if err != nil {
return nil, err
}
va... | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"getLoadedDynamicLibraries",
"(",
")",
"(",
"[",
"]",
"imageDescription",
",",
"error",
")",
"{",
"cmd",
":=",
"[",
"]",
"byte",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
")",
"\n",
"if",
"err",
":=",
"conn",
".",
"... | // getLoadedDynamicLibraries executes jGetLoadedDynamicLibrariesInfos which
// returns the list of loaded dynamic libraries | [
"getLoadedDynamicLibraries",
"executes",
"jGetLoadedDynamicLibrariesInfos",
"which",
"returns",
"the",
"list",
"of",
"loaded",
"dynamic",
"libraries"
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L972-L984 |
127,688 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | readack | func (conn *gdbConn) readack() bool {
b, err := conn.rdr.ReadByte()
if err != nil {
return false
}
conn.log.Debugf("-> %s", string(b))
return b == '+'
} | go | func (conn *gdbConn) readack() bool {
b, err := conn.rdr.ReadByte()
if err != nil {
return false
}
conn.log.Debugf("-> %s", string(b))
return b == '+'
} | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"readack",
"(",
")",
"bool",
"{",
"b",
",",
"err",
":=",
"conn",
".",
"rdr",
".",
"ReadByte",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"conn",
".",
"log",
".",
... | // Readack reads one byte from stub, returns true if the byte is '+' | [
"Readack",
"reads",
"one",
"byte",
"from",
"stub",
"returns",
"true",
"if",
"the",
"byte",
"is",
"+"
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L1112-L1119 |
127,689 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | sendack | func (conn *gdbConn) sendack(c byte) {
if c != '+' && c != '-' {
panic(fmt.Errorf("sendack(%c)", c))
}
conn.conn.Write([]byte{c})
conn.log.Debugf("<- %s", string(c))
} | go | func (conn *gdbConn) sendack(c byte) {
if c != '+' && c != '-' {
panic(fmt.Errorf("sendack(%c)", c))
}
conn.conn.Write([]byte{c})
conn.log.Debugf("<- %s", string(c))
} | [
"func",
"(",
"conn",
"*",
"gdbConn",
")",
"sendack",
"(",
"c",
"byte",
")",
"{",
"if",
"c",
"!=",
"'+'",
"&&",
"c",
"!=",
"'-'",
"{",
"panic",
"(",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"c",
")",
")",
"\n",
"}",
"\n",
"conn",
".",
"co... | // Sendack executes an ack character, c must be either '+' or '-' | [
"Sendack",
"executes",
"an",
"ack",
"character",
"c",
"must",
"be",
"either",
"+",
"or",
"-"
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L1122-L1128 |
127,690 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | wiredecode | func wiredecode(in, buf []byte) (newbuf, msg []byte) {
if buf != nil {
buf = buf[:0]
} else {
buf = make([]byte, 0, 256)
}
start := 1
for i := 0; i < len(in); i++ {
switch ch := in[i]; ch {
case '{': // escape
if i+1 >= len(in) {
buf = append(buf, ch)
} else {
buf = append(buf, in[i+1]^esca... | go | func wiredecode(in, buf []byte) (newbuf, msg []byte) {
if buf != nil {
buf = buf[:0]
} else {
buf = make([]byte, 0, 256)
}
start := 1
for i := 0; i < len(in); i++ {
switch ch := in[i]; ch {
case '{': // escape
if i+1 >= len(in) {
buf = append(buf, ch)
} else {
buf = append(buf, in[i+1]^esca... | [
"func",
"wiredecode",
"(",
"in",
",",
"buf",
"[",
"]",
"byte",
")",
"(",
"newbuf",
",",
"msg",
"[",
"]",
"byte",
")",
"{",
"if",
"buf",
"!=",
"nil",
"{",
"buf",
"=",
"buf",
"[",
":",
"0",
"]",
"\n",
"}",
"else",
"{",
"buf",
"=",
"make",
"("... | // wiredecode decodes the contents of in into buf.
// If buf is nil it will be allocated ex-novo, if the size of buf is not
// enough to hold the decoded contents it will be grown.
// Returns the newly allocated buffer as newbuf and the message contents as
// msg. | [
"wiredecode",
"decodes",
"the",
"contents",
"of",
"in",
"into",
"buf",
".",
"If",
"buf",
"is",
"nil",
"it",
"will",
"be",
"allocated",
"ex",
"-",
"novo",
"if",
"the",
"size",
"of",
"buf",
"is",
"not",
"enough",
"to",
"hold",
"the",
"decoded",
"contents... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L1138-L1180 |
127,691 | go-delve/delve | pkg/proc/gdbserial/gdbserver_conn.go | checksumok | func checksumok(packet, checksumBuf []byte) bool {
if packet[0] != '$' {
return false
}
sum := checksum(packet)
tgt, err := strconv.ParseUint(string(checksumBuf), 16, 8)
if err != nil {
return false
}
return sum == uint8(tgt)
} | go | func checksumok(packet, checksumBuf []byte) bool {
if packet[0] != '$' {
return false
}
sum := checksum(packet)
tgt, err := strconv.ParseUint(string(checksumBuf), 16, 8)
if err != nil {
return false
}
return sum == uint8(tgt)
} | [
"func",
"checksumok",
"(",
"packet",
",",
"checksumBuf",
"[",
"]",
"byte",
")",
"bool",
"{",
"if",
"packet",
"[",
"0",
"]",
"!=",
"'$'",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"sum",
":=",
"checksum",
"(",
"packet",
")",
"\n",
"tgt",
",",
"err"... | // Checksumok checks that checksum is a valid checksum for packet. | [
"Checksumok",
"checks",
"that",
"checksum",
"is",
"a",
"valid",
"checksum",
"for",
"packet",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/gdbserial/gdbserver_conn.go#L1213-L1224 |
127,692 | go-delve/delve | pkg/proc/native/ptrace_linux.go | PtracePokeUser | func PtracePokeUser(tid int, off, addr uintptr) error {
_, _, err := sys.Syscall6(sys.SYS_PTRACE, sys.PTRACE_POKEUSR, uintptr(tid), uintptr(off), uintptr(addr), 0, 0)
if err != syscall.Errno(0) {
return err
}
return nil
} | go | func PtracePokeUser(tid int, off, addr uintptr) error {
_, _, err := sys.Syscall6(sys.SYS_PTRACE, sys.PTRACE_POKEUSR, uintptr(tid), uintptr(off), uintptr(addr), 0, 0)
if err != syscall.Errno(0) {
return err
}
return nil
} | [
"func",
"PtracePokeUser",
"(",
"tid",
"int",
",",
"off",
",",
"addr",
"uintptr",
")",
"error",
"{",
"_",
",",
"_",
",",
"err",
":=",
"sys",
".",
"Syscall6",
"(",
"sys",
".",
"SYS_PTRACE",
",",
"sys",
".",
"PTRACE_POKEUSR",
",",
"uintptr",
"(",
"tid",... | // PtracePokeUser execute ptrace PTRACE_POKE_USER. | [
"PtracePokeUser",
"execute",
"ptrace",
"PTRACE_POKE_USER",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/ptrace_linux.go#L37-L43 |
127,693 | go-delve/delve | pkg/proc/native/ptrace_linux.go | PtracePeekUser | func PtracePeekUser(tid int, off uintptr) (uintptr, error) {
var val uintptr
_, _, err := syscall.Syscall6(syscall.SYS_PTRACE, syscall.PTRACE_PEEKUSR, uintptr(tid), uintptr(off), uintptr(unsafe.Pointer(&val)), 0, 0)
if err != syscall.Errno(0) {
return 0, err
}
return val, nil
} | go | func PtracePeekUser(tid int, off uintptr) (uintptr, error) {
var val uintptr
_, _, err := syscall.Syscall6(syscall.SYS_PTRACE, syscall.PTRACE_PEEKUSR, uintptr(tid), uintptr(off), uintptr(unsafe.Pointer(&val)), 0, 0)
if err != syscall.Errno(0) {
return 0, err
}
return val, nil
} | [
"func",
"PtracePeekUser",
"(",
"tid",
"int",
",",
"off",
"uintptr",
")",
"(",
"uintptr",
",",
"error",
")",
"{",
"var",
"val",
"uintptr",
"\n",
"_",
",",
"_",
",",
"err",
":=",
"syscall",
".",
"Syscall6",
"(",
"syscall",
".",
"SYS_PTRACE",
",",
"sysc... | // PtracePeekUser execute ptrace PTRACE_PEEK_USER. | [
"PtracePeekUser",
"execute",
"ptrace",
"PTRACE_PEEK_USER",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/pkg/proc/native/ptrace_linux.go#L46-L53 |
127,694 | go-delve/delve | service/rpc2/server.go | ProcessPid | func (s *RPCServer) ProcessPid(arg ProcessPidIn, out *ProcessPidOut) error {
out.Pid = s.debugger.ProcessPid()
return nil
} | go | func (s *RPCServer) ProcessPid(arg ProcessPidIn, out *ProcessPidOut) error {
out.Pid = s.debugger.ProcessPid()
return nil
} | [
"func",
"(",
"s",
"*",
"RPCServer",
")",
"ProcessPid",
"(",
"arg",
"ProcessPidIn",
",",
"out",
"*",
"ProcessPidOut",
")",
"error",
"{",
"out",
".",
"Pid",
"=",
"s",
".",
"debugger",
".",
"ProcessPid",
"(",
")",
"\n",
"return",
"nil",
"\n",
"}"
] | // ProcessPid returns the pid of the process we are debugging. | [
"ProcessPid",
"returns",
"the",
"pid",
"of",
"the",
"process",
"we",
"are",
"debugging",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L32-L35 |
127,695 | go-delve/delve | service/rpc2/server.go | Detach | func (s *RPCServer) Detach(arg DetachIn, out *DetachOut) error {
err := s.debugger.Detach(arg.Kill)
if s.config.DisconnectChan != nil {
close(s.config.DisconnectChan)
s.config.DisconnectChan = nil
}
return err
} | go | func (s *RPCServer) Detach(arg DetachIn, out *DetachOut) error {
err := s.debugger.Detach(arg.Kill)
if s.config.DisconnectChan != nil {
close(s.config.DisconnectChan)
s.config.DisconnectChan = nil
}
return err
} | [
"func",
"(",
"s",
"*",
"RPCServer",
")",
"Detach",
"(",
"arg",
"DetachIn",
",",
"out",
"*",
"DetachOut",
")",
"error",
"{",
"err",
":=",
"s",
".",
"debugger",
".",
"Detach",
"(",
"arg",
".",
"Kill",
")",
"\n",
"if",
"s",
".",
"config",
".",
"Disc... | // Detach detaches the debugger, optionally killing the process. | [
"Detach",
"detaches",
"the",
"debugger",
"optionally",
"killing",
"the",
"process",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L57-L64 |
127,696 | go-delve/delve | service/rpc2/server.go | Restart | func (s *RPCServer) Restart(arg RestartIn, out *RestartOut) error {
if s.config.AttachPid != 0 {
return errors.New("cannot restart process Delve did not create")
}
var err error
out.DiscardedBreakpoints, err = s.debugger.Restart(arg.Position, arg.ResetArgs, arg.NewArgs)
return err
} | go | func (s *RPCServer) Restart(arg RestartIn, out *RestartOut) error {
if s.config.AttachPid != 0 {
return errors.New("cannot restart process Delve did not create")
}
var err error
out.DiscardedBreakpoints, err = s.debugger.Restart(arg.Position, arg.ResetArgs, arg.NewArgs)
return err
} | [
"func",
"(",
"s",
"*",
"RPCServer",
")",
"Restart",
"(",
"arg",
"RestartIn",
",",
"out",
"*",
"RestartOut",
")",
"error",
"{",
"if",
"s",
".",
"config",
".",
"AttachPid",
"!=",
"0",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
... | // Restart restarts program. | [
"Restart",
"restarts",
"program",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L83-L90 |
127,697 | go-delve/delve | service/rpc2/server.go | State | func (s *RPCServer) State(arg StateIn, out *StateOut) error {
st, err := s.debugger.State(arg.NonBlocking)
if err != nil {
return err
}
out.State = st
return nil
} | go | func (s *RPCServer) State(arg StateIn, out *StateOut) error {
st, err := s.debugger.State(arg.NonBlocking)
if err != nil {
return err
}
out.State = st
return nil
} | [
"func",
"(",
"s",
"*",
"RPCServer",
")",
"State",
"(",
"arg",
"StateIn",
",",
"out",
"*",
"StateOut",
")",
"error",
"{",
"st",
",",
"err",
":=",
"s",
".",
"debugger",
".",
"State",
"(",
"arg",
".",
"NonBlocking",
")",
"\n",
"if",
"err",
"!=",
"ni... | // State returns the current debugger state. | [
"State",
"returns",
"the",
"current",
"debugger",
"state",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L102-L109 |
127,698 | go-delve/delve | service/rpc2/server.go | Command | func (s *RPCServer) Command(command api.DebuggerCommand, cb service.RPCCallback) {
st, err := s.debugger.Command(&command)
if err != nil {
cb.Return(nil, err)
return
}
var out CommandOut
out.State = *st
cb.Return(out, nil)
} | go | func (s *RPCServer) Command(command api.DebuggerCommand, cb service.RPCCallback) {
st, err := s.debugger.Command(&command)
if err != nil {
cb.Return(nil, err)
return
}
var out CommandOut
out.State = *st
cb.Return(out, nil)
} | [
"func",
"(",
"s",
"*",
"RPCServer",
")",
"Command",
"(",
"command",
"api",
".",
"DebuggerCommand",
",",
"cb",
"service",
".",
"RPCCallback",
")",
"{",
"st",
",",
"err",
":=",
"s",
".",
"debugger",
".",
"Command",
"(",
"&",
"command",
")",
"\n",
"if",... | // Command interrupts, continues and steps through the program. | [
"Command",
"interrupts",
"continues",
"and",
"steps",
"through",
"the",
"program",
"."
] | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L116-L125 |
127,699 | go-delve/delve | service/rpc2/server.go | Stacktrace | func (s *RPCServer) Stacktrace(arg StacktraceIn, out *StacktraceOut) error {
cfg := arg.Cfg
if cfg == nil && arg.Full {
cfg = &api.LoadConfig{true, 1, 64, 64, -1}
}
var err error
out.Locations, err = s.debugger.Stacktrace(arg.Id, arg.Depth, arg.Defers, api.LoadConfigToProc(cfg))
return err
} | go | func (s *RPCServer) Stacktrace(arg StacktraceIn, out *StacktraceOut) error {
cfg := arg.Cfg
if cfg == nil && arg.Full {
cfg = &api.LoadConfig{true, 1, 64, 64, -1}
}
var err error
out.Locations, err = s.debugger.Stacktrace(arg.Id, arg.Depth, arg.Defers, api.LoadConfigToProc(cfg))
return err
} | [
"func",
"(",
"s",
"*",
"RPCServer",
")",
"Stacktrace",
"(",
"arg",
"StacktraceIn",
",",
"out",
"*",
"StacktraceOut",
")",
"error",
"{",
"cfg",
":=",
"arg",
".",
"Cfg",
"\n",
"if",
"cfg",
"==",
"nil",
"&&",
"arg",
".",
"Full",
"{",
"cfg",
"=",
"&",
... | // Stacktrace returns stacktrace of goroutine Id up to the specified Depth.
//
// If Full is set it will also the variable of all local variables
// and function arguments of all stack frames. | [
"Stacktrace",
"returns",
"stacktrace",
"of",
"goroutine",
"Id",
"up",
"to",
"the",
"specified",
"Depth",
".",
"If",
"Full",
"is",
"set",
"it",
"will",
"also",
"the",
"variable",
"of",
"all",
"local",
"variables",
"and",
"function",
"arguments",
"of",
"all",
... | 71a7fe04d9a7f7292146988f0e737aea47543dd0 | https://github.com/go-delve/delve/blob/71a7fe04d9a7f7292146988f0e737aea47543dd0/service/rpc2/server.go#L170-L178 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.