在调试信息中,如何知道是源码中哪一行?

qdh2002 2004-07-28 11:26:57
看到有些程序,在发送一些调试信息,显示在什么.cpp的哪一行。。什么变量是什么值,不知道是怎么实现的??
...全文
126 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiuafa 2004-07-29
  • 打赏
  • 举报
回复
C++Builder predefines certain global identifiers known as manifest constants. Most global identifiers begin and end with two underscores (__).

Note: For readability, underscores are often separated by a single blank space. In your source code, you should never insert whitespace between underscores.

Macro Value Description

_ _BCOPT_ _ 1 Defined in any compiler that has an optimizer.
_ _BCPLUSPLUS_ _ 0x0560 Defined if you've selected C++ compilation; will increase in later releases.
_ _BORLANDC_ _ 0x0560 Version number.
_ _CDECL_ _ 1 Defined if Calling Convention is set to cdecl; otherwise undefined.
_CHAR_UNSIGNED 1 Defined by default indicating that the default char is unsigned char. Use the -K compiler option to undefine this macro.

_ _CODEGUARD_ _ Defined whenever one of the CodeGuard compiler options is used; otherwise it is undefined.
_ _CONSOLE_ _ 1 When defined, the macro indicates that the program is a console application.
_CPPUNWIND 1 Enable stack unwinding. This is true by default; use -xd- to disable.
_ _cplusplus 1 Defined if in C++ mode; otherwise, undefined.
_ _DATE_ _ String literal Date when processing began on the current file.

_ _DLL_ _ 1 Defined whenever the -WD compiler option is used; otherwise it is undefined.
_ _FILE_ _ String literal Name of the current file being processed.
_ _FLAT_ _ 1 Defined when compiling in 32-bit flat memory model.
_ _FUNC_ _ String literal Name of the current function being processed. More details.
_ _LINE_ _ Decimal constant Number of the current source file line being processed.

_M_IX86 0x12c Always defined. The default value is 300. You can change the value to 400 or 500 by using the /4 or /5 compiler options.
_ _MT_ _ 1 Defined only if the -tWM option is used. It specifies that the multithread library is to be linked.
_ _PASCAL_ _ 1 Defined if Calling Convention is set to Pascal; otherwise undefined.

_ _STDC_ _ 1 Defined if you compile with the -A compiler option; otherwise, it is undefined.
_ _TCPLUSPLUS_ _ 0x0560 Version number.
_ _TEMPLATES_ _ 1 Defined as 1 for C++ files (meaning that templates are supported); otherwise, it is undefined.
_ _TIME_ _ String literal Time when processing began on the current file.
_ _TLS_ _ 1 Thread Local Storage. Always true in C++Builder.
_ _TURBOC_ _ 0x0560 Will increase in later releases.

_WCHAR_T Defined only for C++ programs to indicate that wchar_t is an intrinsically defined data type.
_WCHAR_T_DEFINED Defined only for C++ programs to indicate that wchar_t is an intrinsically defined data type.
_Windows Defined for Windows-only code.
_ _WIN32_ _ 1 Defined for console and GUI applications.

Note: _ _DATE_ _, _ _FILE_ _ , _ _ FUNC_ _, _ _LINE_ _, _ _STDC_ _, and _ _TIME_ _ cannot be redefined or undefined.
liux330 2004-07-29
  • 打赏
  • 举报
回复
我的一个程序在运行过程中,
1、提示出现在这一行: Application->Run();
这个是什么问题啊??
2、还有的问题别以其根本没有指出错在那一行!继续运行的又没有问题,奇怪?
zxcdewq 2004-07-29
  • 打赏
  • 举报
回复
编译器当然知道编译到那个文件那行出的错误,把这些信息显示出来就行了。
具体怎么编译的我就不知道了
windindance 2004-07-29
  • 打赏
  • 举报
回复
宏:__FILE__ , __LINE__
futulove 2004-07-29
  • 打赏
  • 举报
回复
设置断点就可以了,一行一行调试
xjp6688 2004-07-29
  • 打赏
  • 举报
回复
双击错误提示!
hjiaming 2004-07-29
  • 打赏
  • 举报
回复
设置断点咯。。。
beyondzhx 2004-07-29
  • 打赏
  • 举报
回复
设置断点。

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧