This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: WIP fix for PR 12997


>>>>> "Mark" == Mark Wielaard <mjw@redhat.com> writes:

Mark> But I am confused about the this->loaded_type_units thing.
Mark> That seems in the wrong place. Which caller needs this?
Mark> With this the first caller to iterate_over_cus() that sets want_types,
Mark> will get its callback called for all DIEs, in both CUs and TUs, but
Mark> any next one will get its callback called only for all DIEs in the CUs.
Mark> That is somewhat confusing, at least to me.

My understanding is that iterate_over_cus implements a cache of CUs.  It
only reads the CU DIEs the first time through, the 'v == 0' case.  After
this, the CU DIEs are stored in module_cu_cache.

Now that you mention it, though, I realize my approach is wrong.
I have to also store a per-module "read the TUs" flag somewhere.
Oops.  I will fix this.

>> +probe process("debugtypes.exe").function("func") {
>> +  println(@cast($p, "struct s1")->l)
>> +}

Mark> You shouldn't need @cast here.
Mark> Or if that is deliberate a better test would be to do it twice
Mark> and see if it gets the same result:

Mark> println($p->l);
Mark> println(@cast($p, "struct s1")->l);

The test only fails with the @cast.

I believe the reason is that libdw handle DW_FORM_ref_sig8, so $p gets
its type correctly without further work in stap.  However, the @cast
form does a by-name lookup, which fails without the extra work of
reading the .debug_types section.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]