Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
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