Skip to content

Commit 48fec8f

Browse files
committed
Updates rst docs and rename "log2align" to "alignment".
1 parent 150bbe0 commit 48fec8f

File tree

3 files changed

+53
-6
lines changed

3 files changed

+53
-6
lines changed

lldb/docs/use/symbolfilejson.rst

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,61 @@ sections
7474
* ``type``: a string representing the section type (see below).
7575
* ``address``: a number representing the section file address.
7676
* ``size``: a number representing the section size in bytes.
77+
* ``read``: a boolean value indicating if the section has read permissions.
78+
* ``write``: a boolean value indicating if the section has write permissions.
79+
* ``execute``: a boolean value indicating if the section has execute permissions.
80+
* ``subsections``: An array of child sections in the same format.
81+
* ``user_id``: a number representing the section identifier.
82+
* ``file_offset``: a number that represents the offset in the file for this section's contents.
83+
* ``file_size``: a number that represents the size in bytes in the file for this section's contents.
84+
* ``alignment``: a boolean value indicating if the section has execute permissions.
85+
* ``fake``: a boolean value indicating if the section is fake.
86+
* ``encrypted``: a boolean value indicating if the section is encrypted.
87+
* ``thread_specific``: a boolean value indicating if the section is thread specific.
7788

7889
.. code-block:: JSON
7990
8091
{
81-
"name": "__TEXT",
82-
"type": "code",
83-
"address": 0,
84-
"size": 546,
92+
"user_id": 256,
93+
"name": "__TEXT",
94+
"type": "code",
95+
"address": 0,
96+
"size": 546,
97+
"file_offset": 0,
98+
"file_size": 4096,
99+
"read": true,
100+
"write": false,
101+
"executable": true,
102+
"subsections": [
103+
{
104+
"name": "__text",
105+
"type": "code",
106+
"address": 0,
107+
"size": 200,
108+
"alignment": 2,
109+
"read": true,
110+
"write": false,
111+
"execute": true
112+
},
113+
{
114+
"name": "__fake",
115+
"address": 200,
116+
"size": 10,
117+
"fake": true
118+
},
119+
{
120+
"name": "__encrypted",
121+
"address": 210,
122+
"size": 20,
123+
"encrypted": true
124+
},
125+
{
126+
"name": "__tls",
127+
"address": 230,
128+
"size": 30,
129+
"thread_specific": true
130+
}
131+
]
85132
}
86133
87134
The ``type`` field accepts the following values: ``code``, ``container``,

lldb/source/Core/Section.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ bool fromJSON(const llvm::json::Value &value,
694694
o.map("user_id", section.user_id) &&
695695
o.map("file_offset", section.file_offset) &&
696696
o.map("file_size", section.file_size) &&
697-
o.map("log2align", section.log2align) &&
697+
o.map("alignment", section.log2align) &&
698698
o.map("flags", section.flags) && o.map("fake", section.fake) &&
699699
o.map("encrypted", section.encrypted) &&
700700
o.map("thread_specific", section.thread_specific);

lldb/test/API/functionalities/json/object-file/TestObjectFileJSON.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_module(self):
100100
"type": "code",
101101
"address": TEXT_file_addr,
102102
"size": text_size,
103-
"log2align": 2,
103+
"alignment": 2,
104104
"read": True,
105105
"write": False,
106106
"execute": True,

0 commit comments

Comments
 (0)