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

Print unsigned values (or better hex) #151

Open
x8-999-github opened this issue Apr 26, 2018 · 0 comments
Open

Print unsigned values (or better hex) #151

x8-999-github opened this issue Apr 26, 2018 · 0 comments

Comments

@x8-999-github
Copy link

Hello,

It would bey very nice if it where possible to print value in hex and if possible also print unsigned values as unsigned. In gdb the print command accepts /x to print in hex.
I currently made a small modification for myself that .. is not ready for prime time.

diff --git a/src/core/common.cpp b/src/core/common.cpp
index ea92196..7760605 100644
--- a/src/core/common.cpp
+++ b/src/core/common.cpp
@@ -723,7 +723,7 @@ namespace oclgrind
       switch (size)
       {
       case 1:
-        cout << (int)*(char*)data;
+        cout << hex << (unsigned int)(unsigned char)*(char*)data;
         break;
       case 2:
         cout << *(short*)data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant