I'm trying to setup a pending breakpoint for sin() and cos() which are
dlsym()ed from libm.so
(sample attached), and an attempt to continue execution seems just hangs the
debugger. For example:
(lldb) attach 17043
Process 17043 stopped
* thread #1, name = 't-dlopen', stop reason = signal SIGSTOP
frame #0: 0x0000000000400728 t-dlopen`main(argc=1, argv=0x00007ffd2b0a00c8)
at t-dlopen.c:21
18 for (a = 0; a < DELAY + argc; a++)
19 for (b = 0; b < DELAY + argc; b++)
20 for (c = 0; c < DELAY + argc; c++)
-> 21 z += a + b + c;
22 while (1)
23 {
24 void *handle = dlopen (LIBM_SO, RTLD_LAZY);
Executable module set to "/home/dantipov/tmp/t-dlopen".
Architecture set to: x86_64--linux.
(lldb) breakpoint set -n sin
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) breakpoint set -n cos
Breakpoint 2: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) process continue ;; After this, nothing
happens for a long time
Process 17043 resuming
(lldb) process status ;; After this, lldb hangs
and have to be killed
I've tried 6.0.0-rc2 as well as 7.0.0 svn trunk 325127, with the same
disappointing results.
Dmitry
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may
contain
confidential information. Any unauthorized review, use, disclosure or
distribution
is prohibited. If you are not the intended recipient, please contact the
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>
#ifdef __ANDROID__
#define LIBM_SO "libm.so"
#define DELAY 1500
#else
#include <gnu/lib-names.h>
#define DELAY 2000
#endif
int
main (int argc, char *argv[])
{
/* Busy loop long enough to attach the debugger before dlopen happens. */
int a, b, c, z = 0;
for (a = 0; a < DELAY + argc; a++)
for (b = 0; b < DELAY + argc; b++)
for (c = 0; c < DELAY + argc; c++)
z += a + b + c;
while (1)
{
void *handle = dlopen (LIBM_SO, RTLD_LAZY);
if (handle)
{
int i;
double sum = 0.0;
double (*sinptr) (double) = dlsym (handle, "sin");
double (*cosptr) (double) = dlsym (handle, "cos");
for (i = 0; i < 10; i++)
sum += sinptr (drand48 ()) + cosptr (drand48 ());
printf ("%lf\n", sum);
dlclose (handle);
}
sleep (1);
}
return z;
}
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev