[sane-devel] 【Sane Develop】Can you help me
stef.dev at free.fr
Thu Aug 22 19:36:57 UTC 2013
On 22/08/2013 15:20, m. allan noah wrote:
> 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.
> On Thu, Aug 22, 2013 at 6:46 AM, <YiHao at rst.ricoh.com
> <mailto:YiHao at rst.ricoh.com>> wrote:
> Dear Sir or Madam:
> I want to know,
> How can I debug the sane-backend by frontend(e.g. scanimage),
> How to enter the backend's breakpoint,
> Do I need to compile the frontend if I want to know whether the
> receives the Frontend command.
> Can you give me some advise, Thank you.
> Best Regard
> Yours Sincerely, Yihao
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> <mailto:sane-devel at lists.alioth.debian.org>
> Unsubscribe: Send mail with subject "unsubscribe your_password"
> to sane-devel-request at lists.alioth.debian.org
> <mailto:sane-devel-request at lists.alioth.debian.org>
> "The truth is an offense, but not a sin"
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:
CFLAGS="-ggdb" ./configure \
Then you can debug your backend even used through a frontend like xsane
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:
(gdb) b genesys_sane_start
Function "genesys_sane_start" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 3 (genesys_sane_start) pending.
Starting program: /usr/bin/xsane
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Traceback (most recent call last):
ine 9, in <module>
from gobject import register
File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
ImportError: No module named backtrace
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffeb5cb700 (LWP 2593)]
Breakpoint 2, sane_start (h=0x7a43a0) at genesys-s.c:48
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the sane-devel