-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python/GDB compatibility issues #1
Comments
Same error on Debian (full output on issue #2, closed in favor of this issue.) |
The lack of I'll investigate this. Thanks both for reporting. |
@cyrus-and I got some clue. Looks like Unfortunately, CentOS 7 (the latest version), and some other mainstream linux distros, use gdb 7.6, or ever older versions. |
@fanbin yes that's the point, thanks. For what concern Python 2.6 unfortunately there are a lot of other things that are not supported. I will fix problems with old GDB versions but still I don't feel like to refactor the code to support Python 2.6, at least for the moment being. |
Actually, overcoming the lack of gdb.COMPLETE_EXPRESSION = gdb.COMPLETE_SYMBOL Unfortunately the A quick fix for that would be adding
Here's a dirty script which should automatize all the grunt work: mkdir -p ~/.gdbinit.d/
wget 'https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/python/lib/gdb/FrameDecorator.py' -O ~/.gdbinit.d/FrameDecorator.py
sed -i '1s/^/python gdb.COMPLETE_EXPRESSION = gdb.COMPLETE_SYMBOL\n/' .gdbinit
cat >>.gdbinit <<EOF
python
import imp
gdb.FrameDecorator = imp.new_module('FrameDecorator')
gdb.FrameDecorator.FrameDecorator = FrameDecorator
end
EOF |
Confirmed the fix works. I also recommend compiling new gdb 7.10 with python 2.7, which are easy and short compiling with |
I compile and install the GDB 7.7 in my CentOS6.5 I'm using python2.6 as the default python in my CentOS6.5, and didn't update any of the package since I got no access to the internet, so I manually compile (using GDB7.7) and install python2.7 and python3.3 into /usr/local, and the default python version is still 2.6 since the a lot of pacakges still need it. How can I use the python2.7 or python3.3 which lie in /usr/local/bin in .gdbinit? |
The Python version used by GDB (and thus by GDB dashboard) is not the default version in your system, it is the one chosen at compilation time. So you have to recompile it with the proper option, e.g.:
You can check the Python version used by GDB before installing with (from the source directory):
|
Thank you, it works. |
using the instructions here i got i got it to work on gdb 7.6, however there's one oddity:
(it's printed literally like that). something seems to be wrong with the code that prints the escape sequence. note that the colors in other parts of the screen work fine, only the prompt is affected. the rev. i use is 7c70149 (current HEAD). |
@rofl0r That's weird indeed, what's the Python version linked with GDB? I have a GDB 7.6 setup linked with Python 2.7 which, apart from the aforementioned Try starting GDB with
This is more or less what GDB dashboard does; you should end up with the magenta ">>>" prompt as in the screenshot. |
it's gdb 7.6.2 linked against python 2.7.10 and libedit as a drop-in replacement for readline (because it's smaller), i suspect that's what makes the difference. |
@rofl0r Yeah, I think that too. You can try to customize the default prompt so to not use escape sequences, for example:
Alternatively just use a static prompt string:
|
i am running gdb 7.7 with python 2.7.4 i am getting error Cannot write the dashboard: 'ascii' codec can't encode characters in position 5-7: ordinal not in range(128) |
@mohit3112 is there any chance that I can reproduce that on my PC? Edit: The latest revision prints additional information, can you please post the entire stacktrace? |
@cyrus-and |
@mohit3112 let's continue the discussion in #50 |
I'm still having the issue with "COMPLETE_EXPRESSION", it seems that it can be ignored - but the wiki has nothing about that in. For reference:
... and when a breakpoint is actually reached:
|
@GitMensch have you tried the workaround described here? |
Workaround works (I've used an older version of the Framefilter). I primarily missed to see that... One note: I think it would be reasonable to not download the most current FrameDecorator.py but instead use the "locked" version from GDB 7.7. |
@GitMensch good point, thanks! I updated the wiki. |
Problem:
I tried to run gdb-dashboard on centos 6/7, but failed on both platforms.
Possible Reason:
It looks like centos 6's gdb uses python 2.6, which does not have subprocess.check_output supported, meanwhile centos 7 fails to work with the error as gdb module " 'module' object has no attribute 'COMPLETE_EXPRESSION' ".
Platform Information:
Centos 6's gdb links to python 2.7.6 and centos 6 links to python 2.6.6.
The text was updated successfully, but these errors were encountered: