Skip to content
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

support gdb 7.6.1 #115

Closed
wants to merge 1 commit into from
Closed

support gdb 7.6.1 #115

wants to merge 1 commit into from

Conversation

zhangyafeikimi
Copy link

This works perfectly under my laptop.
gdb and python versions are listed below.

kimi@10.0.2.15:/home/kimi/gdb-8.1$ gdb -v
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
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 "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.

kimi@10.0.2.15:/home/kimi/gdb-8.1$ python
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

@cyrus-and
Copy link
Owner

This has been already discussed in #1, the gdb.COMPLETE_EXPRESSION part was only one part of the problem, the other was the stack module and the lack of gdb.FrameDecorator, which has been included in version 7.7.

How do you address the latter?

@cyrus-and cyrus-and mentioned this pull request Apr 29, 2018
@zhangyafeikimi
Copy link
Author

i will ckeck the frame decorator the report tommorrow. how to reproduce the lack of it?

@cyrus-and
Copy link
Owner

Simply using the Stack module should be enough.

@zhangyafeikimi
Copy link
Author

zhangyafeikimi commented Apr 30, 2018

Nothing wrong with my laptop. And there is FrameDecorator.py.

kimi@10.0.2.15:/usr/share/gdb/python/gdb$ find -name "*.py"
./init.py
./function/caller_is.py
./function/in_scope.py
./function/init.py
./function/strfns.py
./FrameIterator.py
./printing.py
./FrameDecorator.py
./frames.py
./prompt.py
./command/explore.py
./command/type_printers.py
./command/ignore_errors.py
./command/init.py
./command/frame_filters.py
./command/pretty_printers.py
./command/prompt.py
./command/pahole.py
./types.py

My gdb is "GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7".

However, it is strange that official tag of gdb 7.6.1 doesn't have this file.

https://sourceware.org/git/?p=binutils-gdb.git;a=tree;f=gdb/python/lib/gdb;h=e93bb8a7ed299a0aaebc23ea5ea8d4138d19885c;hb=b1ea606ed4ff2ec2085d297fc6fbad090eed38db

And I found this patch added FrameDecorator.py between 7.6.1 and 7.6.2.

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1e611234ee3f4a1d2434f3fe7530cab87c936e0d

@cyrus-and
Copy link
Owner

It's strange indeed and I cannot assume that other distros do the same, I think you could just create a .py file in the ~/.gdbinit.d/ directory with the following line:

gdb.COMPLETE_EXPRESSION = gdb.COMPLETE_SYMBOL

So you don't need to patch .gdbinit.

@cyrus-and cyrus-and closed this Apr 30, 2018
@zhangyafeikimi
Copy link
Author

zhangyafeikimi commented May 1, 2018

This line is harmless for any versions of gdb. And some one may benefit from it.
Why not admit it?

@cyrus-and
Copy link
Owner

As I said, it solves only a part of the problem except for some very specific¹ scenarios, the solution I suggested using a configuration file is IMO enough to fix this for such a minority of cases.


¹ And unclear, because the lowest GDB version that contains the patch you mentioned is 7.7 according to:

git tag --contains  1e611234ee3f4a1d2434f3fe7530cab87c936e0d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants