[Ltrace-devel] Getting prototypes from debug information

Petr Machata pmachata at redhat.com
Tue May 6 11:00:21 UTC 2014


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

> I looked into this, and it's caused by the thread. If you modify your
> main() in hle1.c to do pthread_create() and call jedna() from the
> thread, then the in-second-thread jedna() call is shown with the default
> prototype. This is with 'ltrace -f -l'.

Ah, you're right, I've got it reproduced now.  The following fixlet
takes care of this problem:

diff --git a/output.c b/output.c
index 0cec653..671a5d7 100644
--- a/output.c
+++ b/output.c
@@ -531,7 +531,7 @@ output_left(enum tof type, struct process *proc,
 
 	account_output(&current_column, fprintf(options.output, "("));
 
-	struct prototype *func = lookup_symbol_prototype(proc, libsym);
+	struct prototype *func = lookup_symbol_prototype(proc->leader, libsym);
 	if (func == NULL) {
 	fail:
 		account_output(&current_column, fprintf(options.output, "???"));

It's now on master (together with a test case).

Thank you,
PM



More information about the Ltrace-devel mailing list