/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ghidra.app.util.bin.format.pdb2.pdbreader;

/**
 * A PDB C13 inlinee source line record
 */
public class C13InlineeSourceLine {
	protected long inlinee; // unsigned 32-bit
	protected int fileId;
	protected int sourceLineNum;

	static int getBaseRecordSize() {
		return 12;
	}

	C13InlineeSourceLine(PdbByteReader reader) throws PdbException {
		inlinee = reader.parseUnsignedIntVal();
		fileId = reader.parseInt();
		sourceLineNum = reader.parseInt();
	}

	/**
	 * Returns the inlinee value.  Not sure how to interpret this value at this time
	 * @return the inlinee value
	 */
	public long getInlinee() {
		return inlinee;
	}

	/**
	 * Returns the file ID
	 * @return the file ID
	 */
	public int getFileId() {
		return fileId;
	}

	/**
	 * Returns the source line number
	 * @return the line number
	 */
	public long getSourceLineNum() {
		return sourceLineNum;
	}

	@Override
	public String toString() {
		return String.format("0x%09x, 0x%06x, %d", inlinee, fileId, sourceLineNum);
	}
}
