[Ltrace-devel] [PATCH] Early support for libdl in ltrace

Steve Fink sphink at gmail.com
Thu Sep 17 17:21:12 UTC 2009


I have nothing useful to add other than "cool, thanks!" I really
wanted this a while back, and will doubtless have need of it in the
future.

But now that I took the trouble to write this, I also glanced at the
patch. I didn't actually try to follow any of the complex logic, so
this is just lint:

-#define MAX_LIBRARIES 30
+#define MAX_LIBRARIES (200)
+#define ELF_MAX_SEGMENTS  (50)
+#define ELF_SYMTAB_MAX    (5000)

Why the parens? When would they matter?

-       memset(lte, 0, sizeof(*lte));

Why? (I didn't read the code to know what's going on here, but it just
looks odd.)

--- a/sysdeps/linux-gnu/trace.c
+++ b/sysdeps/linux-gnu/trace.c

Pointless whitespace addition.

What's the connection between dlsym support and the --no-plt flag?

+size_t
+umovebytes(Process *proc, void *src, void *dest, size_t count) {

That seems odd. I thought I had implemented exactly the same thing for
my point and structure displaying patch, that I thought went in a few
years back. I guess I should look through the history. But sure
enough, it's not there now. Maybe I ended up not needing it for some
reason?

Oh, sure enough. I have it lying around as a separate diff, so I must
have split it out. I called mine 'umove', and my code looks a little
simpler, which probably means mine is wrong. It's been too long, so
I'm attaching mine to see if you can make sense of it. I also have an
identical diff in the ia64 directory, so apparently it must've worked
there too. (I was testing on x86 and ia64).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: umove.diff
Type: application/octet-stream
Size: 1502 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/ltrace-devel/attachments/20090917/f5e46f9a/attachment.obj>


More information about the Ltrace-devel mailing list