This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 81889 - *Gdb-lite* java.lang.IllegalArgumentException on Windows
Summary: *Gdb-lite* java.lang.IllegalArgumentException on Windows
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-04 00:30 UTC by Nikolay Molchanov
Modified: 2007-09-06 18:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay Molchanov 2006-08-04 00:30:59 UTC
I updated Cygwin, and a part of update was upgrade gdb to 6.5:
C:\tmp>gdb -version
GNU gdb 6.5.50.20060706-cvs (cygwin-special)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin".

Since then I have exceptions when debugging hits a breakpoint:
==============================================================
java.lang.IllegalArgumentException: Parameter file was not normalized. Was
\cygdrive\c\tmp\nikm\tmp_Projects\MP1\mp.cc instead of
C:\cygdrive\c\tmp\nikm\tmp_Projects\MP1\mp.cc
	at org.openide.filesystems.FileUtil.toFileObject(FileUtil.java:410)
	at
org.netbeans.modules.cnd.debugger.gdb.EditorContextBridge.showSource(EditorContextBridge.java:64)
[catch] at
org.netbeans.modules.cnd.debugger.gdb.CurrentThreadAnnotationListener$1.run(CurrentThreadAnnotationListener.java:144)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Here is a part of the log file (from Debugger Console window):
==============================================================
*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x00401313",func="main",args=[{name="argc",value="2"},{name="argv",value="0x6c2780"}],file="mp.cc",fullname="/cygdrive/c/tmp/nikm/tmp_Projects/MP1/mp.cc",line="36"}
(gdb) 
-stack-list-frames
^done,stack=[frame={level="0",addr="0x00401313",func="main",file="mp.cc",fullname="/cygdrive/c/tmp/nikm/tmp_Projects/MP1/mp.cc",line="36"}]
(gdb) 

The root of the problem is that gdb-lite does not expect this fullname:
/cygdrive/c/tmp/nikm/tmp_Projects/MP1/mp.cc
Comment 1 Nikolay Molchanov 2006-08-04 01:16:24 UTC
I implemented a temporary fix in GdbProxyVL.java, method reportStackUpdate()
The suggested fix is to replace "/cygdrive/c/" with "c:/" in message,
received from gdb. 

The fix is integrated in cnd-nb50-dev branch.

Tag: cnd-nb50-dev
User: NikMolchanov
Date: 2006/08/03 16:52:48

Modified:
   cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbProxyVL.java

Log:
 IZ 81889 *Gdb-lite* java.lang.IllegalArgumentException on Windows
 - implemented temporary fix (replace "/cygdrive/c/" with "c:/")

File Changes:

Directory: /cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/
==============================================================

File [changed]: GdbProxyVL.java
Url:
http://cnd.netbeans.org/source/browse/cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbProxyVL.java?r1=1.1.2.17&r2=1.1.2.18
Delta lines:  +10 -1
--------------------
--- GdbProxyVL.java	24 Jul 2006 07:33:20 -0000	1.1.2.17
+++ GdbProxyVL.java	3 Aug 2006 23:52:45 -0000	1.1.2.18
@@ -158,7 +158,16 @@
      *               Example:
number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00401075",func="main",file="src/args.c",line="5",times="0"
      */
     public void reportStackUpdate(String info) {
-        gdbProxy.gdbSupport.stackUpdate(createListFromString(info));
+        String s = info;
+        int i = s.indexOf("\",fullname=\"/cygdrive/"); //NOI18N
+        if (i >= 0) {
+            // IZ 81889 replace "/cygdrive/c/" with "c:/"
+            if (s.length() > (i+23)) {
+                s = info.substring(0, i+11); // i+12 points to /cygdrive/
+                s = s + info.substring(i+22, i+23) + ":" +
info.substring(i+23);           
+            }
+        }
+        gdbProxy.gdbSupport.stackUpdate(createListFromString(s));
     }
     
     /**