This is sort of a followup to this thread--unfortunately I didn't make any progress at the time so I thought I would start over. I am consistently getting this in the debugging log (QtCreator 2.3.1, Qt 4.7.3, gdb 7.2):
A syntax error in expression, near 0'.\n"
295^error,msg="A syntax error in expression, near0'."
&"Python scripting is not supported in this copy of GDB.\n"
296^error,msg="Python scripting is not supported in this copy of GDB."
&"Python scripting is not supported in this copy of GDB.\n"
297^error,msg="Python scripting is not supported in this copy of GDB."
&"Python scripting is not supported in this copy of GDB.\n"
298^error,msg="Python scripting is not supported in this copy of GDB."
&"Undefined command: \"bbsetup\". Try \"help\".\n"
299^error,msg="Undefined command: \"bbsetup\". Try \"help\"."
dThe debugging helper library was not found at .
&"source /home/matt/QtSDK-4.7.3/pythongdb/gdb\n"
&"/home/matt/QtSDK-4.7.3/pythongdb/gdb:1: Error in sourced command file:\n"
&"Undefined command: \"\". Try \"help\".\n"
300^error,msg="/home/matt/QtSDK-4.7.3/pythongdb/gdb:1: Error in sourced command file:\nUndefined command: \"\". Try \"help\"."
&"Undefined command: \"bbsetup\". Try \"help\".\n"
301^error,msg="Undefined command: \"bbsetup\". Try \"help\"."
dThe debugging helper library was not found at .
302^done
<303set substitute-path /var/tmp/qt-src /usr/include
The specific problem is that without the debugging helper, I'm unable to see the contents of QStrings and many other data structures during the debugging process, which makes it much more time-consuming. The error messages above are symptomatic, the problem arises when gdb can't find the debugging helper.
Anyway, looking at the discussion referenced in the answer in the above thread, I hunted around for different versions of gdb on my system but each one of them produced the same error (with the path changed appropriately of course), including version 7.3.1 when I downloaded it. I've also located libDebuggingHelper.so, but sticking it in different places hasn't helped either. Lastly looking at ./configure --help for gdb, I didn't see any options for enabling/disabling python in the build. Anybody know how I can get this to work?
This site claims you need to configure GDB using
./configure --with-python
It's pretty clear from the error message that the GDB you built does not have python support compiled in.
In gdb/config.log look for messages like checking whether to use python and see why GDB decided to not use Python on your system.
Perhaps you need to install Python development packages?
Once you've configured GDB to use Python, an easy way to check whether Python support is properly compiled in is:
(gdb) python print "hello"
If that prints anything other than hello, you are still not where you want to be.
I solved the problem with
sudo apt-get install gdb-multiarch
Thanks to #Employed-Russian for allowing me to check if GDB indeed has python support.
I did have to use the syntax
(gdb) python print("Hello")
To get a proper response from python within GDB.
Related
I've been trying to install LuaJIT on Windows 10 for some time following the official guide, and I actually get to install it. For example, if I execute luajit I get into the prompt. Also, luajit -v returns the version of luajit (2.0.4). And I can also execute code with luajit -e <lua code>. However, whenever I try to save bytecode with luajit -b, I get the following message:
luajit: unknown luaJIT command or jit.* modules not installed
I tried to make all sort of installations: using Cygwin, luajit-rocks, MinGW, ... However, no matter what I try, I always get the same result, and I have no clue of what to do.
Could you point me to some potential problems I might be overlooking?
I have on my system Lua 5.1 and Luarocks.
Some extra LuaJIT features are implemented as separate Lua modules (e.g. jit.bcsave for bytecode saving), and LuaJIT depends on package.path to find those modules. The suggested install location for those modules is in the default package.path, but if you override it via the LUA_PATH environment variable, you have to make sure to include that location there. One easy way to do that is to put two consecutive semicolons into LUA_PATH: Double semicolons are replaced by the compile-time default value of package.path.
You need place modules to "jit" folder near with juajit.exe. That folder include some system modules (bcsave too). package.path can dont work, becouse it hardlinked, how i understand. That folders distributed with source code.
Download lua from official sice: https://luajit.org/download.html
You can see "jit" folder inside archive:
LuaJIT-2.0.5.zip\LuaJIT-2.0.5\src\jit\
I'm trying to execute my Ruby file that just prints out a string of text: this is literally the file:
puts "System Initialized"
but I keep getting an error every time I try it.
When I execute it, it looks like this:
My-Mac-mini:event_manager my_name$ ruby lib\event_manager.rb
The error message is as follows:
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
Referenced from: /Users/crystalchoi/.rvm/rubies/ruby-2.1.3/bin/ruby
Reason: image not found
Trace/BPT trap: 5
I'm pretty new to using a Mac when it comes to programming, and I'm following a tutorial to do this, so I'm not sure what I'm doing wrong.
If anyone can help me decipher this error message and let me know how to correct it or can point me in the right direction, I would be very grateful.
ruby lib\event_manager.rb
Mac OS, like other *nix-based systems, uses / to separate the path components of files. Only Windows uses \. Instead use:
ruby lib/event_manager.rb
A Ruby tutorial isn't going to help a whole lot unless you understand the *nix command-line so you can move around and execute things, so I'd STRONGLY suggest you learn a lot more about how *nix works. Having developed on Linux for years, I have had to use my command-line knowledge just as much as my programming-language skills daily.
Does the specified library (/usr/local/lib/libgmp.10.dylib) exist?
I just checked and I could not find it at all.
GMP (libgmp) is an optional dependency of ruby. When you installed ruby, it was configured to use GMP, but you don't have the library file (/usr/local/lib/libgmp.10.dylib)
That's OK, you can get GMP ( The GNU Multiple Precision Arithmetic Library) from homebrew.
brew update
brew install gmp
You may need to re-install ruby afterward.
See https://superuser.com/questions/820364/ruby-installation-issues-with-rvm where other people had the same problem.
Advanced
If you're compiling ruby the old school way (./configure && make) then you could try using the --without-gmp config. option.
See https://bugs.ruby-lang.org/issues/8796
I am a beginning programmer trying to install the Python Protocol Buffers from this package: http://code.google.com/p/protobuf/downloads/detail?name=protobuf-2.4.1.zip
The readme states:
1) Make sure you have Python 2.4 or newer. If in doubt, run:
$ python -V
2) If you do not have setuptools installed, note that it will be
downloaded and installed automatically as soon as you run setup.py.
If you would rather install it manually, you may do so by following
the instructions on this page:
http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions
3) Build the C++ code, or install a binary distribution of protoc. If
you install a binary distribution, make sure that it is the same
version as this package. If in doubt, run:
$ protoc --version
4) Run the tests:
$ python setup.py test
If some tests fail, this library may not work correctly on your
system. Continue at your own risk.
Please note that there is a known problem with some versions of
Python on Cygwin which causes the tests to fail after printing the
error: "sem_init: Resource temporarily unavailable". This appears
to be a bug either in Cygwin or in Python:
http://www.cygwin.com/ml/cygwin/2005-07/msg01378.html
We do not know if or when it might me fixed. We also do not know
how likely it is that this bug will affect users in practice.
5) Install:
$ python setup.py install
This step may require superuser privileges.
NOTE: To use C++ implementation, you need to install C++ protobuf runtime
library of the same version and export the environment variable before this
step. See the "C++ Implementation" section below for more details.
I have added both python and version 2.4.1 of protoc.exe into my PATH. However, when I try to run the test, I get an error message that says there's invalid syntax on line 38:
print "Can't find required file " + source
Okay, so it's missing parenthesis. I add them, and it encounters two more print statement syntax error messages. I fix those, and it encounters a syntax error message on an 'except' statement. What am I doing wrong?
Thanks.
Perhaps you are using Python 3?
The code you refer to will only work in Python 2.X
I have followed same steps , but I didn't get any errors.
Please make sure that you are getting correct Python and protoc version.
Export the environment LD_LIBRARY_PATH variable.
I have a project which requires opencl. I have installed CUDA and openCL on my machine but when I 'make' my project the following error occurs:
CL/cl.h: No such file or directory
I know that the i can create a hard link (in my unix (ubuntu) system) to fix the problem:
ln -s /usr/include/nvidia-current/CL
But i consider this a quick fix and not the correct solution. I would like to handle this in my makefile (i guess) so that a simple "make" command would compile. How could I do this?
You need to pass an appropriate -I option to the compiler (by setting CPPFLAGS or CFLAGS, for example). -I/usr/include/nvidia-current sounds like it'd work.
I saw this thread from compile opencl program using CL/cl.h file
I installed 7.5 and added below link in /usr/include, it works for my opencl program. looks like CUDA forget to implement this link after the installation.
ln -s /usr/local/cuda-7.5/include/CL /usr/include
Are you using Ubuntu or Debian distro? Then now you can use this package:
sudo apt-get install opencl-headers
I know Emacs has some sort of integration with gdb (though I never used it) to jump through files as you debug a program. I'd like to do the same with Ruby programs.
As erenon said, use ruby debug, which provides a library for emacs that lets you use it just as gdb.
Install rdebug by issuing this command on your terminal(the sudo is optional, depending on your system):
<sudo> gem install ruby-debug
You then need to download the ruby-debug-extra file from rubyforge, and install it in the standard way.
sh ./configure
make
make test # optional, but a good idea
sudo make install
This gives you the elisp files for the interaction with rdebug, plus documentation for ruby-debug that can be viewed from within emacs.
AJ
There is another emacs to ruby-debug interface. See https://github.com/rocky/emacs-dbgr/wiki .
More generally, it works with other ruby debuggers and other debuggers in general.
You may want use rdebug.
I am getting "Cannot open load file: gdb-ui" in GNU Emacs 23.1.50.1 (x86_64-apple-darwin10.0.0, NS apple-appkit-1038.11) of 2009-10-31
I was stuck with same problem with gdb-ui, but I found the solution: I downloaded gdb-ui.el from here and put it into ruby-debug-extra/emacs dir... then I've adjusted Makefiles to point to this file before any other rdebug*.el files. After this step you'll get make working. Since I'm using emacs-snapshot and gdb mode is available already in my emacs environment, this issue is only about to build rdebug mode. After this I've installed it with "sudo make install" and it works perfectly :) Don't forget to add (require 'rdebug) to your ~/.emacs or whatever else you use to bootstrap your config.
The chosen strategy can be made to work, although texi2html and texinfo were not enough on my system, but I stopped pursuing this strategy without installing the extra packages.
Here's what I did: download ruby-debug-extra-0.10.4.tar.gz from http://rubyforge.org/frs/?group_id=1900&release_id=28306, untar it, but DON'T do the whole configure/make/blah/blah thing. Instead, I simply copied the 'emacs' directory to ~/.emacs.d/rdebug, and then added to my ~/.emacs.d/init.el file (you can also use your ~/.emacs file):
(add-to-list 'load-path "~/.emacs.d/rdebug")
(autoload 'rdebug "rdebug" "ruby-debug interface" t)
This won't byte-compile it, I didn't care. I prefer this solution because I got really annoyed that the packages forces you to install the docs.