How can I activate ceedling trace? - unit-testing

I am using ceedling for unit testing in a firmware I am working on.
I would like to see all command line option ceedling uses when invoking the compiler.
I tried to use the option --trace, but so for I have not found any difference.
ceedling test:all --trace

try:
ceedling verbosity[4] test:all

If you are on a Windows machine, the command line args can be intercepted like this:
Create a little command line tool ShowArgs.exe that displays the given command line args in a message box.
Create a registry key in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Foo.exe whereas Foo.exe is the name of the compiler without the path.
Add a value with name debugger and value "" including the quotation marks, e.g.
SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Foo.exe\debugger="C:\Temp\ShowArgs.exe"
Now ShowArgs.exe acts as the debugger for Foo.exe and is called instead. The first argument is the path to Foo.exe, all other arguments are the ones you are interested in.

Related

Is it possible to suppress MessageBox when running a specific command?

I'm using Tortoise SVN, and TortoisePlink for remote ssh connections.
From time to time TortoisePlink is displaying errors like:
---------------------------
TortoisePlink Fatal Error
---------------------------
Network error: Software caused connection abort
---------------------------
OK
---------------------------
And they appears as messagebox and needs to be clicked by end-user.
I have tried to suppress messagebox by using -batch from command line, but problem still can be reproduced. For me it's sufficient if I'll disable messagebox prompting and print for example in command line same information - since my batch will retry later on again automatically.
Does there exists such software which can override default windows behavior and print in console window whatever is displayed in message box.
I guess in simplest terms such command line tool can be easily created, using for example
http://www.codeproject.com/Articles/44326/MinHook-The-Minimalistic-x-x-API-Hooking-Libra
and override MessageBoxA / MessageBoxW - but have anyone done this kind of thing ?
I think you're going about this the wrong way. Instead of trying to suppress the dialog boxes that TortoisePlink is showing, use the original Plink. TortoisePlink is a fork of Plink to explicitly show message boxes and not print anything on a command line, because it's designed for an UI app and not for console apps.
And if you really only want to use svn from a batch file, don't use TortoiseSVN but the original svn command line client (can be installed with the TSVN installer as well) and use the 'svn' command from the command line.
TortoisePLink.exe is targetted for end-user - so it's intended to display message boxes, however - there also exists a command line version of PLink.exe, and it can be downloaded from here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Please notice that "TortoiseSVN" > "Settings" > "Network" > "SSH Client" should use TortoisePLink.exe - errors will be displayed to end-user.
For following file however -
%appdata%\Subversion\
file ‘config’:
In section [tunnels]
Add line like this:
ssh = Plink.exe -l <your login> -pw <password>
You should use command line version of PLink.exe (that is also displaying command prompt when launched).
It's easier to save PLink.exe next with TortoisePLink.exe, that is into
C:\Program Files\TortoiseSVN\bin.
I have tried to make a command line tool for supressing messageboxes, but it's useless for TortoisePLink.exe (Haven't debugged what is the problem), but in case if you're interested (Have other means to use it):
https://sourceforge.net/p/diagnostic/svn/HEAD/tree/Tools/msgboxSupress/
msSupress.cpp is compiled into .dll and it uses minimalistic hook for windows to disable MessageBoxA and MessageBoxW - actually they will be printed to console or redirected to file.
msSupressExe.cpp is compiled into .exe and it starts process in suspended mode, replaces .exe's entry point with EB FE (jump short into itself), waits until that address is reached, injects .dll and .dll will hook new process.
I have tested only on 64-bit platform - I suspect that command being executed must match same platform as as msSupress.exe.
So typically TortoisePlink.exe will display messagebox - but when executed like this:
mbSupress.exe "C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe"
Same stuff as shown over message box will be displayed in console.
I think this solution is good prototype for further virus or trojan construction - using technique like this will allow to intercept even keyboard presses on any application - but I now made a command line utility, not a virus.

system function works on R and does not work on rstudio/shiny

I'm running ubuntu, and when I use R command line interface the system function works:
system("./script.sh")
But when I do the same on rstudio, I have the messages:
./script.sh: line 3: program: command not found
the program on line 3 is on my path and works fine from command line, do I have to set some environment variable on rstudio/shiny?
Check Sys.getenv('PATH') and if necessary Sys.setenv('PATH') or you could use the full path.
Remember that Shiny apps will have a path relative to where they are launched.
Addition
Since your running Ubuntu you could also try setting the path in ~/.Renviron or /etc/R/Renviron

Compile with long argument list (exceed 128 character) in MS-DOS

I am maintaining hardware monitor program, which will be executed in 16-bit MS-DOS.
I use dosbox with TurboC(tcc.exe) as build environment
While the dos command line can't accept command exceed 128 characters (Ref) ,
but I have a long argument list like this:
tcc.exe -ID:\tc\include -LD:\tc\lib -o MyProgram.exe MyProgram.cpp A.obj B.obj C.obj .........
So I can't build the code successfully. Anyone has idea to overcome this situation? Thanks.
Check your compiler documentation. Many compilers allow parameters to be placed into a text file and the name of the text file given as a command line parameter.
For example, if "compiler_options.txt" hold commands than the following may be how to pass the file:
tcc.exe #compiler_options.txt
Read the documentation to find out if the capability is supported and the correct command line syntax.
Have you tried setting the value to it's maximum in the CONFIG.SYS file:
shell=c:\windows\command.com /u:250 /p

How do I run GDB, enter text into the command line AND see how the executable treats those entries?

How do you run GDB while allowing interactive entry of characters from the command line while simultaneosuly "printing" the values of the variables arising from the parsed characters from those entries?
In other words how do I run gdb, enter text into the command line AND see how the executable treats those entries?
Also is there any difference in the behavior of gdb if I run it from within Emacs with M-x gdb? Suspending the executable with C-c C-c and then trying to print variable values does not behave like I expected. It did not seem to recognize valid variable values from the suspended executable being debugged. I did generate a "debuggable" excutable from Clang with -ggdb -O0 flags.
I also tried to link gdb to the pid of the program executable running in a separate terminal but still am having difficulty with it. The program needs to parse command line entries interactively; I cannot pass them as initial command line arguments.
I hope I made my question clear.
After you started M-x gdb enter M-x gdb-many-windows . This opens new windows in your frame which show the stack, breakpoints, locals, your code and I/O of your program, meaning if you type there the input will be given to your executable.

starting program via command line arguments

I'm trying to start a program via the command line. I am working out of section 8.5: Command Line Arguments in C++ for Everyone. I built the program in netbeans.
How do I start the program from the command line? I am not sure where to find the program. I was expecting to find an .exe in the Documents\NetBeansProjects folder that I could run with the arguments, but I could not find one.
I am on windows 7.
Thanks!
**Where does Netbeans output the C++ executable?
(in addition, I may or may not be able to figure out how to run it once I find it. ~never used cmd line before)
Alternatively, you can press [Win]+R and type/select cmd. For me, that's the fastest way.
There probably is some terminal under your OS. Try typing the full path of the executable in it.
To get a terminal, select start --> run --> enter cmd and press OK.
If "explorer" is still part of Windows 7, use that to search for the file. You can (or used to be able to run) explorer by pressing and holding the Windows key and then pressing the e key. From there, you can cd to the appropriate directory and enter the file name on the command line.