<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 22/08/2013 15:20, m. allan noah
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAKO8m0CB91+X9b0ryMxwhv46pOZ7b9Zf4K8+hNq6Um4UP9enng@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>We have a debugging library which is part of sane-backends.
          It allows you to set an environment variable, and which causes
          the backend to print messages to STDERR. If your backend is
          part of sane-backends, you can use this library. If you
          backend is outside of sane-backends, you can certainly setup
          something similar in your backend. You should not have to
          recompile the frontend.<br>
          <br>
        </div>
        allan<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Thu, Aug 22, 2013 at 6:46 AM, <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:YiHao@rst.ricoh.com" target="_blank">YiHao@rst.ricoh.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
            Dear Sir or Madam:<br>
            <br>
            I want to know,<br>
            How can I debug the sane-backend by frontend(e.g.
            scanimage),<br>
            <br>
            How to enter the backend's breakpoint,<br>
            Do I need to compile the frontend if I want to know  whether
            the backend<br>
            receives the Frontend command.<br>
            <br>
            <br>
            <br>
            <br>
            <br>
            Can you give me some advise, Thank you.<br>
            Best Regard<br>
            <br>
            Yours Sincerely, Yihao<br>
            <span class="HOEnZb"><font color="#888888"><br>
                <br>
                --<br>
                sane-devel mailing list: <a moz-do-not-send="true"
                  href="mailto:sane-devel@lists.alioth.debian.org">sane-devel@lists.alioth.debian.org</a><br>
                <a moz-do-not-send="true"
href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel"
                  target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel</a><br>
                Unsubscribe: Send mail with subject "unsubscribe
                your_password"<br>
                             to <a moz-do-not-send="true"
                  href="mailto:sane-devel-request@lists.alioth.debian.org">sane-devel-request@lists.alioth.debian.org</a><br>
              </font></span></blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        "The truth is an offense, but not a sin"
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
        Hello,<br>
    <br>
        you may also consider compiling with debug option, by default
    the -O2 option ins SANE build system will optimize out many
    information. When debugging I add the -ggdb option to configure to
    be able to step into code with gdb:<br>
    CFLAGS="-ggdb" ./configure \<br>
    --prefix=/usr \<br>
    --sysconfdir=/etc \<br>
    --libdir=/usr/lib64 \<br>
    --enable-parport-directio \<br>
    --enable-pnm-backend \<br>
    --enable-libusb_1_0 \<br>
    --enable-pthread \<br>
    --enable-locking \<br>
    --with-group=scanner \<br>
    --without-snmp<br>
    <br>
    Then you can debug your backend even used through a frontend like
    xsane with:<br>
    <br>
    gdb /usr/bin/xsane<br>
    <br>
    Then you can set breakpoint, gdb will warned if function aren't
    resolved yet, but it will work here a sample session for the genesys
    backend:<br>
    <br>
    (gdb) b genesys_sane_start<br>
    Function "genesys_sane_start" not defined.<br>
    Make breakpoint pending on future shared library load? (y or [n]) y<br>
    Breakpoint 3 (genesys_sane_start) pending.<br>
    (gdb) r<br>
    Starting program: /usr/bin/xsane <br>
    warning: Could not load shared library symbols for linux-vdso.so.1.<br>
    Do you need "set solib-search-path" or "set sysroot"?<br>
    Traceback (most recent call last):<br>
      File
    "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.3600.4-gdb.py",
    l<br>
    ine 9, in <module><br>
        from gobject import register<br>
      File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in
    <module><br>
        import gdb.backtrace<br>
    ImportError: No module named backtrace<br>
    [Thread debugging using libthread_db enabled]<br>
    Using host libthread_db library "/lib64/libthread_db.so.1".<br>
    [New Thread 0x7fffeb5cb700 (LWP 2593)]<br>
    <br>
    Breakpoint 2, sane_start (h=0x7a43a0) at genesys-s.c:48<br>
    <br>
    Regards,<br>
        Stef<br>
    <br>
    <br>
    <br>
  </body>
</html>