美文网首页
linker打开log开关

linker打开log开关

作者: xiabodan | 来源:发表于2019-10-24 15:10 被阅读0次

linker在设计之初就为广大码农提供了便利

  // Get a few environment variables.
  const char* LD_DEBUG = getenv("LD_DEBUG");
  if (LD_DEBUG != nullptr) {
    g_ld_debug_verbosity = atoi(LD_DEBUG);
  }

因此可以在进程内部设置环境变量

setenv("LD_DEBUG", "2", 1);

库加载相关的log开关

 // For logging, check the flag applied to all processes first.
 static CachedProperty debug_ld_all("debug.ld.all");
 flags_ |= ParseProperty(debug_ld_all.Get());

可以设置

adb shell setprop debug.ld.all dlerror,dlopen

不需要root就可以设置

相关文章

网友评论

      本文标题:linker打开log开关

      本文链接:https://www.haomeiwen.com/subject/kmxdvctx.html