473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

enhanced gdbinit file - looking for Python+Emacs+gdb users


I got a little carried away with the gdbinit file that lives in the Python
distribution at Misc/gdbinit today. I decided there's no particular reason
that gdb shouldn't display the current Python file when moving up and down
the C stack any time it encounters PyEval_EvalFrame. After a little digging
I realized this would be pretty easy. I made two changes to the gdbinit
file:

1. I wrote a lineno command for gdb that calculates and prints the
current Python line number. (It's PyCode_Addr2Line written in gdb's
command language.)

2. Using that and the current file gleaned from PyEval_EvalFrame I emit
the file:line info in the correct format for Emacs to display the
Python line number at the right time using overridden up and down
commands.

There's one slight hitch. It works perfectly when travelling up the C stack
using the up command, however in my environment at least (MacOSX w/ Apple's
gcc and gdb) it causes gdb to segfault when travelling down the stack. I
can't see anything that would make the behavior different going up instead
of down. I need some people to try this thing out to see if it barfs for
them as well. Maybe it's just something peculiar to my environment. OTOH,
perhaps it's a bug in gdb.

Since I can't really check this beast in given its current rather dicey
behavior, I dropped a copy at

http://www.musi-cal.com/~skip/python/gdbinit

If you use Python with gdb via Emacs please give it a whirl and let me know
how it works for you.

Thanks,

Skip

P.S. I think I know how to make the gdb print command print Python objects
as well...
Jul 18 '05 #1
0 1639

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tuxtrax | last post by:
Hi all My editor of choice on linux for python, bar none, is xemacs. I love the python mode that detects a python file and handles indentation and coloration for me automagically. I have been...
49
IDE
by: Thomas Lindgaard | last post by:
Hello I am probably going to start a war now... but so be it :) I just want to hear what all you guys who eat pythons for breakfast use for python coding. Currently I use Kate, but I would...
81
by: julio | last post by:
Sorry but there is no another way, c# .net and mono are going to rip python, not because python is a bad lenguage, but because is to darn old and it refuses to innovate things, to fix wrong things,...
39
by: Jack | last post by:
I wonder what everybody uses for Python editor/IDE on Linux? I use PyScripter on Windows, which is very good. Not sure if there's something handy like that on Linux. I need to do some development...
331
by: Xah Lee | last post by:
http://xahlee.org/emacs/modernization.html ] The Modernization of Emacs ---------------------------------------- THE PROBLEM Emacs is a great editor. It is perhaps the most powerful and...
40
by: kimiraikkonen | last post by:
Hi, For experienced with Pyhton users, which developing software and enviroment would you suggest for Pyhton programming? Compiler+Editor +Debugger. Also what are your suggestions for beginners...
2
by: xahlee | last post by:
In this week i wrote a emacs program and tutorial that does archiving a website for offline reading. (See http://xahlee.org/emacs/make_download_copy.html ) In the process, i ran into a problem...
15
by: skip | last post by:
If you're an Emacs user who has used both python-mode.el (the python mode code distributed with Python and XEmacs) and python.el (the python mode code distributed with GNU Emacs), I'd like to get...
0
by: Malte Helmert | last post by:
skip@pobox.com wrote: One of the two modes (if memory serves, python.el) has an annoying bug/feature where indent-region is essentially implemented as "hit tab once on every line in the region"....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.