diff options
author | dim <dim@FreeBSD.org> | 2016-12-26 20:36:37 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-12-26 20:36:37 +0000 |
commit | 06210ae42d418d50d8d9365d5c9419308ae9e7ee (patch) | |
tree | ab60b4cdd6e430dda1f292a46a77ddb744723f31 /contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp | |
parent | 2dd166267f53df1c3748b4325d294b9b839de74b (diff) | |
download | FreeBSD-src-06210ae42d418d50d8d9365d5c9419308ae9e7ee.zip FreeBSD-src-06210ae42d418d50d8d9365d5c9419308ae9e7ee.tar.gz |
MFC r309124:
Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0
release, and add lld 3.9.0. Also completely revamp the build system for
clang, llvm, lldb and their related tools.
Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.
Release notes for llvm, clang and lld are available here:
<http://llvm.org/releases/3.9.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.9.0/tools/clang/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.9.0/tools/lld/docs/ReleaseNotes.html>
Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan
Beich for their help.
Relnotes: yes
MFC r309147:
Pull in r282174 from upstream llvm trunk (by Krzysztof Parzyszek):
[PPC] Set SP after loading data from stack frame, if no red zone is
present
Follow-up to r280705: Make sure that the SP is only restored after
all data is loaded from the stack frame, if there is no red zone.
This completes the fix for
https://llvm.org/bugs/show_bug.cgi?id=26519.
Differential Revision: https://reviews.llvm.org/D24466
Reported by: Mark Millard
PR: 214433
MFC r309149:
Pull in r283060 from upstream llvm trunk (by Hal Finkel):
[PowerPC] Refactor soft-float support, and enable PPC64 soft float
This change enables soft-float for PowerPC64, and also makes
soft-float disable all vector instruction sets for both 32-bit and
64-bit modes. This latter part is necessary because the PPC backend
canonicalizes many Altivec vector types to floating-point types, and
so soft-float breaks scalarization support for many operations. Both
for embedded targets and for operating-system kernels desiring
soft-float support, it seems reasonable that disabling hardware
floating-point also disables vector instructions (embedded targets
without hardware floating point support are unlikely to have Altivec,
etc. and operating system kernels desiring not to use floating-point
registers to lower syscall cost are unlikely to want to use vector
registers either). If someone needs this to work, we'll need to
change the fact that we promote many Altivec operations to act on
v4f32. To make it possible to disable Altivec when soft-float is
enabled, hardware floating-point support needs to be expressed as a
positive feature, like the others, and not a negative feature,
because target features cannot have dependencies on the disabling of
some other feature. So +soft-float has now become -hard-float.
Fixes PR26970.
Pull in r283061 from upstream clang trunk (by Hal Finkel):
[PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float
Enable soft-float support on PPC64, as the backend now supports it.
Also, the backend now uses -hard-float instead of +soft-float, so set
the target features accordingly.
Fixes PR26970.
Reported by: Mark Millard
PR: 214433
MFC r309212:
Add a few missed clang 3.9.0 files to OptionalObsoleteFiles.
MFC r309262:
Fix packaging for clang, lldb and lld 3.9.0
During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE
directive in the usr.bin/clang/*.mk files got dropped accidentally.
Restore it, with a few minor changes and additions:
* Correct license in clang.ucl to NCSA
* Add PACKAGE=clang for clang and most of the "ll" tools
* Put lldb in its own package
* Put lld in its own package
Reviewed by: gjb, jmallett
Differential Revision: https://reviews.freebsd.org/D8666
MFC r309656:
During the bootstrap phase, when building the minimal llvm library on
PowerPC, add lib/Support/Atomic.cpp. This is needed because upstream
llvm revision r271821 disabled the use of std::call_once, which causes
some fallback functions from Atomic.cpp to be used instead.
Reported by: Mark Millard
PR: 214902
MFC r309835:
Tentatively apply https://reviews.llvm.org/D18730 to work around gcc PR
70528 (bogus error: constructor required before non-static data member).
This should fix buildworld with the external gcc package.
Reported by: https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/
MFC r310194:
Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
3.9.1 release.
Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.
Release notes for llvm, clang and lld will be available here:
<http://releases.llvm.org/3.9.1/docs/ReleaseNotes.html>
<http://releases.llvm.org/3.9.1/tools/clang/docs/ReleaseNotes.html>
<http://releases.llvm.org/3.9.1/tools/lld/docs/ReleaseNotes.html>
Relnotes: yes
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp | 124 |
1 files changed, 53 insertions, 71 deletions
diff --git a/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index 7b58bf9..57572c8 100644 --- a/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -9,11 +9,10 @@ // C Includes // C++ Includes - - +// Other libraries and framework includes +// Project includes #include "CommandObjectBreakpointCommand.h" #include "CommandObjectBreakpoint.h" - #include "lldb/Core/IOHandler.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" @@ -32,21 +31,18 @@ using namespace lldb_private; // CommandObjectBreakpointCommandAdd //------------------------------------------------------------------------- - class CommandObjectBreakpointCommandAdd : public CommandObjectParsed, public IOHandlerDelegateMultiline { public: - - CommandObjectBreakpointCommandAdd (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "add", - "Add a set of commands to a breakpoint, to be executed whenever the breakpoint is hit." - " If no breakpoint is specified, adds the commands to the last created breakpoint.", - NULL), - IOHandlerDelegateMultiline ("DONE", IOHandlerDelegate::Completion::LLDBCommand), - m_options (interpreter) + CommandObjectBreakpointCommandAdd(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "add", + "Add LLDB commands to a breakpoint, to be executed whenever the breakpoint is hit." + " If no breakpoint is specified, adds the commands to the last created breakpoint.", + nullptr), + IOHandlerDelegateMultiline("DONE", IOHandlerDelegate::Completion::LLDBCommand), + m_options(interpreter) { SetHelpLong ( R"( @@ -178,7 +174,7 @@ are no syntax errors may indicate that a function was declared but never called. m_arguments.push_back (arg); } - ~CommandObjectBreakpointCommandAdd () override {} + ~CommandObjectBreakpointCommandAdd() override = default; Options * GetOptions () override @@ -196,8 +192,7 @@ are no syntax errors may indicate that a function was declared but never called. output_sp->Flush(); } } - - + void IOHandlerInputComplete (IOHandler &io_handler, std::string &line) override { @@ -210,7 +205,7 @@ are no syntax errors may indicate that a function was declared but never called. continue; std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData()); - if (data_ap.get()) + if (data_ap) { data_ap->user_source.SplitIntoLines (line.c_str(), line.size()); BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release())); @@ -248,7 +243,6 @@ are no syntax errors may indicate that a function was declared but never called. BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release())); bp_options->SetCallback (BreakpointOptionsCallbackFunction, baton_sp); } - return; } static bool @@ -258,10 +252,9 @@ are no syntax errors may indicate that a function was declared but never called. lldb::user_id_t break_loc_id) { bool ret_value = true; - if (baton == NULL) + if (baton == nullptr) return true; - - + BreakpointOptions::CommandData *data = (BreakpointOptions::CommandData *) baton; StringList &commands = data->user_source; @@ -302,7 +295,6 @@ are no syntax errors may indicate that a function was declared but never called. class CommandOptions : public Options { public: - CommandOptions (CommandInterpreter &interpreter) : Options (interpreter), m_use_commands (false), @@ -314,7 +306,7 @@ are no syntax errors may indicate that a function was declared but never called. { } - ~CommandOptions () override {} + ~CommandOptions() override = default; Error SetOptionValue (uint32_t option_idx, const char *option_arg) override @@ -355,11 +347,9 @@ are no syntax errors may indicate that a function was declared but never called. break; case 'F': - { - m_use_one_liner = false; - m_use_script_language = true; - m_function_name.assign(option_arg); - } + m_use_one_liner = false; + m_use_script_language = true; + m_function_name.assign(option_arg); break; case 'D': @@ -371,6 +361,7 @@ are no syntax errors may indicate that a function was declared but never called. } return error; } + void OptionParsingStarting () override { @@ -415,7 +406,7 @@ protected: { Target *target = GetSelectedOrDummyTarget(m_options.m_use_dummy); - if (target == NULL) + if (target == nullptr) { result.AppendError ("There is not a current executable; there are no breakpoints to which to add commands"); result.SetStatus (eReturnStatusFailed); @@ -432,7 +423,7 @@ protected: return false; } - if (m_options.m_use_script_language == false && m_options.m_function_name.size()) + if (!m_options.m_use_script_language && !m_options.m_function_name.empty()) { result.AppendError ("need to enable scripting to have a function run as a breakpoint command"); result.SetStatus (eReturnStatusFailed); @@ -454,7 +445,7 @@ protected: if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) { Breakpoint *bp = target->GetBreakpointByID (cur_bp_id.GetBreakpointID()).get(); - BreakpointOptions *bp_options = NULL; + BreakpointOptions *bp_options = nullptr; if (cur_bp_id.GetLocationID() == LLDB_INVALID_BREAK_ID) { // This breakpoint does not have an associated location. @@ -485,7 +476,7 @@ protected: script_interp->SetBreakpointCommandCallback (m_bp_options_vec, m_options.m_one_liner.c_str()); } - else if (m_options.m_function_name.size()) + else if (!m_options.m_function_name.empty()) { script_interp->SetBreakpointCommandCallbackFunction (m_bp_options_vec, m_options.m_function_name.c_str()); @@ -506,7 +497,6 @@ protected: CollectDataForBreakpointCommandCallback (m_bp_options_vec, result); } - } return result.Succeeded(); @@ -526,7 +516,6 @@ private: // so it isn't worthwhile to come up with a more complex mechanism // to address this particular weakness right now. static const char *g_reader_instructions; - }; const char * @@ -541,28 +530,28 @@ g_script_option_enumeration[4] = { eScriptLanguageNone, "command", "Commands are in the lldb command interpreter language"}, { eScriptLanguagePython, "python", "Commands are in the Python language."}, { eSortOrderByName, "default-script", "Commands are in the default scripting language."}, - { 0, NULL, NULL } + { 0, nullptr, nullptr } }; OptionDefinition CommandObjectBreakpointCommandAdd::CommandOptions::g_option_table[] = { - { LLDB_OPT_SET_1, false, "one-liner", 'o', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeOneLiner, + { LLDB_OPT_SET_1, false, "one-liner", 'o', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeOneLiner, "Specify a one-line breakpoint command inline. Be sure to surround it with quotes." }, - { LLDB_OPT_SET_ALL, false, "stop-on-error", 'e', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBoolean, + { LLDB_OPT_SET_ALL, false, "stop-on-error", 'e', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBoolean, "Specify whether breakpoint command execution should terminate on error." }, - { LLDB_OPT_SET_ALL, false, "script-type", 's', OptionParser::eRequiredArgument, NULL, g_script_option_enumeration, 0, eArgTypeNone, + { LLDB_OPT_SET_ALL, false, "script-type", 's', OptionParser::eRequiredArgument, nullptr, g_script_option_enumeration, 0, eArgTypeNone, "Specify the language for the commands - if none is specified, the lldb command interpreter will be used."}, - { LLDB_OPT_SET_2, false, "python-function", 'F', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypePythonFunction, + { LLDB_OPT_SET_2, false, "python-function", 'F', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypePythonFunction, "Give the name of a Python function to run as command for this breakpoint. Be sure to give a module name if appropriate."}, - { LLDB_OPT_SET_ALL, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, + { LLDB_OPT_SET_ALL, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Sets Dummy breakpoints - i.e. breakpoints set before a file is provided, which prime new targets."}, - { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL } + { 0, false, nullptr, 0, 0, nullptr, nullptr, 0, eArgTypeNone, nullptr } }; //------------------------------------------------------------------------- @@ -573,10 +562,10 @@ class CommandObjectBreakpointCommandDelete : public CommandObjectParsed { public: CommandObjectBreakpointCommandDelete (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "delete", - "Delete the set of commands from a breakpoint.", - NULL), + CommandObjectParsed(interpreter, + "delete", + "Delete the set of commands from a breakpoint.", + nullptr), m_options (interpreter) { CommandArgumentEntry arg; @@ -593,8 +582,7 @@ public: m_arguments.push_back (arg); } - - ~CommandObjectBreakpointCommandDelete () override {} + ~CommandObjectBreakpointCommandDelete() override = default; Options * GetOptions () override @@ -605,14 +593,13 @@ public: class CommandOptions : public Options { public: - CommandOptions (CommandInterpreter &interpreter) : Options (interpreter), m_use_dummy (false) { } - ~CommandOptions () override {} + ~CommandOptions() override = default; Error SetOptionValue (uint32_t option_idx, const char *option_arg) override @@ -660,7 +647,7 @@ protected: { Target *target = GetSelectedOrDummyTarget(m_options.m_use_dummy); - if (target == NULL) + if (target == nullptr) { result.AppendError ("There is not a current executable; there are no breakpoints from which to delete commands"); result.SetStatus (eReturnStatusFailed); @@ -719,6 +706,7 @@ protected: } return result.Succeeded(); } + private: CommandOptions m_options; }; @@ -726,13 +714,12 @@ private: OptionDefinition CommandObjectBreakpointCommandDelete::CommandOptions::g_option_table[] = { - { LLDB_OPT_SET_1, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, + { LLDB_OPT_SET_1, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Delete commands from Dummy breakpoints - i.e. breakpoints set before a file is provided, which prime new targets."}, - { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL } + { 0, false, nullptr, 0, 0, nullptr, nullptr, 0, eArgTypeNone, nullptr } }; - //------------------------------------------------------------------------- // CommandObjectBreakpointCommandList //------------------------------------------------------------------------- @@ -741,10 +728,10 @@ class CommandObjectBreakpointCommandList : public CommandObjectParsed { public: CommandObjectBreakpointCommandList (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "list", - "List the script or set of commands to be executed when the breakpoint is hit.", - NULL) + CommandObjectParsed(interpreter, + "list", + "List the script or set of commands to be executed when the breakpoint is hit.", + nullptr) { CommandArgumentEntry arg; CommandArgumentData bp_id_arg; @@ -760,7 +747,7 @@ public: m_arguments.push_back (arg); } - ~CommandObjectBreakpointCommandList () override {} + ~CommandObjectBreakpointCommandList() override = default; protected: bool @@ -769,7 +756,7 @@ protected: { Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get(); - if (target == NULL) + if (target == nullptr) { result.AppendError ("There is not a current executable; there are no breakpoints for which to list commands"); result.SetStatus (eReturnStatusFailed); @@ -808,7 +795,7 @@ protected: if (bp) { - const BreakpointOptions *bp_options = NULL; + const BreakpointOptions *bp_options = nullptr; if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID) { BreakpointLocationSP bp_loc_sp(bp->FindLocationByID (cur_bp_id.GetLocationID())); @@ -855,7 +842,6 @@ protected: result.AppendErrorWithFormat("Invalid breakpoint ID: %u.\n", cur_bp_id.GetBreakpointID()); result.SetStatus (eReturnStatusFailed); } - } } } @@ -868,11 +854,11 @@ protected: // CommandObjectBreakpointCommand //------------------------------------------------------------------------- -CommandObjectBreakpointCommand::CommandObjectBreakpointCommand (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "command", - "A set of commands for adding, removing and examining bits of code to be executed when the breakpoint is hit (breakpoint 'commands').", - "command <sub-command> [<sub-command-options>] <breakpoint-id>") +CommandObjectBreakpointCommand::CommandObjectBreakpointCommand(CommandInterpreter &interpreter) + : CommandObjectMultiword( + interpreter, "command", + "Commands for adding, removing and listing LLDB commands executed when a breakpoint is hit.", + "command <sub-command> [<sub-command-options>] <breakpoint-id>") { CommandObjectSP add_command_object (new CommandObjectBreakpointCommandAdd (interpreter)); CommandObjectSP delete_command_object (new CommandObjectBreakpointCommandDelete (interpreter)); @@ -887,8 +873,4 @@ CommandObjectBreakpointCommand::CommandObjectBreakpointCommand (CommandInterpret LoadSubCommand ("list", list_command_object); } -CommandObjectBreakpointCommand::~CommandObjectBreakpointCommand () -{ -} - - +CommandObjectBreakpointCommand::~CommandObjectBreakpointCommand() = default; |