Problem on debug with VS2010 …

Sysprogs forums Forums VisualGDB Problem on debug with VS2010 …

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #664
    Anonymous
    Participant

    Hi,

    I use VisualGDB Trial version (the last one) with VS2010. I have created one project “Linux Project Wizard” to development an application on remote Embedded system that use Linux version 2.6.39+ with ARM AT91SAM9625 plus 256 Mbytes.

    #### First Test ####

    During wizard I have selected “Build the project under Linux over network” to compile and debug application on remote machine with “SSH”. The project is on Windows machine and all file are uploaded, compiled and debugged on remote machine. The C source of “Hello World” is compiled without problem :

    
    Build:
    VisualGDB: Attempting inline build...
    VisualGDB: Updated source file list in C:ARMvisualgdbhelloworldMakefile. Enable verbose mode for more details.
    VisualGDB: Sending 6 updated source files to build machine...
    VisualGDB: Executing prebuild actions
    VisualGDB: Run "make CONFIG=Debug" in directory "/tmp/VisualGDB/c/ARM/visualgdb/helloworld" on root@192.168.1.199 (SSH)
    mkdir Debug
    gcc -ggdb -ffunction-sections -O0   -DDEBUG  -c helloworld.c -o Debug/helloworld.o -MD -MF Debug/helloworld.dep
    g++ -o Debug/helloworld -Wl,-gc-sections    -Wl,--start-group Debug/helloworld.o   -Wl,--rpath='$ORIGIN'   -Wl,--end-group
    VisualGDB: Executing postbuild actions
    
    Compilation complete.
    

    Now I start a debug on remote machine with “Debug -> Start Debugging With GDB”, the GDB replay with:

    
    GDB Command Timeout
    
    The following GDB command is taking too long to complete: info symbol 0xFFFFFFFFFFFFFF90
    

    This is a code of Raw GDB output :

    
    Your VisualGDB trial expires in 30 days!
    gdb --interpreter mi --args "/tmp/VisualGDB/c/ARM/visualgdb/helloworld/Debug/helloworld"
    ~"GNU gdb (GDB) 7.0.1-debiann"
    ~"Copyright (C) 2009 Free Software Foundation, Inc.n"
    ~"License GPLv3+: GNU GPL version 3 or later n"
    ~"This is free software: you are free to change and redistribute it.n"
    -list-features
    ~"There is NO WARRANTY, to the extent permitted by law. Type "show copying"n"
    ~"and "show warranty" for details.n"
    ~"This GDB was configured as "arm-linux-gnueabi".n"
    ~"For bug reporting instructions, please see:n"
    ~"...n"
    ~"Reading symbols from /tmp/VisualGDB/c/ARM/visualgdb/helloworld/Debug/helloworld..."
    ~"done.n"
    ^done,features=["frozen-varobjs","pending-breakpoints","thread-info","python"]
    -gdb-set stop-on-solib-events 1
    ^done
    -data-list-register-names
    ^error,msg="No registers."
    -gdb-set disassembly-flavor intel
    ^error,msg="No symbol "disassembly" in current context."
    -gdb-set print demangle off
    ^done
    -gdb-version
    ~"GNU gdb (GDB) 7.0.1-debiann"
    ~"Copyright (C) 2009 Free Software Foundation, Inc.n"
    ~"License GPLv3+: GNU GPL version 3 or later n"
    ~"This is free software: you are free to change and redistribute it.n"
    ~"There is NO WARRANTY, to the extent permitted by law. Type "show copying"n"
    ~"and "show warranty" for details.n"
    ~"This GDB was configured as "arm-linux-gnueabi".n"
    ~"For bug reporting instructions, please see:n"
    ~".n"
    ^done
    -break-insert -f main
    ^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000847c",func="main",file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="5",times="0",original-location="main"}
    -inferior-tty-set /dev/pts/1
    ^done
    -exec-run
    =thread-group-created,id="1305"
    =thread-created,id="1",group-id="1305"
    ^running
    *running,thread-id="all"
    =library-loaded,id="/lib/ld-linux.so.3",target-name="/lib/ld-linux.so.3",host-name="/lib/ld-linux.so.3",symbols-loaded="0"
    ~"Stopped due to shared library eventn"
    *stopped,thread-id="1",stopped-threads="all"
    info shared
    &"info sharedn"
    ~"From To Syms Read Shared Object Libraryn"
    ~"0x400007e0 0x40018a40 Yes /lib/ld-linux.so.3n"
    ^done
    -break-list
    ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000847c",func="main",file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="5",times="0",original-location="main"}]}
    -exec-continue
    ^running
    *running,thread-id="1"
    =library-loaded,id="/usr/lib/libstdc++.so.6",target-name="/usr/lib/libstdc++.so.6",host-name="/usr/lib/libstdc++.so.6",symbols-loaded="0"
    =library-loaded,id="/lib/libm.so.6",target-name="/lib/libm.so.6",host-name="/lib/libm.so.6",symbols-loaded="0"
    =library-loaded,id="/lib/libgcc_s.so.1",target-name="/lib/libgcc_s.so.1",host-name="/lib/libgcc_s.so.1",symbols-loaded="0"
    =library-loaded,id="/lib/libc.so.6",target-name="/lib/libc.so.6",host-name="/lib/libc.so.6",symbols-loaded="0"
    ~"Stopped due to shared library eventn"
    *stopped,thread-id="1",stopped-threads="all"
    -break-list
    ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000847c",func="main",file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="5",times="0",original-location="main"}]}
    info shared
    &"info sharedn"
    ~"From To Syms Read Shared Object Libraryn"
    ~"0x400007e0 0x40018a40 Yes /lib/ld-linux.so.3n"
    -exec-continue
    &"Quitn"
    ^error,msg="Quit"
    ^running
    *running,thread-id="1"
    *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0000847c",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbefff7e4"}],file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="5"},thread-id="1",stopped-threads="all"
    -stack-list-frames --thread 1
    ^done,stack=[frame={level="0",addr="0x0000847c",func="main",file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="5"}]
    -break-delete 1
    ^done
    -stack-list-arguments --thread 1 0
    ^done,stack-args=[frame={level="0",args=[name="argc",name="argv"]}]
    -thread-info
    ^done,threads=[{id="1",target-id="process 1305",frame={level="0",addr="0x0000847c",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbefff7e4"}],file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="5"},state="stopped"}],current-thread-id="1"
    -data-evaluate-expression "sizeof(void *)"
    ^done,value="4"
    -data-evaluate-expression "sizeof(int)"
    ^done,value="4"
    -data-evaluate-expression "sizeof(short)"
    ^done,value="2"
    -data-evaluate-expression "sizeof(long)"
    ^done,value="4"
    -data-evaluate-expression "sizeof(long long)"
    ^done,value="8"
    -data-evaluate-expression "sizeof(char)"
    ^done,value="1"
    -data-evaluate-expression "sizeof(wchar_t)"
    ^error,msg="No symbol "wchar_t" in current context."
    -data-evaluate-expression "sizeof(float)"
    ^done,value="4"
    -data-evaluate-expression "sizeof(double)"
    ^done,value="8"
    -data-evaluate-expression "sizeof(long double)"
    ^done,value="8"
    -var-create --frame 0 --thread 1 - * "0"
    ^done,name="var1",numchild="0",value="0",type="int",has_more="0"
    info symbol 0x0
    &"info symbol 0x0n"
    ~"No symbol matches 0x0.n"
    ^done
    info line *0x0
    &"info line *0x0n"
    ~"No line number information available.n"
    ^done
    -data-read-memory-bytes 0xffffffffffffff98 312
    ^error,msg="Undefined MI command: data-read-memory-bytes"
    -data-read-memory 0xffffffffffffff98 x 1 1 312
    ^error,msg="Unable to read memory."
    info symbol 0xffffffffffffff98
    &"info symbol 0xffffffffffffff98n"
    ~"No symbol matches 0xffffffffffffff98.n"
    ^done
    info line *0xffffffffffffff98
    &"info line *0xffffffffffffff98n"
    ~"No line number information available for address 0xffffff98n"
    ^done
    info symbol 0xffffffffffffff98
    &"info symbol 0xffffffffffffff98n"
    ~"No symbol matches 0xffffffffffffff98.n"
    ^done
    info line *0xffffffffffffff98
    &"info line *0xffffffffffffff98n"
    ~"No line number information available for address 0xffffff98n"
    ^done
    -var-create --frame 0 --thread 1 - * "0"
    ^done,name="var2",numchild="0",value="0",type="int",has_more="0"
    info symbol 0x0
    &"info symbol 0x0n"
    ~"No symbol matches 0x0.n"
    ^done
    info line *0x0
    &"info line *0x0n"
    ~"No line number information available.n"
    ^done
    -data-read-memory 0xffffffffffffff90 x 1 1 336
    ^error,msg="Unable to read memory."
    info symbol 0xffffffffffffff90
    &"info symbol 0xffffffffffffff90n"
    ~"No symbol matches 0xffffffffffffff90.n"
    ^done
    info line *0xffffffffffffff90
    &"info line *0xffffffffffffff90n"
    ~"No line number information available for address 0xffffff90n"
    ^done
    info symbol 0xffffffffffffff90
    &"info symbol 0xffffffffffffff90n"
    ~"No symbol matches 0xffffffffffffff90.n"
    ^done
    info line *0xffffffffffffff90
    &"info line *0xffffffffffffff90n"
    ~"No line number information available for address 0xffffff90n"
    ^done
    -var-create --frame 0 --thread 1 - * "0x00000000"
    ^done,name="var3",numchild="0",value="0",type="int",has_more="0"
    info symbol 0x0
    &"info symbol 0x0n"
    ~"No symbol matches 0x0.n"
    ^done
    info line *0x0
    &"info line *0x0n"
    ~"No line number information available.n"
    ^done
    -data-read-memory 0xffffffffffffff98 x 1 1 312
    ^error,msg="Unable to read memory."
    info symbol 0xffffffffffffff98
    &"info symbol 0xffffffffffffff98n"
    ~"No symbol matches 0xffffffffffffff98.n"
    ^done
    info line *0xffffffffffffff98
    &"info line *0xffffffffffffff98n"
    ~"No line number information available for address 0xffffff98n"
    ^done
    info symbol 0xffffffffffffff98
    &"info symbol 0xffffffffffffff98n"
    ~"No symbol matches 0xffffffffffffff98.n"
    ^done
    info line *0xffffffffffffff98
    &"info line *0xffffffffffffff98n"
    ~"No line number information available for address 0xffffff98n"
    ^done
    -var-create --frame 0 --thread 1 - * "0x00000000"
    ^done,name="var4",numchild="0",value="0",type="int",has_more="0"
    info symbol 0x0
    &"info symbol 0x0n"
    ~"No symbol matches 0x0.n"
    ^done
    info line *0x0
    &"info line *0x0n"
    ~"No line number information available.n"
    ^done
    -data-read-memory 0xffffffffffffff90 x 1 1 336
    ^error,msg="Unable to read memory."
    info symbol 0xffffffffffffff90
    &"info symbol 0xffffffffffffff90n"
    ~"No symbol matches 0xffffffffffffff90.n"
    ^done
    info line *0xffffffffffffff90
    &"info line *0xffffffffffffff90n"
    ~"No line number information available for address 0xffffff90n"
    ^done
    info symbol 0xffffffffffffff90
    &"info symbol 0xffffffffffffff90n"
    ~"No symbol matches 0xffffffffffffff90.n"
    ^done
    info line *0xffffffffffffff90
    &"info line *0xffffffffffffff90n"
    ~"No line number information available for address 0xffffff90n"
    ^done
    -data-read-memory 0xffffffffffffff90 x 1 1 8
    ^error,msg="Unable to read memory."
    info symbol 0xffffffffffffff90
    &"info symbol 0xffffffffffffff90n"
    info line *0xffffffffffffff90
    &"Quitn"
    ^error,msg="Quit"
    &"info line *0xffffffffffffff90n"
    ~"No line number information available for address 0xffffff90n"
    ^done
    info symbol 0xffffffffffffff90
    &"info symbol 0xffffffffffffff90n"
    ~"No symbol matches 0xffffffffffffff90.n"
    ^done
    info line *0xffffffffffffff90
    &"info line *0xffffffffffffff90n"
    ~"No line number information available for address 0xffffff90n"
    ^done
    -data-read-memory 0xd0 x 1 1 16
    ^error,msg="Unable to read memory."
    info symbol 0xd0
    &"info symbol 0xd0n"
    ~"No symbol matches 0xd0.n"
    ^done
    info line *0xd0
    &"info line *0xd0n"
    ~"No line number information available for address 0xd0n"
    ^done
    info symbol 0xd0
    &"info symbol 0xd0n"
    ~"No symbol matches 0xd0.n"
    ^done
    info line *0xd0
    &"info line *0xd0n"
    ~"No line number information available for address 0xd0n"
    ^done

    If I use “Abort Command” debug follow step step and and it seems to work but how disable “GDB Command Timeout” ?

    
    -stack-list-frames --thread 1
    ^done,stack=[frame={level="0",addr="0x000084c0",func="main",file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="8"}]
    -stack-select-frame 0
    ^done
    -exec-next
    ^running
    *running,thread-id="all"
    *stopped,reason="end-stepping-range",frame={addr="0x000084c4",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbefff7e4"}],file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="9"},thread-id="1",stopped-threads="all"
    -stack-list-frames --thread 1
    ^done,stack=[frame={level="0",addr="0x000084c4",func="main",file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="9"}]
    -stack-list-arguments --thread 1 0
    ^done,stack-args=[frame={level="0",args=[name="argc",name="argv"]}]
    -thread-info
    ^done,threads=[{id="1",target-id="process 1438",frame={level="0",addr="0x000084c4",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbefff7e4"}],file="helloworld.c",fullname="/tmp/VisualGDB/c/ARM/visualgdb/helloworld/helloworld.c",line="9"},state="stopped"}],current-thread-id="1"
    -var-create --frame 0 --thread 1 - * "�ઓ䂤ᇾ"
    ^error,msg="mi_cmd_var_create: unable to create variable object"
    -var-create --frame 0 --thread 1 - * "�ઓ䃬ᇾ"
    ^error,msg="mi_cmd_var_create: unable to create variable object"
    -var-create --frame 0 --thread 1 - * "�ઓ䂤ᇾ"
    ^error,msg="mi_cmd_var_create: unable to create variable object"
    -var-create --frame 0 --thread 1 - * "�ઓ䃬ᇾ"
    ^error,msg="mi_cmd_var_create: unable to create variable object"
    

    #### Second Test ####

    During wizard I have selected “Build the project locally with cross-compiler” to compile the application on local machine and debug on remote machine. The C source of “custom code” (on helloworld example the problem is not present 🙄 )is compiled without problem. Start a debug on remote machine with “Debug -> Start Debugging With GDB”, everything works perfectly, but after stop the debug with classic “blue square” and restart the debugger I obtain one error :

    Warning. The gdbserver has exited with code1. Do you want to abort debugging ?

    If I check the process on remote machine (ps -A):

    2115 ? 00:00:00 gdbserver
    2118 ? 00:00:00 custom

    The “gdbserver” already running from previous session, the new session does not start. After kill the “gdbserver [2115]” process I can start new debug session.

    Are there solutions ?

    debugasm

    #2701
    ket
    Participant

    Hi,

    For the first issue, if you have a disassembly window open, then close it. That usually makes gdb query those strange hex symbols. There is no way to stop the “GDB Command Timeout” window from appearing as it only appears if there are problems with commands taking too long. The window will close automatically if the command manages to complete, if not then it provides the user a way to abort the command or even stop debugging. If the window would not appear, then in the case of commands never completing, debugging will hang indefinitely with no info on why.

    As for the second issue, normally when you stop debugging as the gdb exits (gdb command -gdb-exit) the gdbserver is also killed. If it happens all the time, it can be specific to your Linux, gdb or gdbserver version that it is not killed. You can add an action to kill the gdbserver manually to either pre or post GDB actions (Custom debug steps page in VisualGDB Project Properties). You can also try killing gdb by setting the stop debugging action differently (bottom of GDB Settings page in VisualGDB Project Properties). Also, you switch to using a custom gdb stub from Debug settings (“start gdb in the following mode”) to specify additional gdbserver settings.

    #2706
    Anonymous
    Participant

    Hi,

    For the first issue, if you have a disassembly window open, then close it. That usually makes gdb query those strange hex symbols. There is no way to stop the “GDB Command Timeout” window from appearing as it only appears if there are problems with commands taking too long. The window will close automatically if the command manages to complete, if not then it provides the user a way to abort the command or even stop debugging. If the window would not appear, then in the case of commands never completing, debugging will hang indefinitely with no info on why.

    I do not have “disassembly window” open but I have “Memory” display open, I do some other test disabling everything.

    … You can add an action to kill the gdbserver manually to either pre or post GDB actions (Custom debug steps page in VisualGDB Project Properties). You can also try killing gdb by setting the stop debugging action differently (bottom of GDB Settings page in VisualGDB Project Properties). Also, you switch to using a custom gdb stub from Debug settings (“start gdb in the following mode”) to specify additional gdbserver settings.

    Thanks for info, I’ll try as you suggested.

    Thanks very much.

    debugasm

    #2702
    Anonymous
    Participant

    Hi,

    I have made some others test but without good results. I have disabled all debug windows but problem remain (#### First Test ####) :

    On my remote machine gdbserver is :

    
    GNU gdbserver (GDB) 7.0.1-debian
    Copyright (C) 2009 Free Software Foundation, Inc.
    gdbserver is free software, covered by the GNU General Public License.
    This gdbserver was configured as "arm-linux-gnueabi"
    

    I start the debug sessione with “Start Debugging With GDB” :

    To continue I need to press to “Abort Command” :

    And debug start without problem “F10” and “F11” work.

    For others test on #### Second Test #### :

    I added the custom command before starting the debugging session :

    I start the debugger but generate one error :

    And the log is empty, how to see what the problem is ?

    Why the rapid button is grayed ?

    Thanks very much for your help.

    debugasm

    #2703
    ket
    Participant

    Hi,

    First of all, try updating your gdbserver, the 2009 year version is probably a bit old. If your gdb is as old, try updating that as well.

    The problem with the predebug command can be the working directory, try clearing that field. The GDB log is not shown as debugging did not even start GDB. Look in the Output window for the predebug command outputs. Change the filter to show VisualGDB Launcher output. The debug app startup button is grayed as it is only used for Android app projects, it is a special debug option allowing to connect gdb gracefully while pausing the Java code execution.

    #2704
    Anonymous
    Participant

    Hi,

    First of all, try updating your gdbserver, the 2009 year version is probably a bit old. If your gdb is as old, try updating that as well.

    I will try to update it 🙄 …

    The problem with the predebug command can be the working directory, try clearing that field.

    I have clearing that field but the problem remainig :

    
    VisualGDB: Executing predebug actions
    VisualGDB: Run "killall --quiet gdbserver" in directory "" on root@192.168.1.199 (SSH)
    
    Command exited with code 1
    Executable: killall
    Arguments: --quiet gdbserver
    Directory:
    VisualGDB: Error: Command-line action failed
    

    Any other ideas ?

    The debug app startup button is grayed as it is only used for Android app projects, it is a special debug option allowing to connect gdb gracefully while pausing the Java code execution.

    I thought it was also used for C / C++ code.

    Thanks very much.

    debugasm

    #2705
    ket
    Participant

    Hi,

    The gdbserver is probably not running when you try to kill it, the –quiet flag hides all errors, so that is why no informative error message is shown. Try making a short script and running it instead, make it always return 0, no matter whether killing the gdbserver failed or not.

    The usual F5 start debugging button works for all projects, so that is why the usual “Start Debugging With GDB” button is not duplicated in the VisualGDB toolbar. The special Android debugging button uses the same icon, but is named differently.

    #2707
    Anonymous
    Participant

    Hi ket,

    I have updated “gdb” to latest version :

    
    GNU gdb (GDB) 7.6
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later 
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "armv5tejl-unknown-linux-gnueabi".
    For bug reporting instructions, please see:
    .

    Now all working very very well :mrgreen:

    Your tool is really fantastic … compliments.

    Thanks very much.

    debugasm

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.