[Lldb-commits] [PATCH] D30007: [lldb] Provide API to know which sanitizer generated an eStopReasonInstrumentation

2017-05-03 Thread Jim Ingham via Phabricator via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Sorry for the delay.  That's fine.


https://reviews.llvm.org/D30007



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D30007: [lldb] Provide API to know which sanitizer generated an eStopReasonInstrumentation

2017-05-03 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added a comment.

Looks fine to me, make sure Jim is happy as well.


https://reviews.llvm.org/D30007



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D30007: [lldb] Provide API to know which sanitizer generated an eStopReasonInstrumentation

2017-05-03 Thread Kuba (Brecka) Mracek via Phabricator via lldb-commits
kubamracek added a comment.
This revision now requires changes to proceed.

ping


https://reviews.llvm.org/D30007



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D30007: [lldb] Provide API to know which sanitizer generated an eStopReasonInstrumentation

2017-04-17 Thread Kuba (Brecka) Mracek via Phabricator via lldb-commits
kubamracek updated this revision to Diff 95469.
kubamracek added a comment.

Addressing review comments.


https://reviews.llvm.org/D30007

Files:
  include/lldb/API/SBThread.h
  include/lldb/API/SBThreadPlan.h
  include/lldb/Target/InstrumentationRuntimeStopInfo.h
  include/lldb/Target/StopInfo.h
  packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
  packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
  packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
  scripts/interface/SBThread.i
  scripts/interface/SBThreadPlan.i
  source/API/SBThread.cpp
  
source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
  
source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
  source/Target/InstrumentationRuntimeStopInfo.cpp

Index: source/Target/InstrumentationRuntimeStopInfo.cpp
===
--- source/Target/InstrumentationRuntimeStopInfo.cpp
+++ source/Target/InstrumentationRuntimeStopInfo.cpp
@@ -17,9 +17,9 @@
 using namespace lldb_private;
 
 InstrumentationRuntimeStopInfo::InstrumentationRuntimeStopInfo(
-Thread , std::string description,
+Thread , InstrumentationRuntimeType type, std::string description,
 StructuredData::ObjectSP additional_data)
-: StopInfo(thread, 0) {
+: StopInfo(thread, type) {
   m_extended_info = additional_data;
   m_description = description;
 }
@@ -30,8 +30,8 @@
 
 StopInfoSP
 InstrumentationRuntimeStopInfo::CreateStopReasonWithInstrumentationData(
-Thread , std::string description,
+Thread , InstrumentationRuntimeType type, std::string description,
 StructuredData::ObjectSP additionalData) {
   return StopInfoSP(
-  new InstrumentationRuntimeStopInfo(thread, description, additionalData));
+  new InstrumentationRuntimeStopInfo(thread, type, description, additionalData));
 }
Index: source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
===
--- source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
+++ source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
@@ -859,7 +859,8 @@
   thread_sp->SetStopInfo(
   InstrumentationRuntimeStopInfo::
   CreateStopReasonWithInstrumentationData(
-  *thread_sp, stop_reason_description, report));
+  *thread_sp, eInstrumentationRuntimeTypeThreadSanitizer,
+  stop_reason_description, report));
 
 StreamFileSP stream_sp(
 process_sp->GetTarget().GetDebugger().GetOutputFile());
Index: source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
===
--- source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
+++ source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
@@ -257,9 +257,11 @@
   if (process_sp && process_sp == context->exe_ctx_ref.GetProcessSP()) {
 ThreadSP thread_sp = context->exe_ctx_ref.GetThreadSP();
 if (thread_sp)
-  thread_sp->SetStopInfo(InstrumentationRuntimeStopInfo::
- CreateStopReasonWithInstrumentationData(
- *thread_sp, description, report));
+  thread_sp->SetStopInfo(
+  InstrumentationRuntimeStopInfo::
+  CreateStopReasonWithInstrumentationData(
+  *thread_sp, eInstrumentationRuntimeTypeAddressSanitizer,
+  description, report));
 
 StreamFileSP stream_sp(
 process_sp->GetTarget().GetDebugger().GetOutputFile());
Index: source/API/SBThread.cpp
===
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -167,7 +167,6 @@
 case eStopReasonExec:
 case eStopReasonPlanComplete:
 case eStopReasonThreadExiting:
-case eStopReasonInstrumentation:
   // There is no data for these stop reasons.
   return 0;
 
@@ -190,6 +189,9 @@
 
 case eStopReasonException:
   return 1;
+
+case eStopReasonInstrumentation:
+  return 1;
 }
   }
 } else {
@@ -221,7 +223,6 @@
 case eStopReasonExec:
 case eStopReasonPlanComplete:
 case eStopReasonThreadExiting:
-case eStopReasonInstrumentation:
   // There is no data for these stop reasons.
   return 0;
 
@@ -255,6 +256,9 @@
 
 case eStopReasonException:
   return stop_info_sp->GetValue();
+
+case eStopReasonInstrumentation:
+  return stop_info_sp->GetValue();
 }
   }
 } else {
Index: scripts/interface/SBThreadPlan.i
===
--- scripts/interface/SBThreadPlan.i
+++ 

[Lldb-commits] [PATCH] D30007: [lldb] Provide API to know which sanitizer generated an eStopReasonInstrumentation

2017-02-22 Thread Jim Ingham via Phabricator via lldb-commits
jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

Aargh, sorry.  My queue is overflowing...  I had one tiny comment about the 
tests.  If you do that, then it will be fine to go in.




Comment at: 
packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py:126-132
+self.assertEqual(
+process.GetSelectedThread().GetStopReason(),
+lldb.eStopReasonInstrumentation)
+self.assertEqual(
+process.GetSelectedThread().GetStopReasonDataAtIndex(0),
+lldb.eInstrumentationRuntimeTypeAddressSanitizer)
+

Can you add a check that GetStopReasonDataCount and only do the check for 
GetStopReasonDataAtIndex if this is 1?  We have the ability to run the 
testsuite against older lldb's and it's good not to add failures if it can be 
avoided.  Plus it's good to check that that call is returning a reasonable 
value.



Comment at: 
packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py:65-67
+self.assertEqual(process.
+GetSelectedThread().GetStopReasonDataAtIndex(0),
+lldb.eInstrumentationRuntimeTypeAddressSanitizer)

Same comment as above.



Comment at: 
packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py:57-59
+self.assertEqual(
+process.GetSelectedThread().GetStopReasonDataAtIndex(0),
+lldb.eInstrumentationRuntimeTypeThreadSanitizer)

Same comment as above.


https://reviews.llvm.org/D30007



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D30007: [lldb] Provide API to know which sanitizer generated an eStopReasonInstrumentation

2017-02-22 Thread Kuba (Brecka) Mracek via Phabricator via lldb-commits
kubamracek added a comment.

@jingham ping


https://reviews.llvm.org/D30007



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D30007: [lldb] Provide API to know which sanitizer generated an eStopReasonInstrumentation

2017-02-15 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

I am fine as long is Jim Ingham is fine. Jim, if you are good with this, just 
put it into Accept Revision.


https://reviews.llvm.org/D30007



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D30007: [lldb] Provide API to know which sanitizer generated an eStopReasonInstrumentation

2017-02-15 Thread Kuba (Brecka) Mracek via Phabricator via lldb-commits
kubamracek created this revision.
kubamracek added a project: Sanitizers.

We can provide this via StopReason->GetValue().  This is important so that 
users of SB API can treat various sanitizers differently (the extended stop 
reason data is also structured differently for different sanitizers).


https://reviews.llvm.org/D30007

Files:
  include/lldb/API/SBThread.h
  include/lldb/API/SBThreadPlan.h
  include/lldb/Target/InstrumentationRuntimeStopInfo.h
  include/lldb/Target/StopInfo.h
  packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
  packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
  packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
  scripts/interface/SBThread.i
  scripts/interface/SBThreadPlan.i
  source/API/SBThread.cpp
  
source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
  
source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
  source/Target/InstrumentationRuntimeStopInfo.cpp

Index: source/Target/InstrumentationRuntimeStopInfo.cpp
===
--- source/Target/InstrumentationRuntimeStopInfo.cpp
+++ source/Target/InstrumentationRuntimeStopInfo.cpp
@@ -17,9 +17,9 @@
 using namespace lldb_private;
 
 InstrumentationRuntimeStopInfo::InstrumentationRuntimeStopInfo(
-Thread , std::string description,
+Thread , InstrumentationRuntimeType type, std::string description,
 StructuredData::ObjectSP additional_data)
-: StopInfo(thread, 0) {
+: StopInfo(thread, type) {
   m_extended_info = additional_data;
   m_description = description;
 }
@@ -30,8 +30,8 @@
 
 StopInfoSP
 InstrumentationRuntimeStopInfo::CreateStopReasonWithInstrumentationData(
-Thread , std::string description,
+Thread , InstrumentationRuntimeType type, std::string description,
 StructuredData::ObjectSP additionalData) {
   return StopInfoSP(
-  new InstrumentationRuntimeStopInfo(thread, description, additionalData));
+  new InstrumentationRuntimeStopInfo(thread, type, description, additionalData));
 }
Index: source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
===
--- source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
+++ source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
@@ -818,7 +818,8 @@
   thread_sp->SetStopInfo(
   InstrumentationRuntimeStopInfo::
   CreateStopReasonWithInstrumentationData(
-  *thread_sp, stop_reason_description, report));
+  *thread_sp, eInstrumentationRuntimeTypeThreadSanitizer,
+  stop_reason_description, report));
 
 StreamFileSP stream_sp(
 process_sp->GetTarget().GetDebugger().GetOutputFile());
Index: source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
===
--- source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
+++ source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
@@ -257,9 +257,11 @@
   if (process_sp && process_sp == context->exe_ctx_ref.GetProcessSP()) {
 ThreadSP thread_sp = context->exe_ctx_ref.GetThreadSP();
 if (thread_sp)
-  thread_sp->SetStopInfo(InstrumentationRuntimeStopInfo::
- CreateStopReasonWithInstrumentationData(
- *thread_sp, description, report));
+  thread_sp->SetStopInfo(
+  InstrumentationRuntimeStopInfo::
+  CreateStopReasonWithInstrumentationData(
+  *thread_sp, eInstrumentationRuntimeTypeAddressSanitizer,
+  description, report));
 
 StreamFileSP stream_sp(
 process_sp->GetTarget().GetDebugger().GetOutputFile());
Index: source/API/SBThread.cpp
===
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -167,7 +167,6 @@
 case eStopReasonExec:
 case eStopReasonPlanComplete:
 case eStopReasonThreadExiting:
-case eStopReasonInstrumentation:
   // There is no data for these stop reasons.
   return 0;
 
@@ -190,6 +189,9 @@
 
 case eStopReasonException:
   return 1;
+
+case eStopReasonInstrumentation:
+  return 1;
 }
   }
 } else {
@@ -221,7 +223,6 @@
 case eStopReasonExec:
 case eStopReasonPlanComplete:
 case eStopReasonThreadExiting:
-case eStopReasonInstrumentation:
   // There is no data for these stop reasons.
   return 0;
 
@@ -255,6 +256,9 @@
 
 case eStopReasonException:
   return stop_info_sp->GetValue();
+
+case eStopReasonInstrumentation:
+  return stop_info_sp->GetValue();
 }