git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philip Oakley <philipoakley@iee.org>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	MsysGit List <msysgit@googlegroups.com>,
	Yue Lin Ho <b8732003@student.nsysu.edu.tw>,
	Philip Oakley <philipoakley@iee.org>
Subject: [PATCH v2 12/16] engine.pl: provide more debug print statements
Date: Sun, 19 Jul 2015 21:08:12 +0100	[thread overview]
Message-ID: <1437336497-4072-13-git-send-email-philipoakley@iee.org> (raw)
In-Reply-To: <1437336497-4072-1-git-send-email-philipoakley@iee.org>

Assist developers transitioning between the two cultures
by including appropriate, but commented out, debug statements.

The exception is when an unhandled compiler option is detected,
where printing of the full line will supplement the line number and
option part. Otherwise the OP has no immediate mechanism for
inspecting the relevant part of the makedry output.

The commented out code is "deactivated code", not dead code, as per
DO178B safety critical software development guideline [1].

These debug print statements act as a guide for a poor man's --verbose
option. The test suite doesn't cover the contrib/buildsystems (or
Msysgit's msvc-build) contributions so fails to notice breakages there-in.

It is doubly hard to get developers to ride both horses so, contrary to
normal convention, retain selected debug statements as a safety net for
those willing to try.

[1] Dead code : Dead code is source code (and it is a part of binary code)
that is not executed in the final system and it will be not having
traceability to any requirements (one can say unintentional code).

Deactivated code: code which is commented out or removed via #ifdef's
(it is not a part of final binary code) and it will be having
traceability to its low level requirements (its a intentional code and
it can be activated in some configurations through hardware traps for
debugging or other purposes.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
---
My response to Sebastian Schuberth's comment on dead code
http://marc.info/?l=git&m=143630748919942&w=2 (2015-07-07)
---
 contrib/buildsystems/engine.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index 4a843f3..3238d16 100755
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -41,6 +41,7 @@ EOM
 # Parse command-line options
 while (@ARGV) {
     my $arg = shift @ARGV;
+	#print "Arg: $arg \n";
     if ("$arg" eq "-h" || "$arg" eq "--help" || "$arg" eq "-?") {
 	showUsage();
 	exit(0);
@@ -129,6 +130,7 @@ sub parseMakeOutput
     print "Parsing GNU Make output to figure out build structure...\n";
     my $line = 0;
     while (my $text = shift @makedry) {
+		#print "Make: $text\n"; # show the makedry line
         my $ate_next;
         do {
             $ate_next = 0;
@@ -263,6 +265,7 @@ sub handleCompileLine
         } elsif ($part =~ /\.(c|cc|cpp)$/) {
             $sourcefile = $part;
         } else {
+            print "full line: $line\n";
             die "Unhandled compiler option @ line $lineno: $part";
         }
     }
@@ -288,6 +291,7 @@ sub handleLibLine
             $libout = $part;
             $libout =~ s/\.a$//;
         } else {
+            print "full line: $line\n";
             die "Unhandled lib option @ line $lineno: $part";
         }
     }
-- 
2.4.2.windows.1.5.gd32afb6

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "Git for Windows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  parent reply	other threads:[~2015-07-19 20:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-19 20:08 [PATCH v2 00/16] Make the msvc-build scripts work again Philip Oakley
2015-07-19 20:08 ` [PATCH v2 01/16] perl/Makefile: treat a missing PM.stamp as if empty Philip Oakley
2015-07-19 20:08 ` [PATCH v2 02/16] .gitignore: improve MSVC ignore patterns Philip Oakley
2015-07-19 20:08 ` [PATCH v2 03/16] .gitignore: ignore library directories created by MSVC VS2008 buildsystem Philip Oakley
2015-07-19 20:08 ` [PATCH v2 04/16] (msvc-build) Vcproj.pm: remove duplicate GUID Philip Oakley
2015-07-19 20:08 ` [PATCH v2 05/16] engine.pl: fix error message (lib->link) Philip Oakley
2015-07-19 20:08 ` [PATCH v2 06/16] engine.pl: Properly accept quoted spaces in filenames Philip Oakley
2015-07-19 20:08 ` [PATCH v2 07/16] engine.pl: Fix i18n -o option in msvc buildsystem generator Philip Oakley
2015-07-19 20:08 ` [PATCH v2 08/16] engine.pl: ignore invalidcontinue.obj which is known to MSVC Philip Oakley
2015-07-20  1:54   ` Eric Sunshine
2015-07-20  6:13     ` Philip Oakley
2015-07-19 20:08 ` [PATCH v2 09/16] engine.pl: name the msvc buildsystem's makedry error file Philip Oakley
2015-07-19 20:08 ` [PATCH v2 10/16] engine.pl: delete the captured stderr file if empty Philip Oakley
2015-07-20  2:01   ` Eric Sunshine
2015-07-20  6:16     ` Philip Oakley
2015-07-20  6:40       ` Eric Sunshine
2015-07-20 11:55         ` Philip Oakley
2015-07-20 18:10           ` Eric Sunshine
2015-07-19 20:08 ` [PATCH v2 11/16] engine.pl: add debug line to capture the dry-run Philip Oakley
2015-07-19 20:08 ` Philip Oakley [this message]
2015-07-19 20:08 ` [PATCH v2 13/16] Vcproj.pm: list git.exe first to be startup project Philip Oakley
2015-07-19 20:08 ` [PATCH v2 14/16] vcbuild/readme: Improve layout and reference msvc-build script Philip Oakley
2015-07-19 20:21   ` Philip Oakley
2015-07-19 20:08 ` [PATCH v2 14/16] vcbuild/readme: Improve layout Philip Oakley
2015-07-19 20:08 ` [PATCH v2 15/16] msvc-build: add complete Microsoft Visual C compilation script Philip Oakley
2015-07-19 20:08 ` [PATCH v2 16/16] config.mak.uname: add MSVC No_SafeExeceptionHandler option Philip Oakley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437336497-4072-13-git-send-email-philipoakley@iee.org \
    --to=philipoakley@iee.org \
    --cc=b8732003@student.nsysu.edu.tw \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=msysgit@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).