[Ltrace-devel] Getting prototypes from debug information

Dima Kogan lists at dima.secretsauce.net
Wed Apr 23 23:46:43 UTC 2014


Dima Kogan <lists at dima.secretsauce.net> writes:

> OK. My near-term todo list:
>
> - Try to get prototypes from both DWARF and conf files.

I ran some tests, and pushed some new patches to that same tree. Some
joint .conf/DWARF prototyping now works!

I can now prototype a function in a .conf file, and the DWARF parsing
would then ignore this function's DWARF definition (it might be good to
still read the DWARF to make sure things match up, but I'm not doing
that yet). So for instance if I have a function that takes a string:
void f(const char* s); then the DWARF would interpret this as a pointer
to a single char. But the .conf can say 'void f(string);', and the right
thing then happens.

Similary I can define a named type in a .conf and have it override a
similarly-named definition in the DWARF. This works, but has some
issues:

- If I define the type in libwhatever.so.conf then it works. If I
  define the type in .ltrace.conf, it doesn't work (DWARF definition
  used). If I define it in both, the it STILL doesn't work. Not sure why
  yet

- With things like FILE*, I might want it to be printed as a pointer,
  but I don't see an obvious way to do that. I can define a lens
  'typedef FILE = hex(int)', but this says that FILE is an integer, not
  FILE*. Am I missing something? Thoughts about this?

I still haven't cleaned up the error handling, memory deallocation, but
that's on the list. In case it may be useful, I'm attaching a small test
case library I'm using to run tests.

dima

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ltracetests.tar.gz
Type: application/octet-stream
Size: 1677 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/ltrace-devel/attachments/20140423/c5a901b0/attachment.obj>


More information about the Ltrace-devel mailing list