Skip to content

[lldb][FreeBSD] Add FreeBSD specific AT_HWCAP value #84147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions lldb/source/Plugins/Process/Utility/AuxVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class AuxVector {
AuxVector(const lldb_private::DataExtractor &data);

/// Constants describing the type of entry.
/// On Linux, running "LD_SHOW_AUXV=1 ./executable" will spew AUX
/// On Linux and FreeBSD, running "LD_SHOW_AUXV=1 ./executable" will spew AUX
/// information. Added AUXV prefix to avoid potential conflicts with system-
/// defined macros
/// defined macros. For FreeBSD, the numbers can be found in sys/elf_common.h.
enum EntryType {
AUXV_AT_NULL = 0, ///< End of auxv.
AUXV_AT_IGNORE = 1, ///< Ignore entry.
Expand All @@ -39,6 +39,11 @@ class AuxVector {
AUXV_AT_EUID = 12, ///< Effective UID.
AUXV_AT_GID = 13, ///< GID.
AUXV_AT_EGID = 14, ///< Effective GID.

// At this point Linux and FreeBSD diverge and many of the following values
// are Linux specific. If you use them make sure you are in Linux specific
// code or they have the same value on other platforms.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if anyone knows the appropriate way to write this as a doxygen comment, that would be a great help.


AUXV_AT_CLKTCK = 17, ///< Clock frequency (e.g. times(2)).
AUXV_AT_PLATFORM = 15, ///< String identifying platform.
AUXV_AT_HWCAP =
Expand All @@ -60,6 +65,10 @@ class AuxVector {
AUXV_AT_L1D_CACHESHAPE = 35,
AUXV_AT_L2_CACHESHAPE = 36,
AUXV_AT_L3_CACHESHAPE = 37,

// Platform specific values which may overlap the Linux values.

AUXV_FREEBSD_AT_HWCAP = 25, ///< FreeBSD specific AT_HWCAP value.
};

std::optional<uint64_t> GetAuxValue(enum EntryType entry_type) const;
Expand Down