Commit 73883601 authored by John Z Wu's avatar John Z Wu Committed by Chromium LUCI CQ

Delete stale lldb script tools/lldb/lldb_chrome.py

This was originally used to easily inspect string16 in Xcode lldb. It
seems this is not needed anymore since I can see string16 just fine w/o
this script.

Also delete the OWNERS file to let this directory be owned by top level
OWNERS. The OWNERS file was originally created for lldb_chrome.py, which
is no longer needed per above.

Change-Id: I676327e282d6243046df744f6e7de4184537ba98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625970Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Commit-Queue: John Wu <jzw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842783}
parent 08e185c5
jzw@chromium.org
ichikawa@chromium.org
# Copyright (c) 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
LLDB Support for Chromium types in Xcode
Add the following to your ~/.lldbinit:
command script import {Path to SRC Root}/tools/lldb/lldb_chrome.py
"""
import lldb
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('type summary add -F ' +
'lldb_chrome.basestring16_SummaryProvider base::string16')
def basestring16_SummaryProvider(valobj, internal_dict):
s = valobj.GetValueForExpressionPath('.__r_.__value_.__s')
l = valobj.GetValueForExpressionPath('.__r_.__value_.__l')
size = s.GetChildMemberWithName('__size_').GetValueAsUnsigned(0)
is_short_string = size & 128 == 0 # Assumes _LIBCPP_BIG_ENDIAN is defined.
if is_short_string:
length = size >> 1
data = s.GetChildMemberWithName('__data_').GetPointeeData(0, length)
else:
length = l.GetChildMemberWithName('__size_').GetValueAsUnsigned(0)
data = l.GetChildMemberWithName('__data_').GetPointeeData(0, length)
error = lldb.SBError()
bytes_to_read = 2 * length
if not bytes_to_read:
return '""'
byte_string = data.ReadRawData(error, 0, bytes_to_read)
if error.fail:
return 'Summary error: %s' % error.description
else:
return '"' + byte_string.decode('utf-16') + '"'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment