Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTMStackTrace addresses do not have 0x prefix #89

Closed
GoogleCodeExporter opened this issue Apr 21, 2015 · 0 comments
Closed

GTMStackTrace addresses do not have 0x prefix #89

GoogleCodeExporter opened this issue Apr 21, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Look at GTMStackTrace output.

What is the expected output? What do you see instead?
The code previously used 0x when printing out the addresses in its stack 
traces.  A recent changed now prints out 00 as a prefix instead.

What version of the product are you using? On what operating system?
Trunk.

Please provide any additional information below.

The stringWithFormat: line in GTMStackTraceFromAddressDescriptors() used to use 
%p to format the pointers.  However, using the "0" modifier to get a fixed 
width is not defined, leading to compiler warnings.  Therefore, the code was 
changed to use a variant of %x.  However the code was changed to be "%0*lX", 
whereas to duplicate %p (but with a fixed width) should have been "%#0*lx" .  
The capital X will cause capital hex digits to be used (whereas %p uses 
lowercase), so using %x instead of %X would seem to be the better replacement.  
More importantly, the new format is missing the # modifier to the %x format, 
meaning there is no 0x prefix, but rather the address is padded with 0s out to 
the full width, and the code comment indicates that it still expects the 0x to 
still be there.

Original issue reported on code.google.com by lindb...@clindberg.org on 2 Nov 2012 at 9:58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants