| 1 |
To debug fakeroot, one may try:
|
| 2 |
|
| 3 |
Start faked in xterm 1:
|
| 4 |
$ faked --foreground --debug
|
| 5 |
51452231:280
|
| 6 |
# First number here is the 'FAKEROOTKEY', second is the pid of
|
| 7 |
# faked. Both to be used later.
|
| 8 |
# Later, when programs go using faked, a _lot_ of debug output
|
| 9 |
# will be shown here.
|
| 10 |
|
| 11 |
Send signals to faked in xterm 2:
|
| 12 |
#Whenever you want to get info about the internal inode data
|
| 13 |
#faked is keeping, do:
|
| 14 |
kill -s USR1 280
|
| 15 |
|
| 16 |
And the 'real' program runs (at your choise) in another xterm [3], or gdb
|
| 17 |
In an xterm, do:
|
| 18 |
$ LD_PRELOAD=/usr/lib/libtricks/libtricks.so.0
|
| 19 |
$ FAKEROOTKEY=51452231 # number output by faked, xterm 1
|
| 20 |
$ export LD_PRELOAD FAKEROOTKEY
|
| 21 |
$ my-prog #start anything you like.
|
| 22 |
|
| 23 |
Or, if you want to run the programme in a gdb session:
|
| 24 |
To make specifying the paths easier, put libtricks.c, libtricks.so.0.0.1
|
| 25 |
and the binary you want to run in the same directory (libtricks.so.0.0.1
|
| 26 |
is put in ./.libs/libtricks.so.0.0.1 by libtool during compilation, copy
|
| 27 |
it out there).
|
| 28 |
Then, in gdb do:
|
| 29 |
$ gdb ./ls #as an example, I run 'ls'.
|
| 30 |
(gdb) set env LD_PRELOAD=/home/joost/maintain/vpathlib/libtricks-0.1/libtricks.so.0.0.1
|
| 31 |
(gdb) set env FAKEROOTKEY=51452231 #number from xterm 1.
|
| 32 |
# Or wherever you've got your libtricks.so.0.0.1
|
| 33 |
(gdb) break libtricks.c:181
|
| 34 |
Breakpoint 1 at 0x4000ecc8: file libtricks.c, line 181.
|
| 35 |
(gdb) run -al
|
| 36 |
Starting program: /home/joost/maintain/vpathlib/libtricks-0.1/ls -al
|
| 37 |
Temporarily disabling shared library breakpoints:
|
| 38 |
1
|
| 39 |
|
| 40 |
Breakpoint 1, __lxstat (ver=134556187, file_name=0x0, statbuf=0x80529c8)
|
| 41 |
at libtricks.c:208
|
| 42 |
208 struct stat *statbuf){
|
| 43 |
|
| 44 |
# OK, and there I've found a bug -- ver can only be '0' in the
|
| 45 |
# current libc6 (glibc2). Unfortunately, it didn't reproduce.
|