I would like something similar to bash command line, where we can rescue the last command, and navigate left and right among characters to edit the command before entering it.
Are there ways to edit the last command entered in gdb in AIX systems ? Or at least there are ways to come back some characters to correct it, rather than, delete all them with backspace ?
(I have noticed that dbg line-editing works fine in Linux)
You're using a copy of gdb built without libreadline support. Either go without it or re-build gdb from source w/ libreadline support.
GDB uses the same line-editing library as bash -- GNU readline. The editing you do in bash should work fine in GDB. It does for me.
Related
Before I start...
my tool chain consist of MinGW, ConEmu, and Vim to make C++ programs.
I wanted to test to see if MinGW was working by seeing if g++ was setup correctly on my system PATH, and it turned it was because I successfully compiled a simple console program that outputted the text I provided to standard out. However, I came across this...
When I do the command start test.exe from window's cmd shell in ConEmu (I use the start command because I want it in its own standalone prompt), the text looks like this.
These little white lines are annoying and I would like to know what's causing it...
When I run the standalone from the explorer it looks completely normal.
Is there something in ConEmu's settings that's causing this that anybody is aware of ?
I found a work around. I just end up using the program called cmder. Which is practically ConEmu but with more features built on top of it.
I'm working on a relatively old Centos system where I am restricted in the packages I can install. I needed a newer version of gdb, so I built that successfully from source in my home dir. This gdb steps through my code fine, but I am looking for trouble that is manifesting in the C++ allocator (mt_allocator.cc) and this new version of gdb can't step through that code. I can break successfully on a function there:
break '__gnu_cxx::__pool<true>::_M_initialize()'
but when that breakpoint hits and I try to step through the code, gdb tells me:
Single stepping until exit from function _ZN9__gnu_cxx6__poolILb1EE13_M_initializeEv,
which has no line number information.
I tried using the dir command within gdb to add the path to where mt_allocator.cc is, but that had no effect.
What do I need to tell gdb so it can find those files?
Ah, found it. The Centos package manager put the debug files for the STL code at /usr/lib/debug. So:
set debug-file-directory /usr/lib/debug
within gdb gets it done.
I've been lurking stackoverflow for well over a year now and I've finally ran into a problem that I just can't seem to have any luck with. I'm trying to build a simple proof of concept application that uses libtorrent before I try anything complicated. I can get the examples built just fine using bjam and I can get my own simple application (a clone of simple_client.cpp really) to compile and run just fine using a little hack by modifying the bjam file. But I'd prefer to not be anchored down using bjam, so could anyone lend a hand on getting the examples to compile using the MSVC commandline? I've tried variations of the following command
cl -D _WIN32_WINNT=0x0501 -D TORRENT_WINDOWS=1 /EHsc /I C:\Libs\boost_1_54_0\ torrenter.cpp /I C:\Libs\libtorrent-rasterbar-0.15.6\include\libtorrent /I C:\Libs\libtorrent-rasterbar-0.15.6\include\ /I C:\Libs\libtorrent-rasterbar-0.15.6\zlib /link /LIBPATH:C:\Libs\boost_1_54_0\lib
but I'm met with all kinds of errors like redefined functions and such. I've got a feeling that it has to do with some preprocessor defines that I need to feed into cl but I really have no clue what I need to give it.
I've got boost 1.54.0 installed, libtorrent 0.15.6, and MSVC Express 2012 edition and I'm on window 7 64-bit.
Any help you guys could give would really be appreciated, thanks!
if you invoke bjam with the additional arguments "-an" it will, instead of building, print out all the command lines it's executing. This may be useful. -a means to rebuild all unconditionally, -n means to print out the command lines instead of executing them.
However, given the limited command line length in the windows shell, it's forced to use response files. This means you won't get a full view of the command line without also opening up one of the .rsp files for the bulk of the arguments.
Hi I am using gdb version 7.5. Can someone tell me how I can get the vim keystrokes to work inside the gdb? The up and down arrow keys work for history but I want the k and j to work similar to when I am in a bash shell and have things set as set -o vi from the shell then my vim keystrokes work for command history. I used to have this set up using gdb in a previous linux instance. Currently running ubuntu 13.04.
gdb uses readline. So you just need to put the following command into ~/.inputrc to turn the editing mode to vi.
set editing-mode vi
Note: all programs that use readline will be affected by this setting this includes bash.
Over in this question about ndk-gdb I learned that C-M-j will cause gdb to enter vi mode. I tried that with gdb 7.4.1 and it worked, but I don't know about gdb 7.5. (Note: C-M-j means "Alt-Ctrl-j" for those not used to emacs nomenclature or "Esc Ctrl-j" if you don't have an Alt key.)
We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host.
Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX.
Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps using an SSH shell connection to gdb?
finally I got gdb run remotly anyhow now. At the Bug-symbol on the taskbar I took Debug Configurations - GDB Hardware Debugging.
In Main C/C++ Applications I set the full path on the Samba share of the executable (X:\abin\vlmi9506). I also set a linked folder on X:\abin in the project. Then I modified my batch-script in GDB Setup. It's not directly calling gdb in the plink-session but a unix-shell-script, which opens gdb. By this I have the possibility to set some unix environment-variables for the program before doing debug. The call in my batch:
plink.exe prevoax1 -l suttera -pw XXXXX -i /proj/user/dev/suttera/vl/9506/test/vlmi9506ddd.run 20155 dev o m
In the unix script I started gdb with the command line params from eclipse, that I found in my former tryals. The call in the shell command looks like this:
gdb -nw -i mi -cd=$LVarPathExec $LVarPathExec/vlmi9506
Then IBM just gives gdb 6.0 for AIX. I found version 6.8 in the net at http://www.perzl.org/aix/index.php?n=Main.Gdb. Our Admin installed it.
I can now step through the program and watch variables. I even can write gdb-commands directly in the console-view. yabadabadooooooo
Hope that helps to others as well. Can not tell, what was really the winner-action.
But each answer gives more new questions. Now I got 3 of them.
When I start the debug config I have to click restart in the toolbar to come really in the main procedure. Is it possible to come directly in main without restarting?
On AIX our programs are first preprocessed for embedded sql. The preprocessed c-source is put in another directory. When I duble-click the line to set a breakpoint, I get the warning "unresolved breakpoint" and in the gdb-console I see, that the break is set to the preprocessed source which is wrong. Is it possible to set the breakpoints on the right source?
We are using CICS on AIX. With the xldb-Debugger and the CDCN-command of CICS we manage that debugging is started, when we come in our programs. Is it possible to get that remotely (in plink) with gdb-eclipse as well?
I wouldn't normally take a shot in the dark on a question I can't really test the answer to, but since this one has sat around for a day, I'll give it a shot. It seems from looking at:
http://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_Debugging_with_CDT.3F
...that even if the CDT has changed since that wiki page was made, you should still be able to change the debug command to:
ssh remotehost gdb
instead of using TM which uses gdbserver. This will probably be slightly slower than the TM remote debugging since that actually uses a local gdb, but on the other hand this way you won't have to NFS or SMB mount your source code to make it available to the local debugger (and if you're on a LAN it probably won't matter anyhow).
There's also a reference TCF implementation for linux, which you may or may not have any luck recompiling for AIX, but it allows for remote debugging if gdbserver is otherwise not available:
http://wiki.eclipse.org/DSDP/TM/TCF_FAQ
tried also to remotly debug an aix-appl with windows eclipse-cdt-gdb.
Got blocked at the end with unix/windows path-problems. Maybe my result can help u a little further - maybe you already got it work. I'm interested in your comment. asked on eclipse news portal- following the answer of martin oberhuber (thanks again) tried dsp dd (also blocked with path problem) and set an request in eclipse bugzilla.
here the link to news:
http://www.eclipse.org/newsportal/article.php?id=406&group=eclipse.dsdp.tm
Here my bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=252758
At the moment we still debug localy with xldb but I am trying ddd-gdb at the moment. At least locally gdb is running.