git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 12/16] engine.pl: provide more debug print statements

From
Philip Oakley <philipoakley@iee.org>
Date
Jul 19, 2015, 20:08 UTC
Message-ID
<1437336497-4072-13-git-send-email-philipoakley@iee.org>
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.
Previous: Philip OakleyNext: Philip Oakley
Message 20 of 26 in “Make the msvc-build scripts work again”
  1. 00/16 Make the msvc-build scripts work againPhilip Oakley, Jul 19, 2015
  2. 01/16 perl/Makefile: treat a missing PM.stamp as if emptyPhilip Oakley, Jul 19, 2015
  3. 02/16 .gitignore: improve MSVC ignore patternsPhilip Oakley, Jul 19, 2015
  4. 03/16 .gitignore: ignore library directories created by MSVC VS2008 buildsystemPhilip Oakley, Jul 19, 2015
  5. 04/16 (msvc-build) Vcproj.pm: remove duplicate GUIDPhilip Oakley, Jul 19, 2015
  6. 05/16 engine.pl: fix error message (lib->link)Philip Oakley, Jul 19, 2015
  7. 06/16 engine.pl: Properly accept quoted spaces in filenamesPhilip Oakley, Jul 19, 2015
  8. 07/16 engine.pl: Fix i18n -o option in msvc buildsystem generatorPhilip Oakley, Jul 19, 2015
  9. 08/16 engine.pl: ignore invalidcontinue.obj which is known to MSVCPhilip Oakley, Jul 19, 2015
  10. Eric SunshineJul 20, 2015
  11. Philip OakleyJul 20, 2015
  12. 09/16 engine.pl: name the msvc buildsystem's makedry error filePhilip Oakley, Jul 19, 2015
  13. 10/16 engine.pl: delete the captured stderr file if emptyPhilip Oakley, Jul 19, 2015
  14. Eric SunshineJul 20, 2015
  15. Philip OakleyJul 20, 2015
  16. Eric SunshineJul 20, 2015
  17. Philip OakleyJul 20, 2015
  18. Eric SunshineJul 20, 2015
  19. 11/16 engine.pl: add debug line to capture the dry-runPhilip Oakley, Jul 19, 2015
  20. 12/16 engine.pl: provide more debug print statementsPhilip Oakley, Jul 19, 2015
  21. 13/16 Vcproj.pm: list git.exe first to be startup projectPhilip Oakley, Jul 19, 2015
  22. 14/16 vcbuild/readme: Improve layout and reference msvc-build scriptPhilip Oakley, Jul 19, 2015
  23. Philip OakleyJul 19, 2015
  24. 14/16 vcbuild/readme: Improve layoutPhilip Oakley, Jul 19, 2015
  25. 15/16 msvc-build: add complete Microsoft Visual C compilation scriptPhilip Oakley, Jul 19, 2015
  26. 16/16 config.mak.uname: add MSVC No_SafeExeceptionHandler optionPhilip Oakley, Jul 19, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.