Menu

#8 Printing numbers in hexidecimal

open
nobody
None
5
2016-09-01
2016-09-01
Ed Schwartz
No

Hi,

We're using XSB for binary program analysis. One side-effect of this is that we have many predicates involving code addresses, which are difficult to read in decimal. It would be very nice if there was a supported method to print in hexidecimal.

A few options:

  1. A predicate-specific option to print numbers encountered in that predicate in hex.

  2. A global option to print all numbers encountered in hex.

Semi-related:

We actually patched XSB so it always printed numbers in hex, and ran into a problem. When we use load_chr to generate a .P file from a .chr file, the .P file contains large hex. values (i.e., 0xfffffff...) instead of small negative values (i.e., -33). XSB apparently parses radix numbers as unsigned values, which overflows for numbers such as -33, and as a result converts the number to float. Perhaps a better behavior would be to read such numbers as negative integers instead of overflowing to floats.

Discussion


Log in to post a comment.