- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- What types of bugs do you encounter most often?
- What types of bugs do you find most difficult to locate and fix?
- What methods do you use to accomplish this?
- Which debuggers do you tend to use (and why)?
- Which debuggers do you prefer to use (and why)?
- Which debugger features do you find yourself using most often?
- Which new debugger features would you consider to be essential?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It would be nice if the executable could be debugged if it were in a different directory from where it was built. My build-system compiles a number of executables and moves them into a 'bin' directory.
Why? Because I then run the programs (often as they are in a path) on data files with long command lines with various options.
That brings up another wish. I have shell scripts et al running the calculations---they often insert a number of command lines options. I would love it if I could change
"myproram -blah blah blah blah" to "intel_debug myprogram blah blah blah'
and have everything work. I.e. have it be just as easy as /bin/time
What I really need is extremely reliable and precise compiled-in checking (as in -C). Unfortunately not all -C options are working yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mmquan,
The debugger isnt (and shouldnt be) the only debugging tool in a programmers toolbox. But it is useful in many cases. For example, in the scenario you mentioned, the Intel Debugger gives you the ability to specify things like:
when quiet at 200 { printf "At line 200 the value of x is 0x%x, of i is %d ", x, i }
In this way you can selectively output the variables of interest at the points of interest. If you do basically the same in whichever debugger youre using for Java, then youll have something of interest to compare.
Mbkennel,
The Intel Debugger has three mechanisms for specifying the location of corresponding source files. The -I option, the use command and the map source directory command (documented here, here and here). These features are designed to enable you to do exactly what youre describing.
In regard to modifying your script to run your program under debugger control, I cant currently offer you exactly what youre looking for (although that would be nice Ill submit a corresponding feature request). However, I can come close in two different ways.
1. You can say:
idb program-name <<$EOD
run arg1 arg2 arg3
$EOD
2. You can also create a .dbxinit initialization file in the directory from which you run the program. In that file, specify the run command immediately followed by the arguments to your program (on the same line as above). Then, when you do idb program-name, the debugger will automatically run the program with the specified arguments and prompt you when its done (or when it encounters a problem).
There are probably other ways as well, but hopefully this will get you started (and keep you moving).
Peace,
-- G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mmquan,
The debugger isnt (and shouldnt be) the only debugging tool in a programmers toolbox. But it is useful in many cases. For example, in the scenario you mentioned, the Intel Debugger gives you the ability to specify things like:
when quiet at 200 { printf "At line 200 the value of x is 0x%x, of i is %d ", x, i }
In this way you can selectively output the variables of interest at the points of interest. If you do basically the same in whichever debugger youre using for Java, then youll have something of interest to compare.
Mbkennel,
The Intel Debugger has three mechanisms for specifying the location of corresponding source files. The -I option, the use command and the map source directory command (documented here, here and here). These features are designed to enable you to do exactly what youre describing.
In regard to modifying your script to run your program under debugger control, I cant currently offer you exactly what youre looking for (although that would be nice Ill submit a corresponding feature request). However, I can come close in two different ways.
1. You can say:
idb program-name <<$EOD
run arg1 arg2 arg3
$EOD
2. You can also create a .dbxinit initialization file in the directory from which you run the program. In that file, specify the run command immediately followed by the arguments to your program (on the same line as above). Then, when you do idb program-name, the debugger will automatically run the program with the specified arguments and prompt you when its done (or when it encounters a problem).
There are probably other ways as well, but hopefully this will get you started (and keep you moving).
Peace,
-- G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use debuggers mostly when I encounter signals (segmentation fault, etc.) and floating point exceptions (mainly overflow and invalid operation). A debugger is nice because it tells you which line of your source code causes the signal or exception.
So, it would be nice if you can change the IEEE floating point mode from within the debugger. The default IEEE mode
is to continue even when overflow or invalid operation occurs.
Oh, and I don't like a debugger which requires source files. I used to use gcc (g++) and gdb (GNU debugger). With gcc, you compile your source code with the -g option, and then the source code is embedded in the executable. So, you don't need to carry around the source files or to tell the debugger their locations. This is important because my source files are scattered (I use my own little libraries).
By the way, I envied my wife, who were using Visual Basic. Not that I liked the language, but that the debugger was fabulous. When an error occurs, the line of the source code is highlighted, and when you bring your mouse pointer on a variable name, its value is shown in a baloon! Compared to that, what I'm doing (use the write statement to print the value of variables to debug) is by far more inefficient.
I haven't touched the Intel debugger, but what is it or will it be such a graphical debugger?
Ryo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
However, especially with numerical computations, the executable is called in the middle of a sequence of commands orchestrated by a shell or perl script, and often have many command line options for the program.
As i said before it would be very nice to be able to very simply add a "idb -- " or something before the normal command line in the script (minimal intervention) and have it Just Work.
maybe -ginclude-source as an additional option, to keep the source code along with the executable would be nice?
Also in numerical computation it may be frequent for the executable to run on different machines than the build machines (e.g. cluster situations) and require debugging there and not on its original build environment. Again, it's much more convenient if the source were automatically included.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think it is important to have a debugger which not only debugs but also helps optimize your code. My main experience with debugging/optimizing multithread openmp code has been on an Origin series machine from SGI (so no intel compilers!). Here I used SpeedShop which for each thread produces time sampled output (you can set it to find cache misses, page faults etc.). Analysis of this output allows you to track not only where in your code any bottlenecks are but what is causing the bottleneck (for my code generally having to reload from cache). You can then alter your code if necessary to improve performance. I would strongly encourage any debugging software Intel develop to have such an ability (if you don't have it already). For most applications debugging is not sufficient but optimizing is. Indeed I have two books for parallel programming. One on OpenMP and one three times as large on how to optimize code.
Martin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MB,
Regarding the location of the sources, the debug information in the executable does contain a reference to the original location of the sources (either absolute or relative depending on compiler options). In addition, the Intel Debugger "use" list and "map source directory" list both act as true PATH style search lists and apply to any and all processes in a multi-process application. This will work exactly as you need it to (including the clustered application case).
However, I'll submit a feature request on your behalf thatsomething like -ginclude-source be considered as an option for a future release.
Regarding the ability to simply precede your command line with "idb" to invoke the debugger, please comment on how the work-arounds I previously suggested fall short of your goals. Do they not work for you at all? Do they work but prove to be too inconvenient to use on a regular basis? We'd like to know so that we can improve on this for you.
Thanks.
-- Gordon
Martin,
Intel produces several Software Development Products that help you to tune your application to run optimally on Intel platforms. Just to name a few, there are:
-
The Intel Compilers that provide High Level Optimization assistance with reports, command line options, pragmas, Inter-procedural Optimizations, Profile Guided Optimizations and more (including OpenMP)
-
High performance libraries for primitive and mathematical operations
-
VTune Performance Analyzer
-
Intel Threading Tools: Thread Checker and Thread Profiler
-
Intel Cluster Tools: Trace Collector and Trace Analyzer
I believe that you'll find references to a wealth of such tools and related support services on the Intel Software Development Products web pages.
Please let me know if you have any specific questions about any of these tools.
Thanks.
-- Gordon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First of all to answer your questions in the past I have mainly just used a text editor and print statements to debug code but now I am trying to transition to using gdb or idb to make things more efficient. There are still places where outputting a whole bunch of stuff to a text file and reviewing it later makes sense. In the past some of the most difficult to trace errors occured in a mixed fortran/c++ environment when variables didn't transfer correctly between the fortran and C++ code.
Presently I am very adept at working with Emacs and using print statements to debug but I am looking into options to find a GUI IDE that supports Fortran 77/90 and runs on Linux. Any suggestions would be welcome.
I do have a major issue right now that I could use some help with. I have a numerical modeling code that is segfaulting on my system after 2 days or so of running. Is there anyway to use idb to see what is happening at that point and where it is crashing. I'm not sure how to set a breakpoint for an issue like this. This has been a very stubborn bug that I now think is related to disk IO since the same simulation runs fine on machines at another location and here it runs fine if I disable all but one of the outputs.
thanks,
- dharhas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
when quiet at 200 { printf "At line 200 the value of x is 0x%x, of i is %d ", x, i }
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page