-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[LLDB][NVIDIA] Add Disassembler log channel #148290
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
Conversation
This commit introduces a new log channel for the disassembler in LLDB, allowing for better logging of disassembler related activities. The `LLDBLOG` enum has been updated to include the `Disassembler` channel, and the relevant logging in the `DisassemblerLLVMC` plugin has been modified to utilize this new channel. This is in preparation for adding additional disassembler implementations. Key Changes: - Added `Disassembler` to the `LLDBLog` enum. - Updated logging in `DisassemblerLLVMC.cpp` to use the new `Disassembler` log channel.
|
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
|
@llvm/pr-subscribers-lldb Author: Andrew Gontarek (agontarek) ChangesThis commit introduces a new log channel for the disassembler in LLDB, allowing for better logging of disassembler related activities. The Key Changes:
Full diff: https://github.com/llvm/llvm-project/pull/148290.diff 3 Files Affected:
diff --git a/lldb/include/lldb/Utility/LLDBLog.h b/lldb/include/lldb/Utility/LLDBLog.h
index c7de41e74e85b..03190c27986a0 100644
--- a/lldb/include/lldb/Utility/LLDBLog.h
+++ b/lldb/include/lldb/Utility/LLDBLog.h
@@ -49,6 +49,7 @@ enum class LLDBLog : Log::MaskType {
Watchpoints = Log::ChannelFlag<30>,
OnDemand = Log::ChannelFlag<31>,
Source = Log::ChannelFlag<32>,
+ Disassembler = Log::ChannelFlag<33>,
LLVM_MARK_AS_BITMASK_ENUM(OnDemand),
};
diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index ed6047f8f4ef3..c48736ca0dd3b 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
@@ -1146,7 +1146,7 @@ class InstructionLLVMC : public lldb_private::Instruction {
}
}
- if (Log *log = GetLog(LLDBLog::Process)) {
+ if (Log *log = GetLog(LLDBLog::Disassembler)) {
StreamString ss;
ss.Printf("[%s] expands to %zu operands:\n", operands_string,
diff --git a/lldb/source/Utility/LLDBLog.cpp b/lldb/source/Utility/LLDBLog.cpp
index b193bd4eb07dc..613dae42064a8 100644
--- a/lldb/source/Utility/LLDBLog.cpp
+++ b/lldb/source/Utility/LLDBLog.cpp
@@ -64,6 +64,9 @@ static constexpr Log::Category g_categories[] = {
{"log symbol on-demand related activities"},
LLDBLog::OnDemand},
{{"source"}, {"log source related activities"}, LLDBLog::Source},
+ {{"disassembler"},
+ {"log disassembler related activities"},
+ LLDBLog::Disassembler},
};
static Log::Channel g_log_channel(g_categories,
|
|
Tagging @clayborg @walter-erquinigo for review. |
lldb/include/lldb/Utility/LLDBLog.h
Outdated
| OnDemand = Log::ChannelFlag<31>, | ||
| Source = Log::ChannelFlag<32>, | ||
| Disassembler = Log::ChannelFlag<33>, | ||
| LLVM_MARK_AS_BITMASK_ENUM(OnDemand), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to update this with the last enum. Someone forgot to do it when they added the Source enum. So this line should be:
LLVM_MARK_AS_BITMASK_ENUM(Disassembler),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Done.
| } | ||
|
|
||
| if (Log *log = GetLog(LLDBLog::Process)) { | ||
| if (Log *log = GetLog(LLDBLog::Disassembler)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have the option to specify multiple flag bits:
if (Log *log = GetLog(LLDBLog::Process | LLDBLog::Disassembler)) {
We might want to add this to ensure that the logging behavior doesn't change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
@agontarek Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
This commit introduces a new log channel for the disassembler in LLDB, allowing for better logging of disassembler related activities. The
LLDBLOGenum has been updated to include theDisassemblerchannel, and the relevant logging in theDisassemblerLLVMCplugin has been modified to utilize this new channel. This is in preparation for adding additional disassembler implementations.Key Changes:
Disassemblerto theLLDBLogenum.DisassemblerLLVMC.cppto use the newDisassemblerlog channel.