1 # This file is part of ltrace.
2 # Copyright (C) 2012, 2013 Petr Machata, Red Hat Inc.
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 set libll [ltraceCompile libll.so [ltraceSource c {
26 spawn [ltraceCompile exe -ldl [ltraceSource c {
32 int main(int argc, char **argv) {
35 char buf[strlen(argv[1]) + 1 + sizeof FN];
36 sprintf(buf, "%s/%s", argv[1], FN);
37 void *libll = dlopen(buf, RTLD_LAZY | RTLD_LOCAL);
38 assert(libll != NULL);
40 void (*sym)(void) = dlsym(libll, "sym");
47 ltraceMatch1 [ltraceRun -e* -p [exp_pid]] {libll.so->sleep} == 1