Getting IntelliJ to show all errors of an Ant build - ant

How can I display all of the errors from an Ant build? I'd like to see those 21 other errors.

I'd suggest trying to Toggle tree/text mode - on the left hand side of the Messages window

The stack trace describes only one error, and the ... 21 more string indicates 21 other methods that were the original call hierarchy.
IDEs will usually suppress the base caller information because it will not be specific to the error, such as the framework/tool internal calls.
To see the entire stack trace, either adjust your IDE settings, or run ant on the command line, where the entire stack trace will be printed.

Related

Upgrading to Dart2 gives me silent errors

I have a fairly involved 1.0 dart app I'm trying to upgrade along with another programmer, and we keep being stumped by silent errors.
Just in time compilations fail with no information other than just "Build Failed". Running build_runner in verbose mode shows that there is an AssetNotFoundException in dartdevc.module itself, but no actaul useful errors (such as what asset in particular can't be found).
Is there any way I can get actually useful information out of this?
You can try running the build with --verbose to get more details and a stack trace. If there are cases with error messages that are not effectively pointing to the problem you can file an issue at https://github.com/dart-lang/build/issues - ideally with a reproduction case. If your project is open source and we can access the repo we should be able to use it as a reproduction case to check.

How to locate the origin of "Invalid floating point" exception without the debugger?

My system runs for hours without issues.
Suddenly it throws the invalid floating point exception.
It does not happen:
- While running in the debugger
- In all computers
How can I determine where the exception is thrown, without the debugger?
I use Delphi 6.
By combination of logging and exception tracing.
That would mean your system would have to be deployed with debug information. Does not seem a problem for you but sometimes is a problem for box software.
There are a lot of tools to do it, but maybe not all are Delphi-6 compatible still. To name a few:
Delphi obtain stack trace after exception
How can I obtain a stack trace without using third party components?
Display the call stack in a Delphi Win32 application
http://blog.synopse.info/post/2011/04/14/Enhanced-logging-in-SynCommons
So you would have to change default exception handler (in TApplication, ExceptProc or whatever - those tools in their sources would show you how to do it) and log floating point exceptions (you would hardly be interested in ALL the possible exceptions now).
This brings another question: a logging framework. Some libs above are already having it, some would need an extra library. You would already need it now and you would need it even more later.
Which logging library is better?
Good, free Delphi logging framework
https://mikejustin.wordpress.com/2012/09/12/delphi-and-free-pascal-logging-with-the-log4d-open-source-library/
Now you run your service for a while and it keeps saving all FP-related exceptions with their stack traces. IF you compiled it with some optimizations disabled (like "always generate stack frame") it would probably also show some local variables and parameters along the way.
If you re lucky - that would be enough for you to understand how the error happens. But most probably you would see the immediate error condition, but not how they developed from failed initial assumptions.
In that case you would at least have the stack trace (execution path) to the error (or few paths to a few similar errors that you know think being one).
At that point you shift your main effort into logging. Knowing your execution path you can log all the interesting functions parameter and local variables along the execution path and see how those variables get abnormal values before the logged exception (and how values are normal if now exception happens).
You would have to do several iterations, first expanding your search down the call stack, adding more params and vars to log, and maybe including some side-by routines to the logging, that are not directly in the call stack but were called before the exception and were affecting local vars values before the error.

Visual Studio does not allow breakpoints in MVC views

Sometimes Visual Studio does not allow me to set breakpoints in MVC views. This has happened to me scores of times, but it doesn't happen for every view and I don't know why.
When you click on the left-hand bar to place a breakpoint, it places a white circle instead of the normal red circle. The message when you hover over it is "The breakpoint will not currently be hit. The source code is different from the original version." It goes on to describe how to allow breakpoints to be hit, but that produces strange results and I don't want that anyways.
If the error is correct, then I want to run the original source code. I don't know what's going on behind the scenes in VS; I try rebuilding and all that but it doesn't help. I'm running in Debug mode in VS 2012.
This could be caused by many things, but a few items to check which I've helped people with recently:
First step: there must be a PDB file alongside the DLL to enable debugging. (see: What is a PDB file?) Make sure you have the PDB in the executing directory.
Clean to remove all the old DLLs from your bin folders.
Ensure that your application is running a build of your current code (the same version you have in Visual Studio). Don't assume that it is just because you clicked 'build' or 'deploy'. If no changes were detected then things often don't happen. Check the build time of the assembly, or change something and rebuild to see the file size change.
If you're running something web-related, make sure a browser isn't caching code, or IIS isn't holding a long running process.
Kill any running Visual Studio Development Server instances (you can do this from task manager, or more simply from the system tray - they look like an IE logo and when you hover over them they'll tell you which port they run on).
Restart IIS using iisreset from a command prompt.
Check the settings for Debugging in Visual Studio (Tools > Options > Debugging > Symbols) You want to automatically load symbols, and if you're linking other assemblies you need to reference their PDB files here.
So I had this issue this morning and the fix for me was related to razor syntax.
I was setting a variable inside an if statement
#If (my condition)
{
myVar1 = "blah blah blah"
#myVar2 = 1 <== This line here was causing my razor to crap out on render
}
So all of the other things are good things however, improper razor syntax can also cause the breakpoint issue. In this case it was the # symbol on myVar2 inside the code block... Just an FYI
The simplest solution I've found to work around this problem is:
Set a breakpoint in the controller code that is right before the View is called. Then, when that breakpoint is hit, step through (using F10) several times. It will go through _ViewStart.cshtml and maybe another thing or two. But soon it will get to the view.
Once you are in the view, then hitting F5 (continue) will take you to the breakpoint in the view.
Fom the answer nothing worked for me to set a breakpoint in the javascript code.
I moved the javascript code inside to file Scripts\myscript.js and replaced the script block to
<script src="#Url.Content("~/Scripts/myscript.js")"></script>
To add to #kirk-broadhurst answer, (please amend if possible), double check your web.config, specifically the compilation flag under system.web. Even if you are building for debug, if the debug attribute is set to false, you will run into issues debugging Razor.
<system.web>
<compilation debug="true" targetFramework="4.6" />
</system.web>
Make sure that "debug" is set and Voila ... debug is working again:-)
Make sure your Solution configuration set to Debug not on release.
Thanks

Delphi 6 doesn't trigger breakpoints

After installation of Delphi 6 at new working station I issued problem with breakpoints. In debug mode environment doesn't trigger breakpoints like they are not placed at all...
Have you experienced similar situation? I suppose reason is some setting, but I cannot find which one...
TnX in advance!
Nemanja
Yes, this sometimes happens (not only in 6).
Enable all debug information except debug DCU's unless you want to debug the Borland code. (Don't forget to check for compiler switches in the code).
Disable code optimizer.
Rebuild all code.
If you are using DLL's be sure to enable debug code in all projects and set the host application to the right executable.
If that fails.
Be sure that there are blue dots at the code.
Be sure you have the right source file. You can check this by adding an error (for example dghasgsgd) and recompile, if the compiler accepts, this is not the right source file.
Be sure the code is reached (add a SendMessage statement or a message box so you can be sure the statement is reached.).
Restart the compiler. Or even restart the pc.
If that fails.
Take a break. Have a lunch or get something to drink.
Return and show the problem to a coworker. (preferably a programmer too).
I applied all settings that #Gamecat suggested, so you can look at this answer like short addition to previous answer.
I missed only one more to solve my problem. In Tools>Debugger Options I checked Integrated Debugging which alive my breakpoints. When breakpoints started to work, I got error message 'Project _.exe raised exception class EAccessViolation with message 'Access violation at address 4CDEB080 in module 'IDPDX32.DLL'. ' For solving this issue I just unchecked option 'Stop on Delphi Exceptions' in menu Tools>Debugger Options>Language Exceptions.
Now Delphi works fine and don't need to reinstall it.
Reason for loosing my previous configuration that worked fine might be in copying my files from one folder to another (as well as config and other temp files) when paths became wrong and after that I probably deleted old config files and started with settings from beginning...
+1 Tip: If you get this message: [Error] RLINK32: Unsupported 16bit resource in file ....\estands\estandar_StdFormMainFrm.DFM problem is in Text-DFM option. When you right-click on the form in the IDE, is the menu item "Text-DFM" (or maybe called "Text as DFM") checked? If not, do so, save and try to compile.
If somebody knows reason for this behaviour, detailed explanation would be useful. Until now I found this option is for backwards-compatibility to older Delphi-versions.

Why is the executable produced by Delphi 2009 IDE different to that produced on the command line?

I'm producing builds using MSBuild, and build configurations set up in the dproj on the command line. It's slightly disconcerting that the size of the executables thus produced are different (not by much, but still!) to what an IDE build produces. Any ideas why? I would have thought the same compiler is used?
The main power of building from the Delphi command-line compiler is standardization - you explicitly identify the options (on the command line, in the .cfg files, etc), and the compiler follows the options provided exclusively. In contrast, the IDE has many other behaviors that are not clear and explicit - for example, it may search library paths not specified in the Project Options. My guess is that something's happening in the IDE build of which you're not entirely aware - and this is why standardized builds are done from the command line.
To see what IDE is doind, check
Tools | Options | Environment Options | Compiling and Running | Show Command Line
And you can check the compiler messages.
The first answer on using the command line for build consistency is right on and it is probably something you needn't worry about if you are relying on a build system where production files are always sourced from the console builds.
On the other hand, if you really do want to figure out what is going on you should turn on map files (at the full detail level) and compare/diff them. If there are differences between the two they will show up there. Any other differences that may exist are likely a result of a commmand line option being different (such as a conditional flag that may be set in the IDE settings).
This behavior has existed in every version of Delphi I've used. (5 - 2006). I wouldn't worry to much about it. When I first discovered it I spent a lot of time trying to resolve the difference. Did I miss a compiler flag? Is there a discrepancy between the IDE and the command line compiler's supported options?
In the end I decided it wasn't that big of an issue. Both consistently produced functionally equivalent executables.
If you supply exactly the same params to the command line compiler the produced executables will virtually be identical.
In fact the IDE just calls the commandline compiler. Compile your project in the IDE and look at the messages window. you will see the full dcc32.exe call ...

Resources