Commit 2a4220fa authored by Aleksey R.'s avatar Aleksey R.

Merge branch 'attachProcessFlags' into 'dev-1.0'

added default parameter for attachProcess

See merge request !14
parents 2508ed6b e270ac42
......@@ -19,7 +19,7 @@ void uninitialize();
// manage debug target
PROCESS_DEBUG_ID startProcess(const std::wstring &processName, const ProcessDebugFlags& flags = ProcessDebugDefault);
PROCESS_DEBUG_ID attachProcess(PROCESS_ID pid);
PROCESS_DEBUG_ID attachProcess(PROCESS_ID pid, const ProcessDebugFlags& flags = ProcessDebugDefault);
void detachProcess( PROCESS_DEBUG_ID processId = -1);
void terminateProcess( PROCESS_DEBUG_ID processId = -1);
void detachAllProcesses();
......
......@@ -776,16 +776,6 @@ TypeInfoPtr TypeEval::getResult()
return !token.is(clang::tok::kw_const);
});
for (auto it = tokens.begin(); it != tokens.end(); ++it)
{
if (it->is(clang::tok::greatergreater))
{
auto &t = *it;
t.setKind(clang::tok::greater);
it = tokens.insert(it, t);
}
}
TypeMatcher typeMatcher;
auto matchResult = all_of(typeMatcher, token_is(m_endToken)).match(std::make_pair(tokens.cbegin(), tokens.cend()));
......
......@@ -272,11 +272,13 @@ void terminateProcess( PROCESS_DEBUG_ID processId )
///////////////////////////////////////////////////////////////////////////////
PROCESS_DEBUG_ID attachProcess(PROCESS_ID pid)
PROCESS_DEBUG_ID attachProcess(PROCESS_ID pid, const ProcessDebugFlags& flags)
{
if ( !isInintilized() )
initialize();
setEngBreakOption(flags);
HRESULT hres;
hres = g_dbgMgr->client->AttachProcess( 0, pid, DEBUG_ATTACH_DEFAULT );
......
......@@ -46,12 +46,11 @@ public:
CloseHandle( processInfo.hProcess );
CloseHandle( processInfo.hThread );
Sleep(100);
return processInfo.dwProcessId;
}
virtual void TearDown() {
try {
kdlib::terminateAllProcesses();
......
......@@ -107,7 +107,7 @@ TEST(ExprEval, Bitwise)
EXPECT_EQ(~0xFA01894B, evalExpr(L"~0xFA01894B"));
}
TEST(ExprEval, IncDec)
TEST(ExprEval, DISABLED_IncDec)
{
TypedValue a = 10;
EXPECT_EQ(++a.getValue(), evalExpr(L"++a", makeScope({ {L"a", a} })));
......@@ -226,6 +226,13 @@ TEST(ExprEval, SizeofComplex)
EXPECT_THROW(evalExpr("sizeof(int[10]&)"), DbgException);
}
TEST(ExprEval, SizeofExpr)
{
EXPECT_EQ(sizeof(long int) >> 2, evalExpr("sizeof(long int) >> 2"));
EXPECT_EQ(1 << sizeof(long int), evalExpr("1 << sizeof(long int)"));
EXPECT_EQ(sizeof(2 < 4), evalExpr("sizeof(2 < 4)"));
}
TEST(ExprEval, Bool)
{
EXPECT_EQ(true, evalExpr(L"true"));
......
......@@ -36,9 +36,11 @@ TEST_F( ProcessTest, StartProcess )
TEST_F( ProcessTest, AttachProcess )
{
PROCESS_ID pid = StartTargetappWithParam(L"processtest");
ASSERT_NE(0, pid);
PROCESS_DEBUG_ID id;
ASSERT_NO_THROW( id = attachProcess(pid) );
EXPECT_EQ(DebugStatusBreak, targetExecutionStatus());
EXPECT_NO_THROW( terminateProcess(id) );
EXPECT_EQ( 0, kdlib::getNumberProcesses() );
}
......@@ -46,9 +48,11 @@ TEST_F( ProcessTest, AttachProcess )
//TEST_F(ProcessTest, AttachProcessNoBreak)
//{
// PROCESS_ID pid = StartTargetappWithParam(L"processtest");
// ASSERT_NE(0, pid);
//
// PROCESS_DEBUG_ID id;
// ASSERT_NO_THROW(id = attachProcess(pid, ProcessDebugDefault & ~(ProcessBreakOnStart)));
// EXPECT_EQ(DebugStatusGo, targetExecutionStatus());
// EXPECT_NO_THROW(terminateProcess(id));
// EXPECT_EQ(0, kdlib::getNumberProcesses());
//}
......
......@@ -270,7 +270,7 @@ TEST(TypeEvalTest, TemplateNumeric)
}
TEST(TypeEvalTest, TemplateConstRef)
TEST(TypeEvalTest, DISABLED_TemplateConstRef)
{
static const char sourceCode[] = "\
template<typename T> \
......@@ -328,7 +328,7 @@ TEST(TypeEvalTest, TemplateNamespace2)
EXPECT_NO_THROW(evalType("testspace::TestStruct<int,testspace::TestStruct<int,int> >::field1", typeProvider));
}
TEST(TypeEvalTest, TemplateNamespace3)
TEST(TypeEvalTest, DISABLED_TemplateNamespace3)
{
static const char sourceCode[] = " \
namespace testspace { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment