You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/12/23 17:10:15 UTC

[GitHub] [tvm] areusch commented on a change in pull request #7153: [RUNTIME] Add libbacktrace for backtraces with line numbers

areusch commented on a change in pull request #7153:
URL: https://github.com/apache/tvm/pull/7153#discussion_r548029374



##########
File path: cmake/modules/Libbacktrace.cmake
##########
@@ -0,0 +1,18 @@
+include(ExternalProject)
+
+ExternalProject_Add(project_libbacktrace

Review comment:
       it would be good to double-check that the sources are properly depended on by libbacktrace.a

##########
File path: include/tvm/support/logging.h
##########
@@ -113,35 +119,171 @@
 
 namespace tvm {
 
+std::string backtrace();
+
+struct Error : public std::runtime_error {
+  explicit Error(const std::string &s) : std::runtime_error(s) {}
+};
+
+class InternalError : public std::exception {
+ public:
+  InternalError(const std::string& file, int lineno, const std::string& message,
+        const std::time_t& time = std::time(nullptr), std::string stacktrace = backtrace())

Review comment:
       what do we think about pushing this InternalError object into dmlc and defining a weak function backtrace() there that allows you to override/supply a backtrace?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org