473,320 Members | 2,111 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,320 software developers and data experts.

Debugging C extensions on Gentoo

I've spent the last couple of hours trying to figure out how to set
breakpoints in Python C extensions under gdb 6.2 using Gentoo Linux,
and finally figured it out. So for posterity (aka Google), here's the
trick:

If GDB is giving you the message "Unable to find dynamic linker
breakpoint function", it's because the ebuild for glibc strips the
dynamic linker which makes it impossible to set breakpoints in shared
libraries. You need to patch the ebuild. Do this:

1. Find the ebuild that emerge is going to use:

$ emerge -p
These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild R ] sys-libs/glibc-2.3.4.20041102-r1
^^^^^^^^^^^^^^^^^^^^^^^
2. Edit the corresponding .ebuild file in /usr/portage/sys-libs/glibc

You need to add one line of code, described by this patch submitted by
Benno Schulenberg (thanks!) on linux.gentoo.user in a thread from
Februrary titled "Mysterious GDB Error" (the line numbers will be
different for your different ebuild version)

--- /usr/portage/sys-libs/glibc/glibc-2.3.4.20050125-r1.ebuild
2005-02-19 21:48:06.000000000 +0100
+++ /usr/local/portage/sys-libs/glibc/glibc-2.3.4.20050125-r1.ebuild
2005-02-24 23:54:34.000000000 +0100
@@ -371,8 +371,10 @@
fi

# now, strip everything but the thread libs #46186
mkdir -p ${T}/thread-backup
mv ${D}$(alt_libdir)/lib{pthread,thread_db}*
${T}/thread-backup/
+ # Also, don't strip the dynamic linker:
+ mv ${D}/$(get_libdir)/ld-* ${T}/thread-backup
if use !nptlonly && want_nptl ; then
mkdir -p ${T}/thread-backup/tls

3. emerge glibc (or "have a beer while you watch compiler messages
scroll by for half an hour")

Jul 19 '05 #1
0 1120

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

Similar topics

4
by: Jesper Olsen | last post by:
Hi, I have a C-extention build with distutils that I would like to debug. How can I specify to distuils to pass option "-g" and not "-O2" along to the compiler (gcc)? Jesper
5
by: jsmilan | last post by:
Hi, all; I'm strictly an amateur developer who has dabbled in a half dozen languages on eight or nine systems over 20 years or so. I have never devoted the time or energy to thoroughly learn...
2
by: Arso - Italy | last post by:
Hi someone have already used eric3 for debugging code running on apache using mod_python ? After the execution of the patch for apache.py, how the debug is activated ? More thanks for any...
0
by: peter | last post by:
Hello all, I would like to debug my python libraries, written in c++, with GDB (gnu debugger) I'm using the mingw compiler in a windows environment. As development environment I use eclipse...
7
by: darktemplaaa | last post by:
Hello! I got IBM DB2 V8.1 successfully installed via rpm on my gentoo system except the DAS and the instance. When I run: /opt/IBM/db2/V8.1/instance/dascrt -u dasusr1 I get following error...
0
by: yurps | last post by:
Hello, I am installing the remote debug components on Windows 2003... This is a production server, and I am only going to be debugging there for a short time before we go live. I put the...
10
by: Christine Desmuke | last post by:
Hello: At the risk of starting a flame-war, I'd like some more details on the use of Gentoo Linux for a production PostgreSQL server. There have been a couple of comments lately that it is not...
23
by: keyser_Soze | last post by:
I have MS Visual Studio 2003 on Windows XP Pro. I have IIS running on this machine and I am trying to debug some existing code which has both ASP and ASP.NET components. When I try and launch...
2
by: Bruno Gonzalez (STenyaK) | last post by:
(first of all, sorry if this is not the correct place to ask, but i couldn't find a better one...) I'm new to debugging using core dumps. I've managed to get core dumps + symbols using g++ and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.