trouble using gdb

From: stef (stef-listes@wanadoo.fr)
Date: Fri Dec 29 2000 - 06:12:22 PST

  • Next message: rm: "astra 3400"

            Hello,
            I am trying to write a sane backend for my scanner, and I just can't debug
    it with gdb. When I set a breakpoint in my buggy function, the stack seems ok,
    but I can't access local variables. Parameters are available. I forced static
    build of scanimage by adding '-all-static' to libtool in the Makefile.
            Here's a sample of what I get when debugging scanimage:

    Breakpoint 2, sane_get_parameters (h=0x806b568, parms=0xbfff73d4) at dll-s.c:40
    40 return ENTRY(get_parameters) (h, parms);
    (gdb) s
    sane_dll_get_parameters (handle=0x806b568, params=0xbfff73d4) at dll.c:820
    820 DBG(3, "get_parameters(handle=%p,params=%p)\n", handle, params);
    (gdb) n
    821 return (long) (*s->be->op[OP_GET_PARAMS]) (s->handle, params);
    (gdb) s
    sane_umax_pp_get_parameters (handle=0x806b670, params=0xbfff73d4)
        at umax_pp.c:1193
    1193 Umax_PP_Device *dev = handle;
    (gdb) n
    1199 if (strcmp (dev->val[OPT_MODE].s, "Gray") == 0)
    (gdb) p dev
    No symbol "dev" in current context.
    (gdb) bt
    #0 sane_umax_pp_get_parameters (handle=0x806b670, params=0xbfff73d4)
        at umax_pp.c:1199
    #1 0x804d984 in sane_dll_get_parameters (handle=0x806b568, params=0xbfff73d4)
        at dll.c:821
    #2 0x804cb7e in sane_get_parameters (h=0x806b568, parms=0xbfff73d4)
        at dll-s.c:40
    #3 0x804abe6 in scan_it () at scanimage.c:1012
    #4 0x804c073 in main (argc=4, argv=0xbffff88c) at scanimage.c:1706
    #5 0x4008a2e7 in __libc_start_main (main=0x804b630 <main>, argc=4,
        argv=0xbffff88c, init=0x8048fb0 <_init>, fini=0x806134c <_fini>,
        rtld_fini=0x40009f00 <_dl_fini>, stack_end=0xbffff884)
        at ../sysdeps/generic/libc-start.c:90
    (gdb) p handle
    $3 = 0x806b670

            I surely missed something, but what ?

    Stef

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Fri Dec 29 2000 - 06:01:48 PST