This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Problem with 32-bit negative return values
- From: Roland McGrath <roland at redhat dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: Mike Mason <mmlnx at us dot ibm dot com>, systemtap at sources dot redhat dot com
- Date: Tue, 10 Oct 2006 11:28:31 -0700 (PDT)
- Subject: Re: Problem with 32-bit negative return values
> It could easily be a typing/sign-extension bug in the loc2c-related
> code. Could you check the generated C code (-p3; look for the
> _dwarf_tvar_get function)?
All loc2c-generated fetches use unsigned types of the target object size,
i.e. uint32_t here. loc2c just fetches the bits.
Your general expression code that uses the fetched value should cast
appropriately for the signedness and size you want to calculate with.