Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
db22e236
Commit
db22e236
authored
Feb 20, 2011
by
Luuk van Dijk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime-gdb.py: gdb pretty printer for go strings properly handles length.
R=rsc, r2 CC=golang-dev
https://golang.org/cl/4183060
parent
e041b998
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/pkg/runtime/runtime-gdb.py
src/pkg/runtime/runtime-gdb.py
+3
-2
No files found.
src/pkg/runtime/runtime-gdb.py
View file @
db22e236
...
...
@@ -13,7 +13,7 @@ path to this file based on the path to the runtime package.
# - pretty printing only works for the 'native' strings. E.g. 'type
# foo string' will make foo a plain struct in the eyes of gdb,
# circumventing the pretty print triggering.
# -
import
sys
,
re
...
...
@@ -39,7 +39,8 @@ class StringTypePrinter:
return
'string'
def
to_string
(
self
):
return
self
.
val
[
'str'
]
l
=
int
(
self
.
val
[
'len'
])
return
self
.
val
[
'str'
].
string
(
"utf-8"
,
"ignore"
,
l
)
class
SliceTypePrinter
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment