This file is indexed.

/usr/share/doc/libapache2-mod-perl2-dev/examples/code/debug-inline is in libapache2-mod-perl2-dev 2.0.8+httpd24-r1449661-6ubuntu2.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# save this file as .debug and execute this as:
# gdb -command=.debug
# or if you prefer gui
# ddd -command=.debug
#
# NOTE: Adjust the path to the perl executable
# also this perl should be built with debug enabled
file /usr/bin/perl

# If you need to debug with gdb a live script and not a library, you
# are going to have a hard time to set any breakpoint in the C code.
# the workaround is force Inline to compile and load .so, by putting
# all the code in the BEGIN {} block and call Inline->init from there.
#
# you also need to prevent from Inline deleting autogenerated .xs so
# you can step through the C source code, and of course you need to
# add '-g' so .so won't be stripped of debug info
#
# here is a sample perl script that can be used with this gdb script
#
# test.pl
# #-----#
# use strict;
# use warnings;
#
# BEGIN {
#     use Inline Config =>
#         #FORCE_BUILD => 1,
#         CLEAN_AFTER_BUILD => 0;
# 
#     use Inline C => Config =>
#         OPTIMIZE => '-g';
# 
#     use Inline C => <<EOI;
#     void my_bp() {
#         dTHX;
#         Perl_warn(aTHX_ "starting debug\n");
#     }
# EOI
# 
#     Inline->init;
# 
# }
#
# my_bp();

tb main
# NOTE: adjust the name of the script that you run
run test.pl

# when Perl_runops_debug breakpoint is hit Inline will already load
# the autogenerated .so, so we can set the bp in it (that's only if
# you have run 'Inline->init' inside the BEGIN {} block

b S_run_body
continue
b Perl_runops_debug
continue

# here you set your breakpoints
b my_bp
continue