Skip to content

Commit 1b26036

Browse files
committed
format fixes
1 parent b17a12e commit 1b26036

19 files changed

+283
-276
lines changed

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/ClassEntry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ String getDirName() {
184184
}
185185

186186
public void setCUIndex(int cuIndex) {
187-
// should only get set once to a non-negative value
187+
// Should only get set once to a non-negative value.
188188
assert cuIndex >= 0;
189189
assert this.cuIndex == -1;
190190
this.cuIndex = cuIndex;
191191
}
192192

193193
public int getCUIndex() {
194-
// should have been set before being read
194+
// Should have been set before being read.
195195
assert cuIndex >= 0;
196196
return cuIndex;
197197
}

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/PrimaryEntry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ public PrimaryEntry(Range primary, List<DebugFrameSizeChange> frameSizeInfos, in
7272

7373
public void addSubRange(Range subrange, FileEntry subFileEntry) {
7474
/*
75-
* we should not see a subrange more than once
75+
* We should not see a subrange more than once.
7676
*/
7777
assert !subranges.contains(subrange);
7878
assert subrangeIndex.get(subrange) == null;
7979
/*
80-
* we need to generate a file table entry for all ranges
80+
* We need to generate a file table entry for all ranges.
8181
*/
8282
subranges.add(subrange);
8383
subrangeIndex.put(subrange, subFileEntry);

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/Range.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2020, 2020, Red Hat, Inc. All rights reserved.
3+
* Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -47,24 +47,24 @@ public class Range {
4747
private int hi;
4848
private int line;
4949
/*
50-
* this is null for a primary range
50+
* This is null for a primary range.
5151
*/
5252
private Range primary;
5353

5454
/*
55-
* create a primary range
55+
* Create a primary range.
5656
*/
5757
public Range(String fileName, Path filePath, String className, String methodName, String paramNames, String returnTypeName, StringTable stringTable, int lo, int hi, int line) {
5858
this(fileName, filePath, className, methodName, paramNames, returnTypeName, stringTable, lo, hi, line, null);
5959
}
6060

6161
/*
62-
* create a primary or secondary range
62+
* Create a primary or secondary range.
6363
*/
6464
public Range(String fileName, Path filePath, String className, String methodName, String paramNames, String returnTypeName, StringTable stringTable, int lo, int hi, int line, Range primary) {
6565
/*
66-
* currently file name and full method name need to go into the debug_str section other
67-
* strings just need to be deduplicated to save space
66+
* Currently file name and full method name need to go into the debug_str section other
67+
* strings just need to be deduplicated to save space.
6868
*/
6969
this.fileName = (fileName == null ? null : stringTable.uniqueDebugString(fileName));
7070
this.filePath = filePath;

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/StringEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2020, 2020, Red Hat, Inc. All rights reserved.
3+
* Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/StringTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2020, 2020, Red Hat, Inc. All rights reserved.
3+
* Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debuginfo/DebugInfoProvider.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,73 +39,73 @@
3939
*/
4040
public interface DebugInfoProvider {
4141
/**
42-
* access details of a specific type.
42+
* Access details of a specific type.
4343
*/
4444
interface DebugTypeInfo {
4545
}
4646

4747
/**
48-
* access details of a specific compiled method.
48+
* Access details of a specific compiled method.
4949
*/
5050
interface DebugCodeInfo {
5151
void debugContext(Consumer<DebugContext> action);
5252

5353
/**
54-
* @return the name of the file containing a compiled method excluding any path
54+
* @return the name of the file containing a compiled method excluding any path.
5555
*/
5656
String fileName();
5757

5858
/**
5959
* @return a relative path to the file containing a compiled method derived from its package
60-
* name or null if the method is in the empty package
60+
* name or null if the method is in the empty package.
6161
*/
6262
Path filePath();
6363

6464
/**
65-
* @return the fully qualified name of the class owning the compiled method
65+
* @return the fully qualified name of the class owning the compiled method.
6666
*/
6767
String className();
6868

6969
/**
70-
* @return the name of the compiled method including signature
70+
* @return the name of the compiled method including signature.
7171
*/
7272
String methodName();
7373

7474
/**
7575
* @return the lowest address containing code generated for the method represented as an
76-
* offset into the code segment
76+
* offset into the code segment.
7777
*/
7878
int addressLo();
7979

8080
/**
8181
* @return the first address above the code generated for the method represented as an
82-
* offset into the code segment
82+
* offset into the code segment.
8383
*/
8484
int addressHi();
8585

8686
/**
87-
* @return the starting line number for the method
87+
* @return the starting line number for the method.
8888
*/
8989
int line();
9090

9191
/**
9292
* @return a stream of records detailing line numbers and addresses within the compiled
93-
* method
93+
* method.
9494
*/
9595
Stream<DebugLineInfo> lineInfoProvider();
9696

9797
/**
98-
* @return a string identifying the method parameters
98+
* @return a string identifying the method parameters.
9999
*/
100100
String paramNames();
101101

102102
/**
103-
* @return a string identifying the method return type
103+
* @return a string identifying the method return type.
104104
*/
105105
String returnTypeName();
106106

107107
/**
108-
* @return the size of the method frame between prologue and epilogue
108+
* @return the size of the method frame between prologue and epilogue.
109109
*/
110110
int getFrameSize();
111111

@@ -117,51 +117,51 @@ interface DebugCodeInfo {
117117
}
118118

119119
/**
120-
* access details of a specific heap object.
120+
* Access details of a specific heap object.
121121
*/
122122
interface DebugDataInfo {
123123
}
124124

125125
/**
126-
* access details of code generated for a specific outer or inlined method at a given line
126+
* Access details of code generated for a specific outer or inlined method at a given line
127127
* number.
128128
*/
129129
interface DebugLineInfo {
130130
/**
131-
* @return the name of the file containing the outer or inlined method excluding any path
131+
* @return the name of the file containing the outer or inlined method excluding any path.
132132
*/
133133
String fileName();
134134

135135
/**
136136
* @return a relative path to the file containing the outer or inlined method derived from
137-
* its package name or null if the method is in the empty package
137+
* its package name or null if the method is in the empty package.
138138
*/
139139
Path filePath();
140140

141141
/**
142-
* @return the fully qualified name of the class owning the outer or inlined method
142+
* @return the fully qualified name of the class owning the outer or inlined method.
143143
*/
144144
String className();
145145

146146
/**
147-
* @return the name of the outer or inlined method including signature
147+
* @return the name of the outer or inlined method including signature.
148148
*/
149149
String methodName();
150150

151151
/**
152152
* @return the lowest address containing code generated for an outer or inlined code segment
153-
* reported at this line represented as an offset into the code segment
153+
* reported at this line represented as an offset into the code segment.
154154
*/
155155
int addressLo();
156156

157157
/**
158158
* @return the first address above the code generated for an outer or inlined code segment
159-
* reported at this line represented as an offset into the code segment
159+
* reported at this line represented as an offset into the code segment.
160160
*/
161161
int addressHi();
162162

163163
/**
164-
* @return the line number for the outer or inlined segment
164+
* @return the line number for the outer or inlined segment.
165165
*/
166166
int line();
167167
}

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/ELFObjectFile.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,36 +1168,38 @@ protected int getMinimumFileSize() {
11681168
@Override
11691169
public void installDebugInfo(DebugInfoProvider debugInfoProvider) {
11701170
DwarfSections dwarfSections = new DwarfSections(getMachine(), getByteOrder());
1171-
// we need an implementation for each section
1171+
/* We need an implementation for each generated DWARF section. */
11721172
DwarfStrSectionImpl elfStrSectionImpl = dwarfSections.getStrSectionImpl();
11731173
DwarfAbbrevSectionImpl elfAbbrevSectionImpl = dwarfSections.getAbbrevSectionImpl();
11741174
DwarfFrameSectionImpl frameSectionImpl = dwarfSections.getFrameSectionImpl();
11751175
DwarfInfoSectionImpl elfInfoSectionImpl = dwarfSections.getInfoSectionImpl();
11761176
DwarfARangesSectionImpl elfARangesSectionImpl = dwarfSections.getARangesSectionImpl();
11771177
DwarfLineSectionImpl elfLineSectionImpl = dwarfSections.getLineSectionImpl();
1178-
// now we can create the section elements with empty content
1178+
/* Now we can create the section elements with empty content. */
11791179
newUserDefinedSection(elfStrSectionImpl.getSectionName(), elfStrSectionImpl);
11801180
newUserDefinedSection(elfAbbrevSectionImpl.getSectionName(), elfAbbrevSectionImpl);
11811181
newUserDefinedSection(frameSectionImpl.getSectionName(), frameSectionImpl);
11821182
newUserDefinedSection(elfInfoSectionImpl.getSectionName(), elfInfoSectionImpl);
11831183
newUserDefinedSection(elfARangesSectionImpl.getSectionName(), elfARangesSectionImpl);
11841184
newUserDefinedSection(elfLineSectionImpl.getSectionName(), elfLineSectionImpl);
1185-
// the byte[] for each implementation's content are created and
1186-
// written under getOrDecideContent. doing that ensures that all
1187-
// dependent sections are filled in and then sized according to the
1188-
// declared dependencies. however, if we leave it at that then
1189-
// associated reloc sections only get created when the first reloc
1190-
// is inserted during content write that's too late for them to have
1191-
// layout constraints included in the layout decision set and causes
1192-
// an NPE during reloc section write. so we need to create the relevant
1193-
// reloc sections here in advance
1185+
/*
1186+
* The byte[] for each implementation's content are created and
1187+
* written under getOrDecideContent. Doing that ensures that all
1188+
* dependent sections are filled in and then sized according to the
1189+
* declared dependencies. However, if we leave it at that then
1190+
* associated reloc sections only get created when the first reloc
1191+
* is inserted during content write that's too late for them to have
1192+
* layout constraints included in the layout decision set and causes
1193+
* an NPE during reloc section write. So we need to create the relevant
1194+
* reloc sections here in advance.
1195+
*/
11941196
elfStrSectionImpl.getOrCreateRelocationElement(false);
11951197
elfAbbrevSectionImpl.getOrCreateRelocationElement(false);
11961198
frameSectionImpl.getOrCreateRelocationElement(false);
11971199
elfInfoSectionImpl.getOrCreateRelocationElement(false);
11981200
elfARangesSectionImpl.getOrCreateRelocationElement(false);
11991201
elfLineSectionImpl.getOrCreateRelocationElement(false);
1200-
// ok now we can populate the implementations
1202+
/* Ok now we can populate the debug info model. */
12011203
dwarfSections.installDebugInfo(debugInfoProvider);
12021204
}
12031205
}

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfARangesSectionImpl.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public String getSectionName() {
6161
public void createContent() {
6262
int pos = 0;
6363
/*
64-
* we need an entry for each compilation unit
64+
* We need an entry for each compilation unit.
6565
*
6666
* <ul>
6767
*
@@ -77,30 +77,30 @@ public void createContent() {
7777
*
7878
* </ul>
7979
*
80-
* i.e. 12 bytes followed by padding aligning up to 2 * address size
80+
* That is 12 bytes followed by padding aligning up to 2 * address size.
8181
*
8282
* <ul>
8383
*
8484
* <li><code>uint8 pad[4]</code>
8585
*
8686
* </ul>
8787
*
88-
* followed by N + 1 times
88+
* Followed by N + 1 times:
8989
*
9090
* <ul> <li><code>uint64 lo ................ lo address of range</code>
9191
*
9292
* <li><code>uint64 length ............ number of bytes in range</code>
9393
*
9494
* </ul>
9595
*
96-
* where N is the number of ranges belonging to the compilation unit and the last range
97-
* contains two zeroes
96+
* Where N is the number of ranges belonging to the compilation unit and the last range
97+
* contains two zeroes.
9898
*/
9999

100100
for (ClassEntry classEntry : getPrimaryClasses()) {
101101
pos += DW_AR_HEADER_SIZE;
102102
/*
103-
* align to 2 * address size
103+
* Align to 2 * address size.
104104
*/
105105
pos += DW_AR_HEADER_PAD_SIZE;
106106
pos += classEntry.getPrimaryEntries().size() * 2 * 8;
@@ -118,8 +118,8 @@ public byte[] getOrDecideContent(Map<ObjectFile.Element, LayoutDecisionMap> alre
118118
Object valueObj = decisionMap.getDecidedValue(LayoutDecision.Kind.VADDR);
119119
if (valueObj != null && valueObj instanceof Number) {
120120
/*
121-
* this may not be the final vaddr for the text segment but it will be close enough
122-
* to make debug easier i.e. to within a 4k page or two
121+
* This may not be the final vaddr for the text segment but it will be close enough
122+
* to make debug easier i.e. to within a 4k page or two.
123123
*/
124124
debugTextBase = ((Number) valueObj).longValue();
125125
}
@@ -142,22 +142,22 @@ public void writeContent(DebugContext context) {
142142
int cuIndex = classEntry.getCUIndex();
143143
LinkedList<PrimaryEntry> classPrimaryEntries = classEntry.getPrimaryEntries();
144144
/*
145-
* add room for each entry into length count
145+
* Add room for each entry into length count.
146146
*/
147147
length += classPrimaryEntries.size() * 2 * 8;
148148
length += 2 * 8;
149149
log(context, " [0x%08x] %s CU %d length 0x%x", pos, classEntry.getFileName(), cuIndex, length);
150150
pos = putInt(length, buffer, pos);
151-
/* dwarf version is always 2 */
151+
/* DWARF version is always 2. */
152152
pos = putShort(DW_VERSION_2, buffer, pos);
153153
pos = putInt(cuIndex, buffer, pos);
154-
/* address size is always 8 */
154+
/* Address size is always 8. */
155155
pos = putByte((byte) 8, buffer, pos);
156-
/* segment size is always 0 */
156+
/* Segment size is always 0. */
157157
pos = putByte((byte) 0, buffer, pos);
158158
assert (pos - lastpos) == DW_AR_HEADER_SIZE;
159159
/*
160-
* align to 2 * address size
160+
* Align to 2 * address size.
161161
*/
162162
for (int i = 0; i < DW_AR_HEADER_PAD_SIZE; i++) {
163163
pos = putByte((byte) 0, buffer, pos);
@@ -177,7 +177,7 @@ public void writeContent(DebugContext context) {
177177
}
178178

179179
/*
180-
* debug_aranges section content depends on debug_info section content and offset
180+
* The debug_aranges section content depends on debug_info section content and offset.
181181
*/
182182
private static final String TARGET_SECTION_NAME = DW_INFO_SECTION_NAME;
183183

0 commit comments

Comments
 (0)