[Ltrace-devel] nested library calls and right-hand params

Joe Damato ice799 at gmail.com
Tue Nov 9 00:08:20 UTC 2010


On Wed, Nov 3, 2010 at 11:00 AM, Petr Machata <pmachata at redhat.com> wrote:
> 02.11.2010 17:49, Petr Machata wrote:
>>
>> The problem
>> here is that the register set is preserved in struct Process, not in
>> struct callstack_element, and so is overwritten when nested call appears
>> which has right-hand parameters too.
>
> This is now fixed here:
>  https://github.com/pmachata/ltrace/tree/nested
>
> That branch forks off this branch:
>  https://github.com/pmachata/ltrace/tree/float
> which fixes a problem with passing doubles in arguments and return values on
> x86_64, and simplifies the whole argument-preserving scenario a bit.
>
> Both add test cases for bugs that they fix.

I tried these changes on an x86 ubuntu VM and two tests failed:

FAIL: func_double(3.40*, -3.40*).*= -3.40* in
/home/joe/code/ltrace/testsuite/ltrace.main/parameters.ltrace for 0
times ,should be 1
FAIL: <... func_call resumed> \"x\", \"y\") in
/home/joe/code/ltrace/testsuite/ltrace.main/parameters.ltrace for 0
times ,should be 1


The .ltrace output is below.

joe

---

func_intptr(17)                                  = <void>
func_intptr_ret(42)                              = <void>
func_strlen("Hello world")                       = 11
func_strfixed("Hell")                            = <void>
func_ppp(80)                                     = <void>
func_stringp("Dude")                             = <void>
func_enum(BLUE)                                  = <void>
func_short(-8, -9)                               = <void>
func_ushort(33, 34)                              = <void>
func_float(3.400000, -3.400000)                  = 3.400000
func_double(0.000000, 0.000000)                  = 0.000000
func_typedef(BLUE)                               = <void>
func_arrayi([ 10, 11, 12, 13... ], )             = <void>
func_arrayi([ 10, 11 ], )                        = <void>
func_arrayf([ 10.100000, 11.100000, 12.100000, 13.100000... ], ) = <void>
func_arrayf([ 10.100000, 11.100000 ], )          = <void>
func_struct({ 89, 2, 3, [ { 1, 10 }, { 3, 30 } ], [ { 4, 40 }, { 5, 50
}, { 6, 60 } ], "123" }) = <void>
func_call( <unfinished ...>
func_work("x")                                   = <void>
<... func_call resumed> "y", "Z\213\014$\211\004$\213D$\004\302\014") = <void>
+++ exited (status 0) +++



More information about the Ltrace-devel mailing list