mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +00:00
Meta: Pretty-print strings in gdb as a single object, not by character
This changes the string pretty-printer to show strings as "full" as opposed to {"f", "u", "l", "l", "\0"}.
This commit is contained in:
parent
e13b89dd20
commit
100714b8ac
|
@ -189,9 +189,7 @@ class AKStringView:
|
||||||
if int(self.val["m_length"]) == 0:
|
if int(self.val["m_length"]) == 0:
|
||||||
return '""'
|
return '""'
|
||||||
else:
|
else:
|
||||||
characters = self.val["m_characters"]
|
return self.val["m_characters"].string(length=self.val["m_length"])
|
||||||
str_type = characters.type.target().array(self.val["m_length"]).pointer()
|
|
||||||
return str(characters.cast(str_type).dereference())
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def prettyprint_type(cls, type):
|
def prettyprint_type(cls, type):
|
||||||
|
@ -213,8 +211,7 @@ class AKStringImpl:
|
||||||
if int(self.val["m_length"]) == 0:
|
if int(self.val["m_length"]) == 0:
|
||||||
return '""'
|
return '""'
|
||||||
else:
|
else:
|
||||||
str_type = gdb.lookup_type("char").array(self.val["m_length"])
|
return self.val["m_inline_buffer"].string(length=self.val["m_length"])
|
||||||
return get_field_unalloced(self.val, "m_inline_buffer", str_type)
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def prettyprint_type(cls, type):
|
def prettyprint_type(cls, type):
|
||||||
|
|
Loading…
Reference in a new issue