bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting breakpoints on dlopen


From: Adam Bottchen
Subject: Setting breakpoints on dlopen
Date: Thu, 24 May 2001 10:16:25 -0500

        I am running into a problem when attempting to set a breakpoint on
dlopen within gdb under Red Hat 7.1.  This problem doesn't happen at any other
level of the Red Hat distribution, only the 7.1 version.  
        The initial problem was found when running gdb on a perl script that
used C extensions.  The code was:

-----
#!/usr/bin/perl
#  Name: testperl
# Description:  Short Perl program using only a Perl to C extension that  is
#   shipped with Perl.
use Socket;
my $iaddr = gethostbyname("localhost");
my $host = gethostbyaddr($iaddr, AF_INET);
print "host is: $host \n";
print "Hello, testing Perl\n";
exit 0;                                                                      
-----

I then run gdb on that script:

-----
address@hidden /root]# gdb /usr/bin/perl
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) break dlopen
Breakpoint 1 at 0x8059878
(gdb) run testperl
Starting program: /usr/bin/perl testperl
Error in re-setting breakpoint 1:
Cannot access memory at address 0x123
Error in re-setting breakpoint 1:
Cannot access memory at address 0x123
Error in re-setting breakpoint 1:
Cannot access memory at address 0x123
Error in re-setting breakpoint 1:
Cannot access memory at address 0x123
Error in re-setting breakpoint 1:
Cannot access memory at address 0x123
Error in re-setting breakpoint 1:
Cannot access memory at address 0x123
Error in re-setting breakpoint 1:
Cannot access memory at address 0x123
host is: aixlab
Hello, testing Perl
 
Program exited normally.
(gdb)  
-----

The breakpoint is skipped and memory access errors are displayed.  This doesn't
happen under Red Hat 7.0 or 6.2.  This same problem will occur even when perl
is removed from the picture, using the c code below:

-----
#include <dlfcn.h>
 
main()
{
dlopen("libpthread",0);
} 
-----

Compiling with "gcc -o test test.c -ldl", the gdb output is the same when the
breakpoint is set on dlopen.  What is causing this?
Under Red Hat 7.1, gcc is at level 2.96-81 and gdb is 5.0rh-5.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]