Anna, greetings --

On Mon, Dec 17, 2012 at 10:37 AM, Anna Pavlova
<funny.sweet.naug...@gmail.com> wrote:
> Unfortunately I'm not very good in gdb :-(
>
> anna@anna:~/OpenSC/src/tools$ export LD_LIBRARY_PATH=`ls ../*/.libs -d | tr 
> '\012' :`
> anna@anna:~/OpenSC/src/tools$ cd .libs/
> anna@anna:~/OpenSC/src/tools/.
> libs$ gdb 'pkcs11-tool --module /home/anna/PKCS11_Project/libPkcs11.so'
>
> the last command returns:
> pkcs11-tool --module /home/anna/PKCS11_Project/libPkcs11.so: No such file or 
> directory.
>
> Of course, when I run only:
> anna@anna:~/OpenSC/src/tools/.libs$ gdb pkcs11-tool
>
> that one runs and I can run in debug mode, but I'm afraid that then I'm not 
> loading my module.
>
> Do you know how can I run gdb and also use my own library? Sorry, I'm not 
> really used to work with gdb :-(

What should work is:

1. start gdb with just the executable name:

$ gdb pkcs11-tool

2. Use the "run" command to start your program with the desired arguments.

(gdb) run --module /home/anna/PKCS11_Project/libPkcs11.so

More info: 
http://sourceware.org/gdb/current/onlinedocs/gdb/Starting.html#Starting

Example:

$ gdb /bin/echo
GNU gdb (GDB) Fedora (7.4.50.20120120-52.fc17)
Copyright (C) 2012 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 "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/echo...(no debugging symbols found)...done.
Missing separate debuginfos, use: debuginfo-install coreutils-8.15-8.fc17.x86_64
(gdb) run foo bar baz
Starting program: /usr/bin/echo foo bar baz
foo bar baz
[Inferior 1 (process 9980) exited normally]
(gdb)

Hope this helps.

Best regards,
Anthony Foiani
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to