File: DEBUG

package info (click to toggle)
fakeroot 0.4.4-9.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 696 kB
  • ctags: 173
  • sloc: sh: 7,643; ansic: 711; cpp: 312; makefile: 120
file content (45 lines) | stat: -rw-r--r-- 1,847 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
To debug fakeroot, one may try:

Start faked in xterm 1:   
  $ faked --foreground --debug
  51452231:280
     # First number here is the 'FAKEROOTKEY', second is the pid of
     # faked. Both to be used later.
     # Later, when programs go using faked, a _lot_ of debug output
     # will be shown here.

Send signals to faked in xterm 2:
  #Whenever you want to get info about the internal inode data
  #faked is keeping, do:
  kill -SIGUSR1 280

And the  'real' program runs (at your choise) in another xterm [3], or gdb
  In an xterm, do:
    $ LD_PRELOAD=/usr/lib/libtricks/libtricks.so.0
    $ FAKEROOTKEY=51452231   # number output by faked, xterm 1
    $ export LD_PRELOAD FAKEROOTKEY
    $ my-prog          #start anything you like.

  Or, if you want to run the programme in a gdb session:
  To make specifying the paths easier, put libtricks.c, libtricks.so.0.0.1
  and the binary you want to run in the same directory (libtricks.so.0.0.1
  is put in ./.libs/libtricks.so.0.0.1 by libtool during compilation, copy
  it out there).
  Then, in gdb do:
    $ gdb ./ls #as an example, I run 'ls'.
    (gdb) set env LD_PRELOAD=/home/joost/maintain/vpathlib/libtricks-0.1/libtricks.so.0.0.1
    (gdb) set env FAKEROOTKEY=51452231 #number from xterm 1.
     # Or wherever you've got your libtricks.so.0.0.1
    (gdb) break libtricks.c:181
    Breakpoint 1 at 0x4000ecc8: file libtricks.c, line 181.
    (gdb) run -al
    Starting program: /home/joost/maintain/vpathlib/libtricks-0.1/ls -al
    Temporarily disabling shared library breakpoints:
    1
    
    Breakpoint 1, __lxstat (ver=134556187, file_name=0x0, statbuf=0x80529c8)
    	at libtricks.c:208
    208                  struct stat *statbuf){
    
    # OK, and there I've found a bug -- ver can only be '0' in the
    # current libc6 (glibc2). Unfortunately, it didn't reproduce.