gdb skipping lines and halting in static library functions

Herman Radtke hermanr@adventresources.com
Thu Oct 23 22:22:00 GMT 2008


Hello,

I am in need of some help determining why gdb is failing to debug any program
that uses the C-ISAM library.  This problem only appears to be happening with
this library.  I copied libisam.a and isam.h from another server that is not
having any problems with gdb and/or C-ISAM to rule out any corruption.  I was
using the gdb that came with RHEL 3.  I upgraded to 6.8 to see if that would
solve the problem as well.

I noticed this problem started sometime after I started using the -ggdb3 flag,
but I am unsure if that is a causal factor.  Other developers continue to use
this flag and compile against the C-ISAM library (-lisam) without any negative
consequences.

Has anyone seen something like this before?  In my searching on google and
this mailing list I have not found anything similar.  Any help on this issue
would be greatly appreciated.

Thanks,

Herman

*** EXAMPLE 1 - skipping over a chunk of lines

hermanr@advlnx10 ~/jail/gdbtest !! cat test.c
#include <isam.h>

int main()
{
    struct keydesc key;

    key.k_flags = ISNODUPS;
    key.k_nparts = 1;
    key.k_part[0].kp_start = 0;
    key.k_part[0].kp_leng  = 8;
    key.k_part[0].kp_type  = CHARTYPE;

    isbuild( "test", 128, &key, ISOUTPUT+ISEXCLLOCK );

    return 0;
}

hermanr@advlnx10 ~/jail/gdbtest !! gcc -g test.c -I/usr/include -lisam -o test
hermanr@advlnx10 ~/jail/gdbtest !! gdb test
GNU gdb 6.8
Copyright (C) 2008 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 "i686-pc-linux-gnu"...

(gdb) b main
Breakpoint 1 at 0x804a4ac: file test.c, line 7.
(gdb) r
Starting program: /home/hermanr/jail/gdbtest/test

Breakpoint 1, main () at test.c:7
7           key.k_flags = ISNODUPS;
(gdb) n
15          return 0;
(gdb)
16      }
(gdb)
0x006f279a in __libc_start_main () from /lib/tls/libc.so.6
(gdb)
Single stepping until exit from function __libc_start_main,
which has no line number information.

Program exited normally.
(gdb) quit

*** EXAMPLE 2 - stopping in the middle of the libisam function iswrite()

hermanr@advlnx10 ~/jail/gdbtest !! cat test.c
#include <isam.h>

#define RECORD_LEN 128
#define ISAM_FILENAME "test"

int main()
{
    int fd;
    struct keydesc key;
    char record[RECORD_LEN];


    key.k_flags = ISNODUPS;
    key.k_nparts = 1;
    key.k_part[0].kp_start = 0;
    key.k_part[0].kp_leng  = 8;
    key.k_part[0].kp_type  = CHARTYPE;

    fd = isbuild( ISAM_FILENAME, RECORD_LEN, &key, ISOUTPUT+ISEXCLLOCK );

    if( fd < 0 ) {
        printf( "Failed to create ISAM file.  iserrno: %ld\n", iserrno );
        return 1;
    }

    strcpy( record, "This is a test record" );

    if( iswrite( fd, record ) != 0 ) {
        printf( "Failed to open ISAM file.  iserrno: %ld\n", iserrno );
    }

    if( isclose( fd ) != 0 ) {
        printf( "Failed to close ISAM file.  iserrno: %ld\n", iserrno );
        return 1;
    }

    if( iserase( ISAM_FILENAME ) != 0 ) {
        printf( "Failed to erase ISAM file.  iserrno: %ld", iserrno );
    }

    return 0;
}


hermanr@advlnx10 ~/jail/gdbtest !! gcc -g test.c -I/usr/include -lisam -o test
hermanr@advlnx10 ~/jail/gdbtest !! gdb test
GNU gdb 6.8
Copyright (C) 2008 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 "i686-pc-linux-gnu"...
(gdb) b main
Breakpoint 1 at 0x804a4af: file test.c, line 13.
(gdb) r
Starting program: /home/hermanr/jail/gdbtest/test

Breakpoint 1, main () at test.c:13
13          key.k_flags = ISNODUPS;
(gdb) n
26          strcpy( record, "This is a test record" );
(gdb)
28          if( iswrite( fd, record ) != 0 ) {
(gdb)
0x0804dbcf in iswrite ()
(gdb)
Single stepping until exit from function iswrite,
which has no line number information.

Advent Resources, Inc. - celebrating our 20th Anniversary 1988-2008

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the Gdb mailing list