本文介绍了Delphi App具有“无调试信息”调试时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经构建了一个使用包和组件的应用程序。当我们调试应用程序时,IDE中的事件日志通常显示我们的BPL正在加载,没有调试信息(无调试信息)。这没有意义,因为我们的所有包和EXE都是通过调试构建的。

  _(每个项目)|选项| Compiling_ 
[x]断言
[x]调试信息
[x]本地符号
符号引用info =参考信息
[]使用debug .dcus
[x]使用导入的数据引用

_(每个项目)|选项| Linking_
[x]调试信息
地图文件=详细

我们有4项目,全部使用运行时版本构建:


  1. Core.bpl

  2. Components.bpl

  3. Plugin.bpl(同时使用#1&#2)

  4. MainApp.exe(使用#1)



    1. 观察到的问题



      1)我们调试很多时候,Components.bpl是加载调试信息,但本地变量窗口中的所有值都为空。如果您将鼠标悬停在代码中的变量上,则没有弹出窗口,评估窗口也不显示任何内容(结果窗格始终为空)。



      2 )有时,事件日志显示各种BPL的无调试信息。例如,如果我们激活Plugin.bpl项目并将其设置为Run |参数的主机应用程序成为MainApp.exe,然后按F9,除了Plugin.bpl模块,所有模块似乎都加载了有调试信息。加载时,事件日志显示无调试信息。但是,如果我们关闭应用程序并立即按F9,它将再次运行它,而不重新编译任何东西,此时Plugin.bpl加载了debug(具有调试信息)。



      问题



      1)什么会导致本地变量窗口显示值? 2)为什么当BPL符合调试并且所有调试文件(dcu,map等)可用时,为什么BPL有时在没有调试信息的情况下加载?




      解决方案

      对于我们的特殊情况,我们可以通过将Core.pbl和Components.bpl组合到一个BPL中来解决这个问题。现在,所有模块都加载了调试信息,偶尔出现的问题就是:本地窗口不会显示变量的值。


      We have built an application that uses packages and components. When we debug the application, the "Event Log" in the IDE often shows the our BPLs are being loaded without debug information ("No Debug Info"). This doesn't make sense because all our packages and EXEs are built with debug.

      _(each project) | Options | Compiling_
      [ x ] Assertions
      [ x ] Debug information
      [ x ] Local symbols
      Symbol reference info = "Reference info"
      [   ] Use debug .dcus
      [ x ] Use imported data references
      
      _(each project) | Options | Linking_
      [ x ] Debug information
      Map file = Detailed
      

      We have 4 projects, all built with runtime pacakges:

      1. Core.bpl
      2. Components.bpl
      3. Plugin.bpl (uses both #1 & #2)
      4. MainApp.exe (uses #1)

      Problems Observed

      1) Many times when we debug, the Components.bpl is loaded with debug info, but all values in the "Local Variables" window are blank. If you hover your mouse over a variable in the code, there is no popup, and Evaluate window also shows nothing (the "Result" pane is always blank).

      2) Sometimes the Event Log shows "No Debug Info" for various BPLs. For instance, if we activate the Plugin.bpl project and set it's Run | Parameter's Host Application to be the MainApp.exe, and then press F9, all modules seems to load with "Has Debug Info" except for the Plugin.bpl module. When it loads, the Event Log shows "No Debug Info". However, if we close the app and immediately press F9, it will run it again without recompiling anything and this time Plugin.bpl is loaded with debug ("Has Debug Info").

      Questions

      1) What would cause the "Local Variables" window to not display the values?

      2) Why are BPLs sometimes loaded without debug info when the BPL was complied with debug and all the debug files (dcu, map, etc.) are available?

      解决方案

      For our particular situation we were able to fix the issue by combining the Core.pbl and Components.bpl into a single BPL. Now all modules are loaded with debug info and the occasional issue where the Locals Window wouldn't display values for the variables is resolved.

      这篇关于Delphi App具有“无调试信息”调试时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 21:12