How to change the display to hexadecimal ? lazarus / 12-Debugger ---------------------------------------------------------------------- 440bx · 2018-08-11 02:58 Hello, One very nice feature when debugging is that you can place the mouse over a data structure and after a second (or so) a window showing the values of all the fields in the data structure pops up. The "problem" is that the values of integer fields (byte, word, dword, etc) are shown in decimal and I'd like to have them shown in hexadecimal. Is there a way to configure that popup to show the values in hex instead of decimal ? Thanks. ---------------------------------------------------------------------- Martin_fr · 2018-08-11 09:15 Only in the watches window. There you can use the properties of each watched value. The debug hint does not have that. ---------------------------------------------------------------------- 440bx · 2018-08-11 11:14 Quote from: Martin_fr on August 11, 2018, 11:15:45 amOnly in the watches window. There you can use the properties of each watched value. The debug hint does not have that. Thank you Martin.   I'll just have to get used to decimals.  My grocery store is like that too, I asked them to put the prices in hex but, they didn't go for it. ---------------------------------------------------------------------- Ondrej Pokorny · 2018-08-13 08:16 Quote from: Martin_fr on August 11, 2018, 11:15:45 amThe debug hint does not have that. It has. See how TDateTime is implemented: unit "ide\debugmanager.pas" in constructor TDebugManager.Create(TheOwner: TComponent); RegisterValueFormatter(skSimple, 'TDate', @DBGDateTimeFormatter); - you can install your own value formatter for every type in your IDE extension package ---------------------------------------------------------------------- ASerge · 2018-08-13 17:48 Here's a simple package implementing what Ondrej Pokorny has pointed out. ---------------------------------------------------------------------- wp · 2018-08-13 18:04 Excellent! I've been missing this all the time. Could you write a bugtracker feature request to get it added to the IDE? ---------------------------------------------------------------------- 440bx · 2018-08-13 19:00 Quote from: wp on August 13, 2018, 08:04:09 pmExcellent! I've been missing this all the time. Could you write a bugtracker feature request to get it added to the IDE? I second wp's opinion, that is excellent indeed.    Thank you Serge. Here is to show that I am still a clueless noobie.  I installed the package (lazarus recompiled successfully), checked in the "install/uninstall package" and it is in the list of installed packages.  In spite of that, I still get the values in decimal.  What did I miss to have the values in hex ?  Do I need to add a "uses " to my code ? Thanks. ---------------------------------------------------------------------- wp · 2018-08-13 19:22 Did you click "Save and rebuild IDE"? Or, in the dialog in which you loaded the package you must click "Use" > "Install", not only "Compile". This will rebuild the IDE with the new package included. It will take a while... When finished Lazarus will restart. Then you set a breakpoint in your program, compile and run it. When the program stops at the breakpoint you hover the mouse above a numeric variable, and the popup will show you the decimal and hex value of the variable. ---------------------------------------------------------------------- 440bx · 2018-08-13 19:30 Quote from: wp on August 13, 2018, 09:22:11 pmThen you set a breakpoint in your program, compile and run it. When the program stops at the breakpoint you hover the mouse above a numeric variable, and the popup will show you the decimal and hex value of the variable. Thanks wp.  It works exactly as you described it.  The problem is, I am/was hovering over a record with a bunch of fields  (that's the variable I'm particularly interested in seeing in hex) and, in records, it still shows the values in decimal.  I suppose the package doesn't support record fields. ---------------------------------------------------------------------- 440bx · 2022-11-22 16:39 Hello, I installed @ASerge's rather handy ShowIntAsHex in Lazarus trunk v2.3.0 revision main-2_3_2330, Win64 version.  The FPC version is also the trunk version of 3.3.1. After installing ShowIntAsHex (and using GDB), either GDB or Lazarus causes an access violation which forces terminating the debugging session.  Note: I don't know if the problem would occur using FpDebug. My question is: is ShowIntAsHex not compatible with the current trunk version of Lazarus and FPC ? Also: is anyone successfully using ShowIntAsHex with the current trunk versions of FPC and Lazarus ? Thank you for your help. ---------------------------------------------------------------------- Thaddy · 2022-11-22 16:59 Silly. We have .ToHexString for that. (two overloads, I wrote them) The Lazarus IDE maintainers should take note. ---------------------------------------------------------------------- 440bx · 2022-11-22 17:01 Quote from: Thaddy on November 22, 2022, 05:59:25 pmSilly. We have ToHexString for that. ShowIntAsHex causes the _debugger_ to show the value in hex in addition to decimal.   Didn't you read the post ? ---------------------------------------------------------------------- Thaddy · 2022-11-22 17:02 Read my edit. Posts crossed. ---------------------------------------------------------------------- Thaddy · 2022-11-22 17:04 It can simply be a case of IDE maintainers are not aware of that. It should be a very easy fix.