tag:blogger.com,1999:blog-3992530807750384868.post6874155435762856893..comments2015-03-19T19:43:11.699+02:00Comments on emacs-fu: fancy debugging with gdbdjcbnoreply@blogger.comBlogger13125tag:blogger.com,1999:blog-3992530807750384868.post-29977089942679187902010-01-30T00:24:36.233+02:002010-01-30T00:24:36.233+02:00some people (notably Linus Torvalds) have suggeste...<i>some people (notably Linus Torvalds) have suggested that debuggers encourage fixing symptoms rather than fully understanding the problem -- e.g., just adding a NULL check to fix a crash rather than understanding why some var was NULL in the first place.</i><br /><br />That&#39;s utterly irrational. Debuggers are tools for finding bugs; they have no bearing on how the bug is fixed. In order to understand why some var was NULL in the first place, you have to first know that the var <b>was</b> NULL -- that that was the cause of the failure. Once you know that, you have a variety of ways to proceed; debuggers are neutral as to which one you pick.<br /><br />Likewise for Dijkstra&#39;s comment ... he didn&#39;t say that debuggers lead to bad programming practices, he just said that programmers should learn to to program properly so debuggers are less needed. Also, language designers should learn how to design languages -- there are designs that make NULL references virtually impossible (by adding a pointer-or-nil type and removing nil from the range of the standard pointers).jqbhttp://www.blogger.com/profile/07510836914645398165noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-29566676767988044932010-01-29T11:25:01.591+02:002010-01-29T11:25:01.591+02:00@Anonymous: Step and other GDB commands are on the...@Anonymous: Step and other GDB commands are on the Emacs toolbar. Window management is indeed a problem. But GDB and GDB in Emacs are free software and many people find them useful. If you don&#39;t, you can choose not to use them or you can choose to improve them. Please don&#39;t simply bad mouth them though. It&#39;s just too easy.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-22150620901576810562010-01-12T13:23:03.817+02:002010-01-12T13:23:03.817+02:00Step commands are available in any window of Emacs...Step commands are available in any window of Emacs GDB UI, not just source.Джусhttp://www.blogger.com/profile/04370067340225708898noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-30443897007426276262010-01-11T20:00:55.249+02:002010-01-11T20:00:55.249+02:00I always laugh when I see this nonsense about debu...I always laugh when I see this nonsense about debuggers creating bad habits. They encourage GOOD habits - the ability to step through your own code and examine the status anywhere any time. In addition, all this academic nonsense about &quot;proving code&quot; is all well and good but in the real world a lot of programmers are working on other peoples code and a debugger is invaluable in stepping through and analyzing the execution paths for different source data in addition to setting HW break points on know data combinations which cause crashes - something that can save days of effort when used competently. Dijkstra or whoever. Unfortunately GDB is a mess. Its a dinosaur with an awful UI and the emacs many windows UI is a kludge on a kludge. None of the step commands are available in the source window which is where you want to be. Focus switching drives you crazy as you struggle to get back to the input gud buffer. Not nice at all.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-8895112810133569152009-08-03T19:25:24.135+03:002009-08-03T19:25:24.135+03:00@Джус: looks very interesting... good luck!@Джус: looks very interesting... good luck!djcbhttp://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-86400195220008019622009-08-03T15:56:00.358+03:002009-08-03T15:56:00.358+03:00Hi there, I&#39;m doing some development for GDB i...Hi there, I&#39;m doing some development for GDB in Emacs as Google Summer of Code project, check out http://emacswiki.org/emacs/GDB-MI/Джусhttp://www.blogger.com/profile/04370067340225708898noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-17001087219517296542009-07-31T19:36:32.559+03:002009-07-31T19:36:32.559+03:00@Abhijith: the color theme is basically the one in...@Abhijith: the color theme is basically the one in http://emacs-fu.blogspot.com/2009/03/color-theming.htmldjcbhttp://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-69415072455614926692009-07-29T19:58:51.872+03:002009-07-29T19:58:51.872+03:00&quot;If you want more effective programmers, you ...&quot;If you want more effective programmers, you will discover that they should not waste their time debugging, they should not introduce the bugs to start with.&quot; --Dijkstra<br /><br />This is true, but misleading in this context. There&#39;s a difference between &quot;debugging&quot; and &quot;debuggers&quot;. The most common use I have for a sophisticated debugger is to step through a working program to see what it&#39;s doing, and how. This is, arguably, not debugging. There&#39;s plenty of use for fancy debugger integration, without flying afoul of Dijkstra.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-58250999225353882932009-07-29T18:41:59.171+03:002009-07-29T18:41:59.171+03:00Can you tell me which color theme that is? Looks n...Can you tell me which color theme that is? Looks nice.Abhijithhttp://www.blogger.com/profile/04274217370278604195noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-84679842511389661042009-03-05T22:02:00.000+02:002009-03-05T22:02:00.000+02:00@Laurent: I once heard Dijkstra say that the world...@Laurent: I once heard Dijkstra say that the world would be a better place if computer programs had to be chiseled in marble.<BR/><BR/>I don't agree with that, do you? Even if you prove your program is correct, maybe there's a bug in your proof or assumptions. Debugging is a necessary skill.Billhttp://www.blogger.com/profile/09202318621724165312noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-42268413105490422532009-02-04T07:21:00.000+02:002009-02-04T07:21:00.000+02:00"If you want more effective programmers, you will ..."If you want more effective programmers, you will discover that they should not waste their time debugging, they should not introduce the bugs to start with."<BR/><BR/>Dijkstra<BR/>http://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340.html<BR/><BR/>"Already now, debugging strikes me as putting the cart before the horse: instead of looking for more elaborate debugging aids, I would rather try to identify and remove the more productive bug-generators!"<BR/><BR/>Dijkstra<BR/>http://www.cs.utexas.edu/users/EWD/transcriptions/EWD03xx/EWD303.htmlLaurent Ogethttp://www.blogger.com/profile/09279119543081152394noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-54768231883942509812009-02-04T07:11:00.000+02:002009-02-04T07:11:00.000+02:00@WalterGR: well, some people (notably Linus Torval...@WalterGR: well, some people (notably Linus Torvalds) have suggested that debuggers encourage fixing symptoms rather than fully understanding the problem -- e.g., just adding a NULL check to fix a crash rather than understanding why some var was NULL in the first place.<BR/><BR/>some academic types might go as far as reminding us that when formally proofing the correctness of your code, no debugger will be needed. <BR/><BR/>there is some truth to that, but it's simply not very practical; even if we hold our own code to such high standards, we still might have to deal with other people's code. then, a debugger might be by far the most efficient way to gain some insight.djcbhttp://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-64185678851888754032009-02-04T06:50:00.000+02:002009-02-04T06:50:00.000+02:00Of course, one could easily dismiss fancy debugger...<I>Of course, one could easily dismiss fancy debuggers as leading to bad programming practices - and there is some truth in that.</I><BR/><BR/>I'm curious what argument one could have for this. "You shouldn't have made the mistake in the first place"?WalterGRnoreply@blogger.com