Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
2308-etp.py-Strip-literal-tags-from-list-and-bo...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2308-etp.py-Strip-literal-tags-from-list-and-boxed-pointe.patch of Package erlang
From afcde572b71680194cbca826c0b40b75a4514d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Wed, 14 Apr 2021 10:29:59 +0200 Subject: [PATCH 7/7] etp.py: Strip literal tags from list and boxed pointers On some platforms and in DEBUG builds, list and boxed pointers have a bit set to indicate that the term resides in a literal pool. To correctly print such literal terms, we must remove the literal bit. --- erts/etc/unix/etp.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/erts/etc/unix/etp.py b/erts/etc/unix/etp.py index e9a8b25aee..38c9e18408 100644 --- a/erts/etc/unix/etp.py +++ b/erts/etc/unix/etp.py @@ -290,6 +290,7 @@ def eterm_summary(valobj, internal_dict): def eterm(valobj, depth = float('inf')): val = valobj.unsigned + valobj = strip_literal_tag(valobj) tag = val & 0x3 if tag == 0x1: return cons(valobj, depth) @@ -306,7 +307,7 @@ def eterm(valobj, depth = float('inf')): def cons(valobj, depth = float('inf')): items = [] - cdr = valobj + cdr = strip_literal_tag(valobj) improper = False truncated = False depth *= 20 @@ -319,6 +320,7 @@ def cons(valobj, depth = float('inf')): return "#ConsError<%x>" % cdr.unsigned; while True: + cdr = strip_literal_tag(cdr) ptr = cdr.CreateValueFromData( "unconsed", lldb.SBData.CreateDataFromInt(cdr.unsigned - 1), @@ -669,6 +671,20 @@ def pixdata2data(valobj): data |= (pixdata & pix_cli_mask) << pix_cli_shift return data +def strip_literal_tag(valobj): + if valobj.size == 4: + # This is a 32-bit executable. There are no literal tags. + return valobj + + # Strip literal tags from list and boxed terms. + primary_tag = valobj.unsigned & 0x03 + if (primary_tag == 1 or primary_tag == 2) and valobj.unsigned & 0x04: + valobj = valobj.CreateValueFromData( + valobj.name, + lldb.SBData.CreateDataFromInt(valobj.unsigned - 0x04), + Eterm(valobj.target)) + return valobj + def init(target): names = ['beam_apply', 'beam_normal_exit', 'beam_exit', 'beam_save_calls', 'beam_bif_export_trap', 'beam_export_trampoline', 'beam_continue_exit', -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor