summaryrefslogtreecommitdiff
path: root/testsuite/ltrace.minor/attach-process-dlopen.exp
diff options
context:
space:
mode:
authorVyacheslav Barinov <v.barinov@samsung.com>2014-08-19 10:32:35 +0400
committerVyacheslav Barinov <v.barinov@samsung.com>2014-08-19 12:00:10 +0400
commitd20fa3bbc49f7e9e8de18b89e7d7480bdb810cb0 (patch)
tree597394261d7acef7d60c9b3d4c63064e8b3e05de /testsuite/ltrace.minor/attach-process-dlopen.exp
parent9611ae3f65fe7e136e8b9d7929ab576584e212f5 (diff)
downloadltrace-d20fa3bbc49f7e9e8de18b89e7d7480bdb810cb0.tar.gz
ltrace-d20fa3bbc49f7e9e8de18b89e7d7480bdb810cb0.tar.bz2
ltrace-d20fa3bbc49f7e9e8de18b89e7d7480bdb810cb0.zip
Imported newest gitsandbox/vbarinov/tizen
Diffstat (limited to 'testsuite/ltrace.minor/attach-process-dlopen.exp')
-rw-r--r--testsuite/ltrace.minor/attach-process-dlopen.exp49
1 files changed, 49 insertions, 0 deletions
diff --git a/testsuite/ltrace.minor/attach-process-dlopen.exp b/testsuite/ltrace.minor/attach-process-dlopen.exp
new file mode 100644
index 0000000..ac61347
--- /dev/null
+++ b/testsuite/ltrace.minor/attach-process-dlopen.exp
@@ -0,0 +1,49 @@
+# This file is part of ltrace.
+# Copyright (C) 2012, 2013 Petr Machata, Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA
+
+set libll [ltraceCompile libll.so [ltraceSource c {
+ #include <unistd.h>
+ void sym(void) {
+ sleep(1);
+ }
+}]]
+
+spawn [ltraceCompile exe -ldl [ltraceSource c {
+ #include <unistd.h>
+ #include <dlfcn.h>
+ #include <assert.h>
+ #include <stdio.h>
+ #include <string.h>
+ int main(int argc, char **argv) {
+ assert(argc == 2);
+ #define FN "libll.so"
+ char buf[strlen(argv[1]) + 1 + sizeof FN];
+ sprintf(buf, "%s/%s", argv[1], FN);
+ void *libll = dlopen(buf, RTLD_LAZY | RTLD_LOCAL);
+ assert(libll != NULL);
+ sleep(1);
+ void (*sym)(void) = dlsym(libll, "sym");
+ assert(sym != NULL);
+ sym();
+ return 0;
+ }
+}]] $objdir/$subdir
+
+ltraceMatch1 [ltraceRun -e* -p [exp_pid]] {libll.so->sleep} == 1
+
+ltraceDone