2010-06-09 00:52:24 +08:00
|
|
|
//===-- SBCommandInterpreter.cpp --------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "lldb/lldb-types.h"
|
2015-07-31 04:28:07 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Core/Listener.h"
|
|
|
|
#include "lldb/Interpreter/CommandInterpreter.h"
|
2012-09-29 07:57:51 +08:00
|
|
|
#include "lldb/Interpreter/CommandObjectMultiword.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Interpreter/CommandReturnObject.h"
|
|
|
|
#include "lldb/Target/Target.h"
|
|
|
|
|
2010-06-09 15:37:52 +08:00
|
|
|
#include "lldb/API/SBBroadcaster.h"
|
|
|
|
#include "lldb/API/SBCommandReturnObject.h"
|
|
|
|
#include "lldb/API/SBCommandInterpreter.h"
|
Fix handling of CommandInterpreter's events in lldb-mi
Summary:
Previously lldb-mi contains a stub for that but it didn't work and all CommanInterpreter's events were ignored.
This commit adds a handling of CommandInterpreter's events in lldb-mi.
Steps:
# Fix CMICmnLLDBDebugger::InitSBListener
# Add SBCommandInterpreter::EventIsCommandInterpreterEvent
# Exit on lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived
All tests pass on OS X.
In further we can remove "quit" hack in lldb-mi.
Test Plan:
# Create start_script file:
```
target create ~/p/hello
b main
r
quit
```
# Run lldb-mi --interpreter
# Execute start_script file by following command:
```
-interpreter-exec console "command source start_script"
```
Log:
```
$ bin/lldb-mi --interpreter
(gdb)
-interpreter-exec console "command source start_script"
Executing commands in '/Users/IliaK/p/llvm/build_ninja/start_script'.
(lldb) target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
(lldb) b main
Breakpoint 1: where = hello`main + 29 at hello.cpp:12, address = 0x0000000100000e2d
(lldb) r
Process 1582 launched: '/Users/IliaK/p/hello' (x86_64)
(lldb) quit
^done
(gdb)
=thread-created,id="1",group-id="i1"
=thread-selected,id="1"
(gdb)
=shlibs-added,shlib-info=[num="1",name="hello",dyld-addr="-",reason="dyld",path="/Users/IliaK/p/hello",loaded_addr="-",dsym-objpath="/Users/IliaK/p/hello.dSYM/Contents/Resources/DWARF/hello"]
...
=shlibs-added,shlib-info=[num="132",name="libDiagnosticMessagesClient.dylib",dyld-addr="0x7fff91705000",reason="dyld",path="/usr/lib/libDiagnosticMessagesClient.dylib",loaded_addr="0x7fff91705000"]
(gdb)
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x100000e2d",func="main",args=[{name="argc",value="1"},{name="argv",value="0x00007fff5fbffc88"}],file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="12"},thread-id="1",stopped-threads="all"
(gdb)<press Enter>
MI: Program exited OK
```
Reviewers: abidh, clayborg
Reviewed By: abidh
Subscribers: jingham, lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D8382
llvm-svn: 232891
2015-03-21 18:53:37 +08:00
|
|
|
#include "lldb/API/SBEvent.h"
|
2014-10-14 09:20:07 +08:00
|
|
|
#include "lldb/API/SBExecutionContext.h"
|
2010-06-09 15:37:52 +08:00
|
|
|
#include "lldb/API/SBProcess.h"
|
|
|
|
#include "lldb/API/SBTarget.h"
|
|
|
|
#include "lldb/API/SBListener.h"
|
2010-10-26 11:11:13 +08:00
|
|
|
#include "lldb/API/SBStream.h"
|
2010-06-09 15:37:52 +08:00
|
|
|
#include "lldb/API/SBStringList.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2014-10-11 08:38:27 +08:00
|
|
|
SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions()
|
|
|
|
{
|
|
|
|
m_opaque_up.reset(new CommandInterpreterRunOptions());
|
|
|
|
}
|
|
|
|
|
|
|
|
SBCommandInterpreterRunOptions::~SBCommandInterpreterRunOptions()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommandInterpreterRunOptions::GetStopOnContinue () const
|
|
|
|
{
|
|
|
|
return m_opaque_up->GetStopOnContinue();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreterRunOptions::SetStopOnContinue (bool stop_on_continue)
|
|
|
|
{
|
|
|
|
m_opaque_up->SetStopOnContinue(stop_on_continue);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommandInterpreterRunOptions::GetStopOnError () const
|
|
|
|
{
|
|
|
|
return m_opaque_up->GetStopOnError();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreterRunOptions::SetStopOnError (bool stop_on_error)
|
|
|
|
{
|
|
|
|
m_opaque_up->SetStopOnError(stop_on_error);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommandInterpreterRunOptions::GetStopOnCrash () const
|
|
|
|
{
|
|
|
|
return m_opaque_up->GetStopOnCrash();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreterRunOptions::SetStopOnCrash (bool stop_on_crash)
|
|
|
|
{
|
|
|
|
m_opaque_up->SetStopOnCrash(stop_on_crash);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommandInterpreterRunOptions::GetEchoCommands () const
|
|
|
|
{
|
|
|
|
return m_opaque_up->GetEchoCommands();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreterRunOptions::SetEchoCommands (bool echo_commands)
|
|
|
|
{
|
|
|
|
m_opaque_up->SetEchoCommands(echo_commands);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommandInterpreterRunOptions::GetPrintResults () const
|
|
|
|
{
|
|
|
|
return m_opaque_up->GetPrintResults();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreterRunOptions::SetPrintResults (bool print_results)
|
|
|
|
{
|
|
|
|
m_opaque_up->SetPrintResults(print_results);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommandInterpreterRunOptions::GetAddToHistory () const
|
|
|
|
{
|
|
|
|
return m_opaque_up->GetAddToHistory();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreterRunOptions::SetAddToHistory (bool add_to_history)
|
|
|
|
{
|
|
|
|
m_opaque_up->SetAddToHistory(add_to_history);
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb_private::CommandInterpreterRunOptions *
|
|
|
|
SBCommandInterpreterRunOptions::get () const
|
|
|
|
{
|
|
|
|
return m_opaque_up.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb_private::CommandInterpreterRunOptions &
|
|
|
|
SBCommandInterpreterRunOptions::ref () const
|
|
|
|
{
|
|
|
|
return *m_opaque_up.get();
|
|
|
|
}
|
|
|
|
|
2012-09-29 07:57:51 +08:00
|
|
|
class CommandPluginInterfaceImplementation : public CommandObjectParsed
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CommandPluginInterfaceImplementation (CommandInterpreter &interpreter,
|
|
|
|
const char *name,
|
|
|
|
lldb::SBCommandPluginInterface* backend,
|
|
|
|
const char *help = NULL,
|
|
|
|
const char *syntax = NULL,
|
|
|
|
uint32_t flags = 0) :
|
|
|
|
CommandObjectParsed (interpreter, name, help, syntax, flags),
|
|
|
|
m_backend(backend) {}
|
|
|
|
|
|
|
|
virtual bool
|
2012-10-09 06:41:53 +08:00
|
|
|
IsRemovable() const { return true; }
|
2012-09-29 07:57:51 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool
|
|
|
|
DoExecute (Args& command, CommandReturnObject &result)
|
|
|
|
{
|
|
|
|
SBCommandReturnObject sb_return(&result);
|
|
|
|
SBCommandInterpreter sb_interpreter(&m_interpreter);
|
|
|
|
SBDebugger debugger_sb(m_interpreter.GetDebugger().shared_from_this());
|
|
|
|
bool ret = m_backend->DoExecute (debugger_sb,(char**)command.GetArgumentVector(), sb_return);
|
|
|
|
sb_return.Release();
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
lldb::SBCommandPluginInterface* m_backend;
|
|
|
|
};
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2010-06-23 09:19:29 +08:00
|
|
|
SBCommandInterpreter::SBCommandInterpreter (CommandInterpreter *interpreter) :
|
|
|
|
m_opaque_ptr (interpreter)
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
2010-10-26 11:11:13 +08:00
|
|
|
|
|
|
|
if (log)
|
2010-10-30 12:51:46 +08:00
|
|
|
log->Printf ("SBCommandInterpreter::SBCommandInterpreter (interpreter=%p)"
|
2014-04-04 12:06:10 +08:00
|
|
|
" => SBCommandInterpreter(%p)",
|
|
|
|
static_cast<void*>(interpreter),
|
|
|
|
static_cast<void*>(m_opaque_ptr));
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2010-11-06 07:17:00 +08:00
|
|
|
SBCommandInterpreter::SBCommandInterpreter(const SBCommandInterpreter &rhs) :
|
|
|
|
m_opaque_ptr (rhs.m_opaque_ptr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
const SBCommandInterpreter &
|
|
|
|
SBCommandInterpreter::operator = (const SBCommandInterpreter &rhs)
|
|
|
|
{
|
|
|
|
m_opaque_ptr = rhs.m_opaque_ptr;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
SBCommandInterpreter::~SBCommandInterpreter ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-06-23 09:19:29 +08:00
|
|
|
bool
|
|
|
|
SBCommandInterpreter::IsValid() const
|
|
|
|
{
|
|
|
|
return m_opaque_ptr != NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
bool
|
|
|
|
SBCommandInterpreter::CommandExists (const char *cmd)
|
|
|
|
{
|
2011-12-20 05:16:29 +08:00
|
|
|
if (cmd && m_opaque_ptr)
|
2010-06-23 09:19:29 +08:00
|
|
|
return m_opaque_ptr->CommandExists (cmd);
|
|
|
|
return false;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommandInterpreter::AliasExists (const char *cmd)
|
|
|
|
{
|
2011-12-20 05:16:29 +08:00
|
|
|
if (cmd && m_opaque_ptr)
|
2010-06-23 09:19:29 +08:00
|
|
|
return m_opaque_ptr->AliasExists (cmd);
|
|
|
|
return false;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2014-01-28 07:43:24 +08:00
|
|
|
bool
|
|
|
|
SBCommandInterpreter::IsActive ()
|
|
|
|
{
|
|
|
|
if (m_opaque_ptr)
|
|
|
|
return m_opaque_ptr->IsActive ();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
SBCommandInterpreter::GetIOHandlerControlSequence(char ch)
|
|
|
|
{
|
|
|
|
if (m_opaque_ptr)
|
|
|
|
return m_opaque_ptr->GetDebugger().GetTopIOHandlerControlSequence (ch).GetCString();
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
lldb::ReturnStatus
|
|
|
|
SBCommandInterpreter::HandleCommand (const char *command_line, SBCommandReturnObject &result, bool add_to_history)
|
2014-10-14 09:20:07 +08:00
|
|
|
{
|
|
|
|
SBExecutionContext sb_exe_ctx;
|
|
|
|
return HandleCommand (command_line, sb_exe_ctx, result, add_to_history);
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb::ReturnStatus
|
|
|
|
SBCommandInterpreter::HandleCommand (const char *command_line, SBExecutionContext &override_context, SBCommandReturnObject &result, bool add_to_history)
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
2010-10-26 11:11:13 +08:00
|
|
|
|
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", SBCommandReturnObject(%p), add_to_history=%i)",
|
|
|
|
static_cast<void*>(m_opaque_ptr), command_line,
|
|
|
|
static_cast<void*>(result.get()), add_to_history);
|
2010-10-26 11:11:13 +08:00
|
|
|
|
2014-10-14 09:20:07 +08:00
|
|
|
ExecutionContext ctx, *ctx_ptr;
|
|
|
|
if (override_context.get())
|
|
|
|
{
|
|
|
|
ctx = override_context.get()->Lock(true);
|
|
|
|
ctx_ptr = &ctx;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ctx_ptr = nullptr;
|
|
|
|
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
result.Clear();
|
2011-12-20 05:16:29 +08:00
|
|
|
if (command_line && m_opaque_ptr)
|
2010-06-23 09:19:29 +08:00
|
|
|
{
|
2014-07-15 08:25:59 +08:00
|
|
|
result.ref().SetInteractive(false);
|
2014-10-14 09:20:07 +08:00
|
|
|
m_opaque_ptr->HandleCommand (command_line, add_to_history ? eLazyBoolYes : eLazyBoolNo, result.ref(), ctx_ptr);
|
2010-06-23 09:19:29 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-20 05:16:29 +08:00
|
|
|
result->AppendError ("SBCommandInterpreter or the command line is not valid");
|
2010-06-23 09:19:29 +08:00
|
|
|
result->SetStatus (eReturnStatusFailed);
|
|
|
|
}
|
2010-10-26 11:11:13 +08:00
|
|
|
|
2010-10-28 05:23:37 +08:00
|
|
|
// We need to get the value again, in case the command disabled the log!
|
|
|
|
log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
|
2010-10-26 11:11:13 +08:00
|
|
|
if (log)
|
|
|
|
{
|
|
|
|
SBStream sstr;
|
|
|
|
result.GetDescription (sstr);
|
2010-10-31 11:01:06 +08:00
|
|
|
log->Printf ("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", SBCommandReturnObject(%p): %s, add_to_history=%i) => %i",
|
2014-04-04 12:06:10 +08:00
|
|
|
static_cast<void*>(m_opaque_ptr), command_line,
|
|
|
|
static_cast<void*>(result.get()), sstr.GetData(),
|
|
|
|
add_to_history, result.GetStatus());
|
2010-10-26 11:11:13 +08:00
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
return result.GetStatus();
|
|
|
|
}
|
|
|
|
|
2014-10-14 09:20:07 +08:00
|
|
|
void
|
|
|
|
SBCommandInterpreter::HandleCommandsFromFile (lldb::SBFileSpec &file,
|
|
|
|
lldb::SBExecutionContext &override_context,
|
|
|
|
lldb::SBCommandInterpreterRunOptions &options,
|
|
|
|
lldb::SBCommandReturnObject result)
|
|
|
|
{
|
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
|
|
|
|
|
|
|
if (log)
|
|
|
|
{
|
|
|
|
SBStream s;
|
|
|
|
file.GetDescription (s);
|
|
|
|
log->Printf ("SBCommandInterpreter(%p)::HandleCommandsFromFile (file=\"%s\", SBCommandReturnObject(%p))",
|
|
|
|
static_cast<void*>(m_opaque_ptr), s.GetData(),
|
|
|
|
static_cast<void*>(result.get()));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!m_opaque_ptr)
|
|
|
|
{
|
|
|
|
result->AppendError ("SBCommandInterpreter is not valid.");
|
|
|
|
result->SetStatus (eReturnStatusFailed);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!file.IsValid())
|
|
|
|
{
|
|
|
|
SBStream s;
|
|
|
|
file.GetDescription (s);
|
|
|
|
result->AppendErrorWithFormat ("File is not valid: %s.", s.GetData());
|
|
|
|
result->SetStatus (eReturnStatusFailed);
|
|
|
|
}
|
|
|
|
|
|
|
|
FileSpec tmp_spec = file.ref();
|
|
|
|
ExecutionContext ctx, *ctx_ptr;
|
|
|
|
if (override_context.get())
|
|
|
|
{
|
|
|
|
ctx = override_context.get()->Lock(true);
|
|
|
|
ctx_ptr = &ctx;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ctx_ptr = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
m_opaque_ptr->HandleCommandsFromFile (tmp_spec, ctx_ptr, options.ref(), result.ref());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
int
|
|
|
|
SBCommandInterpreter::HandleCompletion (const char *current_line,
|
|
|
|
const char *cursor,
|
|
|
|
const char *last_char,
|
|
|
|
int match_start_point,
|
|
|
|
int max_return_elements,
|
|
|
|
SBStringList &matches)
|
|
|
|
{
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
2010-06-23 09:19:29 +08:00
|
|
|
int num_completions = 0;
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2011-12-06 03:24:15 +08:00
|
|
|
// Sanity check the arguments that are passed in:
|
|
|
|
// cursor & last_char have to be within the current_line.
|
|
|
|
if (current_line == NULL || cursor == NULL || last_char == NULL)
|
|
|
|
return 0;
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2011-12-06 03:24:15 +08:00
|
|
|
if (cursor < current_line || last_char < current_line)
|
|
|
|
return 0;
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2011-12-06 03:24:15 +08:00
|
|
|
size_t current_line_size = strlen (current_line);
|
2014-04-02 11:51:35 +08:00
|
|
|
if (cursor - current_line > static_cast<ptrdiff_t>(current_line_size) ||
|
|
|
|
last_char - current_line > static_cast<ptrdiff_t>(current_line_size))
|
2011-12-06 03:24:15 +08:00
|
|
|
return 0;
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2012-06-26 09:21:59 +08:00
|
|
|
if (log)
|
2012-11-30 05:49:15 +08:00
|
|
|
log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %" PRId64 ", last char at: %" PRId64 ", match_start_point: %d, max_return_elements: %d)",
|
2014-04-04 12:06:10 +08:00
|
|
|
static_cast<void*>(m_opaque_ptr), current_line,
|
|
|
|
static_cast<uint64_t>(cursor - current_line),
|
|
|
|
static_cast<uint64_t>(last_char - current_line),
|
|
|
|
match_start_point, max_return_elements);
|
|
|
|
|
2010-06-23 09:19:29 +08:00
|
|
|
if (m_opaque_ptr)
|
|
|
|
{
|
|
|
|
lldb_private::StringList lldb_matches;
|
|
|
|
num_completions = m_opaque_ptr->HandleCompletion (current_line, cursor, last_char, match_start_point,
|
|
|
|
max_return_elements, lldb_matches);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2010-06-23 09:19:29 +08:00
|
|
|
SBStringList temp_list (&lldb_matches);
|
|
|
|
matches.AppendList (temp_list);
|
|
|
|
}
|
2012-06-26 09:21:59 +08:00
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("SBCommandInterpreter(%p)::HandleCompletion - Found %d completions.",
|
|
|
|
static_cast<void*>(m_opaque_ptr), num_completions);
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
return num_completions;
|
|
|
|
}
|
|
|
|
|
2011-09-21 09:17:13 +08:00
|
|
|
int
|
|
|
|
SBCommandInterpreter::HandleCompletion (const char *current_line,
|
|
|
|
uint32_t cursor_pos,
|
|
|
|
int match_start_point,
|
|
|
|
int max_return_elements,
|
|
|
|
lldb::SBStringList &matches)
|
|
|
|
{
|
|
|
|
const char *cursor = current_line + cursor_pos;
|
|
|
|
const char *last_char = current_line + strlen (current_line);
|
|
|
|
return HandleCompletion (current_line, cursor, last_char, match_start_point, max_return_elements, matches);
|
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
bool
|
|
|
|
SBCommandInterpreter::HasCommands ()
|
|
|
|
{
|
2010-06-23 09:19:29 +08:00
|
|
|
if (m_opaque_ptr)
|
|
|
|
return m_opaque_ptr->HasCommands();
|
|
|
|
return false;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommandInterpreter::HasAliases ()
|
|
|
|
{
|
2010-06-23 09:19:29 +08:00
|
|
|
if (m_opaque_ptr)
|
|
|
|
return m_opaque_ptr->HasAliases();
|
|
|
|
return false;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommandInterpreter::HasAliasOptions ()
|
|
|
|
{
|
2010-06-23 09:19:29 +08:00
|
|
|
if (m_opaque_ptr)
|
|
|
|
return m_opaque_ptr->HasAliasOptions ();
|
|
|
|
return false;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
SBProcess
|
|
|
|
SBCommandInterpreter::GetProcess ()
|
|
|
|
{
|
2012-01-30 15:41:31 +08:00
|
|
|
SBProcess sb_process;
|
|
|
|
ProcessSP process_sp;
|
2010-06-23 09:19:29 +08:00
|
|
|
if (m_opaque_ptr)
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
2010-12-21 04:49:23 +08:00
|
|
|
TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
|
|
|
|
if (target_sp)
|
|
|
|
{
|
|
|
|
Mutex::Locker api_locker(target_sp->GetAPIMutex());
|
2012-01-30 15:41:31 +08:00
|
|
|
process_sp = target_sp->GetProcessSP();
|
|
|
|
sb_process.SetSP(process_sp);
|
2010-12-21 04:49:23 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
2010-10-30 12:51:46 +08:00
|
|
|
|
|
|
|
if (log)
|
|
|
|
log->Printf ("SBCommandInterpreter(%p)::GetProcess () => SBProcess(%p)",
|
2014-04-04 12:06:10 +08:00
|
|
|
static_cast<void*>(m_opaque_ptr),
|
|
|
|
static_cast<void*>(process_sp.get()));
|
2010-10-30 12:51:46 +08:00
|
|
|
|
2012-01-30 15:41:31 +08:00
|
|
|
return sb_process;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2012-09-29 07:57:51 +08:00
|
|
|
SBDebugger
|
|
|
|
SBCommandInterpreter::GetDebugger ()
|
|
|
|
{
|
|
|
|
SBDebugger sb_debugger;
|
|
|
|
if (m_opaque_ptr)
|
|
|
|
sb_debugger.reset(m_opaque_ptr->GetDebugger().shared_from_this());
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2012-09-29 07:57:51 +08:00
|
|
|
if (log)
|
|
|
|
log->Printf ("SBCommandInterpreter(%p)::GetDebugger () => SBDebugger(%p)",
|
2014-04-04 12:06:10 +08:00
|
|
|
static_cast<void*>(m_opaque_ptr),
|
|
|
|
static_cast<void*>(sb_debugger.get()));
|
|
|
|
|
2012-09-29 07:57:51 +08:00
|
|
|
return sb_debugger;
|
|
|
|
}
|
|
|
|
|
2015-03-24 06:45:13 +08:00
|
|
|
bool
|
|
|
|
SBCommandInterpreter::GetPromptOnQuit()
|
|
|
|
{
|
|
|
|
if (m_opaque_ptr)
|
|
|
|
return m_opaque_ptr->GetPromptOnQuit();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreter::SetPromptOnQuit (bool b)
|
|
|
|
{
|
|
|
|
if (m_opaque_ptr)
|
|
|
|
m_opaque_ptr->SetPromptOnQuit(b);
|
|
|
|
}
|
|
|
|
|
2015-04-24 04:00:25 +08:00
|
|
|
void
|
|
|
|
SBCommandInterpreter::ResolveCommand(const char *command_line, SBCommandReturnObject &result)
|
|
|
|
{
|
|
|
|
result.Clear();
|
|
|
|
if (command_line && m_opaque_ptr)
|
|
|
|
{
|
|
|
|
m_opaque_ptr->ResolveCommand(command_line, result.ref());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result->AppendError("SBCommandInterpreter or the command line is not valid");
|
|
|
|
result->SetStatus(eReturnStatusFailed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
CommandInterpreter *
|
2010-06-23 09:19:29 +08:00
|
|
|
SBCommandInterpreter::get ()
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
2010-06-23 09:19:29 +08:00
|
|
|
return m_opaque_ptr;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
CommandInterpreter &
|
2010-06-23 09:19:29 +08:00
|
|
|
SBCommandInterpreter::ref ()
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
2010-06-23 09:19:29 +08:00
|
|
|
assert (m_opaque_ptr);
|
|
|
|
return *m_opaque_ptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreter::reset (lldb_private::CommandInterpreter *interpreter)
|
|
|
|
{
|
|
|
|
m_opaque_ptr = interpreter;
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreter::SourceInitFileInHomeDirectory (SBCommandReturnObject &result)
|
|
|
|
{
|
|
|
|
result.Clear();
|
2010-06-23 09:19:29 +08:00
|
|
|
if (m_opaque_ptr)
|
|
|
|
{
|
2010-12-21 04:49:23 +08:00
|
|
|
TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
|
|
|
|
Mutex::Locker api_locker;
|
|
|
|
if (target_sp)
|
2012-05-05 07:02:50 +08:00
|
|
|
api_locker.Lock(target_sp->GetAPIMutex());
|
2010-06-23 09:19:29 +08:00
|
|
|
m_opaque_ptr->SourceInitFile (false, result.ref());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result->AppendError ("SBCommandInterpreter is not valid");
|
|
|
|
result->SetStatus (eReturnStatusFailed);
|
|
|
|
}
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
2010-10-30 12:51:46 +08:00
|
|
|
|
|
|
|
if (log)
|
|
|
|
log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInHomeDirectory (&SBCommandReturnObject(%p))",
|
2014-04-04 12:06:10 +08:00
|
|
|
static_cast<void*>(m_opaque_ptr),
|
|
|
|
static_cast<void*>(result.get()));
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory (SBCommandReturnObject &result)
|
|
|
|
{
|
|
|
|
result.Clear();
|
2010-06-23 09:19:29 +08:00
|
|
|
if (m_opaque_ptr)
|
|
|
|
{
|
2010-12-21 04:49:23 +08:00
|
|
|
TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
|
|
|
|
Mutex::Locker api_locker;
|
|
|
|
if (target_sp)
|
2012-05-05 07:02:50 +08:00
|
|
|
api_locker.Lock(target_sp->GetAPIMutex());
|
2010-06-23 09:19:29 +08:00
|
|
|
m_opaque_ptr->SourceInitFile (true, result.ref());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result->AppendError ("SBCommandInterpreter is not valid");
|
|
|
|
result->SetStatus (eReturnStatusFailed);
|
|
|
|
}
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
2010-10-30 12:51:46 +08:00
|
|
|
|
|
|
|
if (log)
|
|
|
|
log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInCurrentWorkingDirectory (&SBCommandReturnObject(%p))",
|
2014-04-04 12:06:10 +08:00
|
|
|
static_cast<void*>(m_opaque_ptr),
|
|
|
|
static_cast<void*>(result.get()));
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
SBBroadcaster
|
|
|
|
SBCommandInterpreter::GetBroadcaster ()
|
|
|
|
{
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
2010-10-26 11:11:13 +08:00
|
|
|
|
2010-06-23 09:19:29 +08:00
|
|
|
SBBroadcaster broadcaster (m_opaque_ptr, false);
|
2010-10-26 11:11:13 +08:00
|
|
|
|
|
|
|
if (log)
|
2010-10-30 12:51:46 +08:00
|
|
|
log->Printf ("SBCommandInterpreter(%p)::GetBroadcaster() => SBBroadcaster(%p)",
|
2014-04-04 12:06:10 +08:00
|
|
|
static_cast<void*>(m_opaque_ptr), static_cast<void*>(broadcaster.get()));
|
2010-10-26 11:11:13 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
return broadcaster;
|
|
|
|
}
|
|
|
|
|
2012-02-16 14:50:00 +08:00
|
|
|
const char *
|
|
|
|
SBCommandInterpreter::GetBroadcasterClass ()
|
|
|
|
{
|
2015-03-18 00:54:52 +08:00
|
|
|
return CommandInterpreter::GetStaticBroadcasterClass().AsCString();
|
2012-02-16 14:50:00 +08:00
|
|
|
}
|
|
|
|
|
2011-02-20 10:15:07 +08:00
|
|
|
const char *
|
|
|
|
SBCommandInterpreter::GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type)
|
|
|
|
{
|
|
|
|
return CommandObject::GetArgumentTypeAsCString (arg_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
SBCommandInterpreter::GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type)
|
|
|
|
{
|
|
|
|
return CommandObject::GetArgumentDescriptionAsCString (arg_type);
|
|
|
|
}
|
|
|
|
|
Fix handling of CommandInterpreter's events in lldb-mi
Summary:
Previously lldb-mi contains a stub for that but it didn't work and all CommanInterpreter's events were ignored.
This commit adds a handling of CommandInterpreter's events in lldb-mi.
Steps:
# Fix CMICmnLLDBDebugger::InitSBListener
# Add SBCommandInterpreter::EventIsCommandInterpreterEvent
# Exit on lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived
All tests pass on OS X.
In further we can remove "quit" hack in lldb-mi.
Test Plan:
# Create start_script file:
```
target create ~/p/hello
b main
r
quit
```
# Run lldb-mi --interpreter
# Execute start_script file by following command:
```
-interpreter-exec console "command source start_script"
```
Log:
```
$ bin/lldb-mi --interpreter
(gdb)
-interpreter-exec console "command source start_script"
Executing commands in '/Users/IliaK/p/llvm/build_ninja/start_script'.
(lldb) target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
(lldb) b main
Breakpoint 1: where = hello`main + 29 at hello.cpp:12, address = 0x0000000100000e2d
(lldb) r
Process 1582 launched: '/Users/IliaK/p/hello' (x86_64)
(lldb) quit
^done
(gdb)
=thread-created,id="1",group-id="i1"
=thread-selected,id="1"
(gdb)
=shlibs-added,shlib-info=[num="1",name="hello",dyld-addr="-",reason="dyld",path="/Users/IliaK/p/hello",loaded_addr="-",dsym-objpath="/Users/IliaK/p/hello.dSYM/Contents/Resources/DWARF/hello"]
...
=shlibs-added,shlib-info=[num="132",name="libDiagnosticMessagesClient.dylib",dyld-addr="0x7fff91705000",reason="dyld",path="/usr/lib/libDiagnosticMessagesClient.dylib",loaded_addr="0x7fff91705000"]
(gdb)
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x100000e2d",func="main",args=[{name="argc",value="1"},{name="argv",value="0x00007fff5fbffc88"}],file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="12"},thread-id="1",stopped-threads="all"
(gdb)<press Enter>
MI: Program exited OK
```
Reviewers: abidh, clayborg
Reviewed By: abidh
Subscribers: jingham, lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D8382
llvm-svn: 232891
2015-03-21 18:53:37 +08:00
|
|
|
bool
|
|
|
|
SBCommandInterpreter::EventIsCommandInterpreterEvent (const lldb::SBEvent &event)
|
|
|
|
{
|
2015-03-21 19:11:07 +08:00
|
|
|
return event.GetBroadcasterClass() == SBCommandInterpreter::GetBroadcasterClass();
|
Fix handling of CommandInterpreter's events in lldb-mi
Summary:
Previously lldb-mi contains a stub for that but it didn't work and all CommanInterpreter's events were ignored.
This commit adds a handling of CommandInterpreter's events in lldb-mi.
Steps:
# Fix CMICmnLLDBDebugger::InitSBListener
# Add SBCommandInterpreter::EventIsCommandInterpreterEvent
# Exit on lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived
All tests pass on OS X.
In further we can remove "quit" hack in lldb-mi.
Test Plan:
# Create start_script file:
```
target create ~/p/hello
b main
r
quit
```
# Run lldb-mi --interpreter
# Execute start_script file by following command:
```
-interpreter-exec console "command source start_script"
```
Log:
```
$ bin/lldb-mi --interpreter
(gdb)
-interpreter-exec console "command source start_script"
Executing commands in '/Users/IliaK/p/llvm/build_ninja/start_script'.
(lldb) target create ~/p/hello
Current executable set to '~/p/hello' (x86_64).
(lldb) b main
Breakpoint 1: where = hello`main + 29 at hello.cpp:12, address = 0x0000000100000e2d
(lldb) r
Process 1582 launched: '/Users/IliaK/p/hello' (x86_64)
(lldb) quit
^done
(gdb)
=thread-created,id="1",group-id="i1"
=thread-selected,id="1"
(gdb)
=shlibs-added,shlib-info=[num="1",name="hello",dyld-addr="-",reason="dyld",path="/Users/IliaK/p/hello",loaded_addr="-",dsym-objpath="/Users/IliaK/p/hello.dSYM/Contents/Resources/DWARF/hello"]
...
=shlibs-added,shlib-info=[num="132",name="libDiagnosticMessagesClient.dylib",dyld-addr="0x7fff91705000",reason="dyld",path="/usr/lib/libDiagnosticMessagesClient.dylib",loaded_addr="0x7fff91705000"]
(gdb)
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x100000e2d",func="main",args=[{name="argc",value="1"},{name="argv",value="0x00007fff5fbffc88"}],file="hello.cpp",fullname="/Users/IliaK/p/hello.cpp",line="12"},thread-id="1",stopped-threads="all"
(gdb)<press Enter>
MI: Program exited OK
```
Reviewers: abidh, clayborg
Reviewed By: abidh
Subscribers: jingham, lldb-commits, clayborg, abidh
Differential Revision: http://reviews.llvm.org/D8382
llvm-svn: 232891
2015-03-21 18:53:37 +08:00
|
|
|
}
|
|
|
|
|
2012-02-29 12:21:24 +08:00
|
|
|
bool
|
|
|
|
SBCommandInterpreter::SetCommandOverrideCallback (const char *command_name,
|
|
|
|
lldb::CommandOverrideCallback callback,
|
|
|
|
void *baton)
|
|
|
|
{
|
|
|
|
if (command_name && command_name[0] && m_opaque_ptr)
|
|
|
|
{
|
2012-05-08 12:29:20 +08:00
|
|
|
std::string command_name_str (command_name);
|
|
|
|
CommandObject *cmd_obj = m_opaque_ptr->GetCommandObjectForCommand(command_name_str);
|
2012-02-29 12:21:24 +08:00
|
|
|
if (cmd_obj)
|
|
|
|
{
|
2012-05-08 12:29:20 +08:00
|
|
|
assert(command_name_str.empty());
|
2012-02-29 12:21:24 +08:00
|
|
|
cmd_obj->SetOverrideCallback (callback, baton);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2011-02-20 10:15:07 +08:00
|
|
|
|
2012-09-29 07:57:51 +08:00
|
|
|
lldb::SBCommand
|
|
|
|
SBCommandInterpreter::AddMultiwordCommand (const char* name, const char* help)
|
|
|
|
{
|
|
|
|
CommandObjectMultiword *new_command = new CommandObjectMultiword(*m_opaque_ptr,name,help);
|
|
|
|
new_command->SetRemovable (true);
|
|
|
|
lldb::CommandObjectSP new_command_sp(new_command);
|
|
|
|
if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
|
|
|
|
return lldb::SBCommand(new_command_sp);
|
|
|
|
return lldb::SBCommand();
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb::SBCommand
|
|
|
|
SBCommandInterpreter::AddCommand (const char* name, lldb::SBCommandPluginInterface* impl, const char* help)
|
|
|
|
{
|
|
|
|
lldb::CommandObjectSP new_command_sp;
|
|
|
|
new_command_sp.reset(new CommandPluginInterfaceImplementation(*m_opaque_ptr,name,impl,help));
|
|
|
|
|
|
|
|
if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
|
|
|
|
return lldb::SBCommand(new_command_sp);
|
|
|
|
return lldb::SBCommand();
|
|
|
|
}
|
|
|
|
|
|
|
|
SBCommand::SBCommand ()
|
|
|
|
{}
|
|
|
|
|
|
|
|
SBCommand::SBCommand (lldb::CommandObjectSP cmd_sp) : m_opaque_sp (cmd_sp)
|
|
|
|
{}
|
|
|
|
|
|
|
|
bool
|
|
|
|
SBCommand::IsValid ()
|
|
|
|
{
|
|
|
|
return (bool)m_opaque_sp;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char*
|
|
|
|
SBCommand::GetName ()
|
|
|
|
{
|
|
|
|
if (IsValid ())
|
|
|
|
return m_opaque_sp->GetCommandName ();
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char*
|
|
|
|
SBCommand::GetHelp ()
|
|
|
|
{
|
|
|
|
if (IsValid ())
|
|
|
|
return m_opaque_sp->GetHelp ();
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-03-14 06:32:11 +08:00
|
|
|
const char*
|
|
|
|
SBCommand::GetHelpLong ()
|
|
|
|
{
|
|
|
|
if (IsValid ())
|
|
|
|
return m_opaque_sp->GetHelpLong ();
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommand::SetHelp (const char* help)
|
|
|
|
{
|
|
|
|
if (IsValid())
|
|
|
|
m_opaque_sp->SetHelp(help);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommand::SetHelpLong (const char* help)
|
|
|
|
{
|
|
|
|
if (IsValid())
|
|
|
|
m_opaque_sp->SetHelpLong(help);
|
|
|
|
}
|
|
|
|
|
2012-09-29 07:57:51 +08:00
|
|
|
lldb::SBCommand
|
|
|
|
SBCommand::AddMultiwordCommand (const char* name, const char* help)
|
|
|
|
{
|
|
|
|
if (!IsValid ())
|
|
|
|
return lldb::SBCommand();
|
|
|
|
if (m_opaque_sp->IsMultiwordObject() == false)
|
|
|
|
return lldb::SBCommand();
|
|
|
|
CommandObjectMultiword *new_command = new CommandObjectMultiword(m_opaque_sp->GetCommandInterpreter(),name,help);
|
|
|
|
new_command->SetRemovable (true);
|
|
|
|
lldb::CommandObjectSP new_command_sp(new_command);
|
|
|
|
if (new_command_sp && m_opaque_sp->LoadSubCommand(name,new_command_sp))
|
|
|
|
return lldb::SBCommand(new_command_sp);
|
|
|
|
return lldb::SBCommand();
|
|
|
|
}
|
|
|
|
|
|
|
|
lldb::SBCommand
|
|
|
|
SBCommand::AddCommand (const char* name, lldb::SBCommandPluginInterface *impl, const char* help)
|
|
|
|
{
|
|
|
|
if (!IsValid ())
|
|
|
|
return lldb::SBCommand();
|
|
|
|
if (m_opaque_sp->IsMultiwordObject() == false)
|
|
|
|
return lldb::SBCommand();
|
|
|
|
lldb::CommandObjectSP new_command_sp;
|
|
|
|
new_command_sp.reset(new CommandPluginInterfaceImplementation(m_opaque_sp->GetCommandInterpreter(),name,impl,help));
|
|
|
|
if (new_command_sp && m_opaque_sp->LoadSubCommand(name,new_command_sp))
|
|
|
|
return lldb::SBCommand(new_command_sp);
|
|
|
|
return lldb::SBCommand();
|
|
|
|
}
|
2015-05-27 13:04:35 +08:00
|
|
|
|
|
|
|
uint32_t
|
|
|
|
SBCommand::GetFlags ()
|
|
|
|
{
|
|
|
|
if (!IsValid())
|
|
|
|
return 0;
|
|
|
|
return m_opaque_sp->GetFlags().Get();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
SBCommand::SetFlags (uint32_t flags)
|
|
|
|
{
|
|
|
|
if (IsValid())
|
|
|
|
m_opaque_sp->GetFlags().Set(flags);
|
|
|
|
}
|