1 //===-- LineEntry.h ---------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_LineEntry_h_
11 #define liblldb_LineEntry_h_
13 #include "lldb/lldb-private.h"
14 #include "lldb/Core/AddressRange.h"
15 #include "lldb/Host/FileSpec.h"
17 namespace lldb_private {
19 //----------------------------------------------------------------------
20 /// @class LineEntry LineEntry.h "lldb/Symbol/LineEntry.h"
21 /// @brief A line table entry class.
22 //----------------------------------------------------------------------
25 //------------------------------------------------------------------
26 /// Default constructor.
28 /// Initialize all member variables to invalid values.
29 //------------------------------------------------------------------
34 const lldb::SectionSP §ion_sp,
35 lldb::addr_t section_offset,
36 lldb::addr_t byte_size,
40 bool _is_start_of_statement,
41 bool _is_start_of_basic_block,
42 bool _is_prologue_end,
43 bool _is_epilogue_begin,
44 bool _is_terminal_entry
47 //------------------------------------------------------------------
48 /// Clear the object's state.
50 /// Clears all member variables to invalid values.
51 //------------------------------------------------------------------
55 //------------------------------------------------------------------
56 /// Dump a description of this object to a Stream.
58 /// Dump a description of the contents of this object to the
59 /// supplied stream \a s.
62 /// The stream to which to dump the object descripton.
64 /// @param[in] comp_unit
65 /// The compile unit object that contains the support file
66 /// list so the line entry can dump the file name (since this
67 /// object contains a file index into the support file list).
69 /// @param[in] show_file
70 /// If \b true, display the filename with the line entry which
71 /// requires that the compile unit object \a comp_unit be a
75 /// The display style for the section offset address.
78 /// Returns \b true if the address was able to be displayed
79 /// using \a style. File and load addresses may be unresolved
80 /// and it may not be possible to display a valid address value.
81 /// Returns \b false if the address was not able to be properly
84 /// @see Address::DumpStyle
85 //------------------------------------------------------------------
87 Dump (Stream *s, Target *target, bool show_file, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_range) const;
90 GetDescription (Stream *s,
91 lldb::DescriptionLevel level,
94 bool show_address_only) const;
96 //------------------------------------------------------------------
97 /// Dumps information specific to a process that stops at this
98 /// line entry to the supplied stream \a s.
101 /// The stream to which to dump the object descripton.
103 /// @param[in] comp_unit
104 /// The compile unit object that contains the support file
105 /// list so the line entry can dump the file name (since this
106 /// object contains a file index into the support file list).
109 /// Returns \b true if the file and line were properly dumped,
110 /// \b false otherwise.
111 //------------------------------------------------------------------
113 DumpStopContext (Stream *s, bool show_fullpaths) const;
115 //------------------------------------------------------------------
116 /// Check if a line entry object is valid.
119 /// Returns \b true if the line entry contains a valid section
120 /// offset address, file index, and line number, \b false
122 //------------------------------------------------------------------
126 //------------------------------------------------------------------
127 /// Compare two LineEntry objects.
130 /// The Left Hand Side const LineEntry object reference.
133 /// The Right Hand Side const LineEntry object reference.
136 /// @li -1 if lhs < rhs
137 /// @li 0 if lhs == rhs
138 /// @li 1 if lhs > rhs
139 //------------------------------------------------------------------
141 Compare (const LineEntry& lhs, const LineEntry& rhs);
144 //------------------------------------------------------------------
146 //------------------------------------------------------------------
147 AddressRange range; ///< The section offset address range for this line entry.
149 uint32_t line; ///< The source line number, or zero if there is no line number information.
150 uint16_t column; ///< The column number of the source line, or zero if there is no column information.
151 uint16_t is_start_of_statement:1, ///< Indicates this entry is the beginning of a statement.
152 is_start_of_basic_block:1, ///< Indicates this entry is the beginning of a basic block.
153 is_prologue_end:1, ///< Indicates this entry is one (of possibly many) where execution should be suspended for an entry breakpoint of a function.
154 is_epilogue_begin:1, ///< Indicates this entry is one (of possibly many) where execution should be suspended for an exit breakpoint of a function.
155 is_terminal_entry:1; ///< Indicates this entry is that of the first byte after the end of a sequence of target machine instructions.
158 //------------------------------------------------------------------
159 /// Less than operator.
162 /// The Left Hand Side const LineEntry object reference.
165 /// The Right Hand Side const LineEntry object reference.
168 /// Returns \b true if lhs < rhs, false otherwise.
169 //------------------------------------------------------------------
170 bool operator<(const LineEntry& lhs, const LineEntry& rhs);
172 } // namespace lldb_private
174 #endif // liblldb_LineEntry_h_