Patch for setting breakpoints in source window

Jeffrey Armstrong <[email protected]>
Newsgroups gmane.comp.debugging.insight
Message-ID <CAONw715PVBxwA=ieuh7=8LEDoLMZQDgV7ggKWf71o90cyjsqcg@mail.gmail.com>
I've been experiencing issues with Insight compiled via MinGW under
Windows where the user cannot set breakpoints via the source window
under certain circumstances.  The culprit appears to be a failure to
wrap the filename in quotes when passing it to gdb.  Normally this
isn't a problem, but when a space is present in the full path name, as
is so common on Windows, the breakpoint fails to be set.  I've
attached a simple patch below that shouldn't have any detrimental side
effects on other OSes.

Index: gdb/gdbtk/library/srctextwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/srctextwin.itb,v
retrieving revision 1.46
diff -u -r1.46 srctextwin.itb
--- gdb/gdbtk/library/srctextwin.itb	9 Nov 2009 19:39:31 -0000	1.46
+++ gdb/gdbtk/library/srctextwin.itb	6 Dec 2011 19:11:58 -0000
@@ -1759,7 +1759,7 @@
       set set_cmd [list gdb_set_bp "*$addr"]
     }
     src {
-      set set_cmd [list gdb_set_bp "$current(filename):$addr"]
+      set set_cmd [list gdb_set_bp "\"$current(filename)\":$addr"]
     }
   }


--
Jeffrey Armstrong
[email protected]
Approximatrix, LLC - http://www.approximatrix.com/
"Solutions for Numerical Computing"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.