1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00

Add -d (debug mode) to the assembler options. In studyexpr, use the debug

flag, not the verbose flag to decide if the studied expression should be
output.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5919 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2012-11-06 20:24:44 +00:00
parent 2c446018db
commit 4682d7542a
3 changed files with 28 additions and 3 deletions

View File

@ -92,6 +92,7 @@ Short options:
-U Mark unresolved symbols as import
-V Print the assembler version
-W n Set warning level n
-d Debug mode
-g Add debug info to object file
-h Help (this text)
-i Ignore case of symbols
@ -108,6 +109,7 @@ Long options:
--cpu type Set cpu type
--create-dep name Create a make dependency file
--create-full-dep name Create a full make dependency file
--debug Debug mode
--debug-info Add debug info to object file
--feature name Set an emulation feature
--forget-inc-paths Forget include search paths
@ -175,6 +177,12 @@ Here is a description of all the command line options:
information to the assembler.
<tag><tt>-d, --debug</tt></tag>
Enables debug mode, something that should not be needed for mere
mortals:-)
<label id="option--feature">
<tag><tt>--feature name</tt></tag>

View File

@ -1,4 +1,4 @@
/*****************************************************************************/
/* */
/* main.c */
/* */
@ -42,6 +42,7 @@
#include "addrsize.h"
#include "chartype.h"
#include "cmdline.h"
#include "debugflag.h"
#include "mmodel.h"
#include "print.h"
#include "scopedefs.h"
@ -97,6 +98,7 @@ static void Usage (void)
" -U\t\t\t\tMark unresolved symbols as import\n"
" -V\t\t\t\tPrint the assembler version\n"
" -W n\t\t\t\tSet warning level n\n"
" -d\t\t\t\tDebug mode\n"
" -g\t\t\t\tAdd debug info to object file\n"
" -h\t\t\t\tHelp (this text)\n"
" -i\t\t\t\tIgnore case of symbols\n"
@ -113,6 +115,7 @@ static void Usage (void)
" --cpu type\t\t\tSet cpu type\n"
" --create-dep name\t\tCreate a make dependency file\n"
" --create-full-dep name\tCreate a full make dependency file\n"
" --debug\t\t\tDebug mode\n"
" --debug-info\t\t\tAdd debug info to object file\n"
" --feature name\t\tSet an emulation feature\n"
" --forget-inc-paths\t\tForget include search paths\n"
@ -407,6 +410,15 @@ static void OptCreateFullDep (const char* Opt attribute ((unused)),
static void OptDebug (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Compiler debug mode */
{
++Debug;
}
static void OptDebugInfo (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Add debug info to the object file */
@ -869,6 +881,7 @@ int main (int argc, char* argv [])
{ "--cpu", 1, OptCPU },
{ "--create-dep", 1, OptCreateDep },
{ "--create-full-dep", 1, OptCreateFullDep },
{ "--debug", 0, OptDebug },
{ "--debug-info", 0, OptDebugInfo },
{ "--feature", 1, OptFeature },
{ "--forget-inc-paths", 0, OptForgetIncPaths },
@ -930,6 +943,10 @@ int main (int argc, char* argv [])
LongOption (&I, OptTab, sizeof(OptTab)/sizeof(OptTab[0]));
break;
case 'd':
OptDebug (Arg, 0);
break;
case 'g':
OptDebugInfo (Arg, 0);
break;

View File

@ -37,7 +37,7 @@
/* common */
#include "check.h"
#include "print.h"
#include "debugflag.h"
#include "shift.h"
#include "xmalloc.h"
@ -537,7 +537,7 @@ static void StudySymbol (ExprNode* Expr, ExprDesc* D)
SymUnmarkUser (Sym);
/* If requested and if the expression is valid, dump it */
if (Verbosity > 0 && !ED_HasError (D)) {
if (Debug > 0 && !ED_HasError (D)) {
DumpExpr (Expr, SymResolve);
}