mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +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
Notes:
sideshowbarker
2024-07-17 04:10:16 +09:00
Author: https://github.com/SebastianZaha Commit: https://github.com/SerenityOS/serenity/commit/100714b8ac Pull-request: https://github.com/SerenityOS/serenity/pull/20370 Reviewed-by: https://github.com/LucasChollet ✅
1 changed files with 2 additions and 5 deletions
|
@ -189,9 +189,7 @@ class AKStringView:
|
|||
if int(self.val["m_length"]) == 0:
|
||||
return '""'
|
||||
else:
|
||||
characters = self.val["m_characters"]
|
||||
str_type = characters.type.target().array(self.val["m_length"]).pointer()
|
||||
return str(characters.cast(str_type).dereference())
|
||||
return self.val["m_characters"].string(length=self.val["m_length"])
|
||||
|
||||
@classmethod
|
||||
def prettyprint_type(cls, type):
|
||||
|
@ -213,8 +211,7 @@ class AKStringImpl:
|
|||
if int(self.val["m_length"]) == 0:
|
||||
return '""'
|
||||
else:
|
||||
str_type = gdb.lookup_type("char").array(self.val["m_length"])
|
||||
return get_field_unalloced(self.val, "m_inline_buffer", str_type)
|
||||
return self.val["m_inline_buffer"].string(length=self.val["m_length"])
|
||||
|
||||
@classmethod
|
||||
def prettyprint_type(cls, type):
|
||||
|
|
Loading…
Reference in a new issue