It is currently Wed Oct 21, 2020 8:19 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Fri Dec 27, 2019 7:25 pm 
Offline
User
User
User avatar

Joined: Sat Oct 18, 2014 8:37 am
Posts: 20
Short description :
"Display Hex values" setting has no effect on MemoryViewer.

Steps to reproduce :
1 - Open Purebasic IDE
2 - Go to menu File > Preferences... > Debugger > Individual Settings
3 - In "Memory Viewer" field, check option "Display Hex Values"
4 - Click "Ok" button
5 - Run the code bellow
6 - On the bottom left of Memory Viewer window, click on "Hex View" and select any "* Table" view.

Expected result :
Values should be displayed in hexa.

Actual result :
Values are displayed in decimal.

Code to run :
Code:
EnableExplicit

CompilerIf Not #PB_Compiler_Debugger
   CompilerError "You MUST enable debugger to use memory Viewer and see the bug."
CompilerEndIf

Define myString$ = "Hello world"
ShowMemoryViewer(@myString$, StringByteLength(myString$) + SizeOf(Character))
CallDebugger

My computer :
Purebasic : 5.71 LTS (Linux - x64)
OS : Ubuntu 18.04.3 LTS (64 bits)

_________________
Please correct me if my English is bad.


Last edited by Naheulf on Sat Dec 28, 2019 9:07 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: [PB 5.71 x64] "Display Hex values" and MemoryViewer
PostPosted: Sat Dec 28, 2019 8:27 am 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 1264
Location: right here
Confirmed. Happens here as well.


Top
 Profile  
Reply with quote  
 Post subject: Re: [PB 5.71 x64] "Display Hex values" and MemoryViewer
PostPosted: Sat Dec 28, 2019 7:59 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3549
Location: New Zealand
I get hex view on manjero
Quote:
00000000015060C0 48 00 65 00 6C 00 6C 00 6F 00 20 00 77 00 6F 00 H.e.l.l.o. .w.o.
00000000015060D0 72 00 6C 00 64 00 00 00 r.l.d...


Top
 Profile  
Reply with quote  
 Post subject: Re: [PB 5.71 x64] "Display Hex values" and MemoryViewer
PostPosted: Sat Dec 28, 2019 8:08 pm 
Offline
User
User
User avatar

Joined: Sat Oct 18, 2014 8:37 am
Posts: 20
idle wrote:
I get hex view on manjero
Quote:
00000000015060C0 48 00 65 00 6C 00 6C 00 6F 00 20 00 77 00 6F 00 H.e.l.l.o. .w.o.
00000000015060D0 72 00 6C 00 64 00 00 00 r.l.d...


You forgot my step "6"
Naheulf wrote:
6 - On the bottom left of Memory Viewer window, click on "Hex View" and select any "* Table" view.


Of course the "Hex View" is always displayed as Hexadecimal... :P The issue is for other views...

_________________
Please correct me if my English is bad.


Top
 Profile  
Reply with quote  
 Post subject: Re: [PB 5.71 x64] "Display Hex values" and MemoryViewer
PostPosted: Sat Dec 28, 2019 8:13 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3549
Location: New Zealand
OK I see what you mean now, doesn't look like it's implemented the preference appears as MemoryIsHex a global in DebuggerCommon.pb
So the prototypes to fill out the table just need to be changed which could also be expanded to include options of dec,bin,oct,hex

/purebasic-master/PureBasicDebugger/MemoryViewer.pb
Code:
Prototype.s MemoryViewer_PeekVal(*Pointer)

Procedure.s MemoryViewer_PeekB(*Pointer)
  If MemoryIsHex  ;<-global defined in DebuggerCommon.pb
    ProcedureReturn Hex(PeekB(*Pointer),#PB_Byte)
  Else
    ProcedureReturn Str(PeekB(*Pointer))
  EndIf   
EndProcedure


and so on for the rest of the prototypes


Top
 Profile  
Reply with quote  
 Post subject: Re: [PB 5.71 x64] "Display Hex values" and MemoryViewer
PostPosted: Tue Dec 31, 2019 1:45 am 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3549
Location: New Zealand
committed a fix


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Thu Feb 27, 2020 1:49 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14116
Location: France
So it's fixed in current beta ?


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Thu Feb 27, 2020 8:09 pm 
Offline
User
User
User avatar

Joined: Sat Oct 18, 2014 8:37 am
Posts: 20
Nop.

If I check with PB 5.72 LTS Beta 1 (x64) and use step to reproducefrom my first message and choose "Word Table" I get following values :
Code:
72 101 108 108 111 32 119 111 114 108 100 0

Instead of
Code:
48 65 6C 6C 6F 20 77 6F 72 6C 64 0


So the bug is still here.

_________________
Please correct me if my English is bad.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Thu Feb 27, 2020 9:38 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3549
Location: New Zealand
Add at line 711 in memory viewer and it'll fix it
MemoryViewTableData.i = MemoryIsHex

I'd set it at the start of the file rather than in the open window


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Sun Mar 08, 2020 3:12 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 25, 2014 5:25 pm
Posts: 427
Location: Germany
Fred wrote:
Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer

So it's fixed in current beta ?
You should ask first and then mark the thread as "[Done]". :wink:
Now the thread has kept the marking, although the bug is not fixed yet.

PR on GitHub: https://github.com/fantaisie-software/purebasic/pull/73

_________________
Image
Why OpenSource should have a license
PureBasic-CodeArchiv-Rebirth: Git-Repository / Download – Any help is welcome!
Manjaro Xfce x64 (Main system) :: WindowsXP/Xubuntu x86 (VirtualBox) :: PureBasic (Linux: x86/x64, Windows: x86) :: All are up to date


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Sun Mar 08, 2020 3:44 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14116
Location: France
Thanks for the PR, merged !


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Mon Mar 09, 2020 7:06 pm 
Offline
User
User
User avatar

Joined: Sat Oct 18, 2014 8:37 am
Posts: 20
Year ! It works on 5.72 Beta 2 ! The combobox to choose OCT, DEC or HEX is nice.
But I don't understand the Data checkbox use. Is for another bugfix ?

_________________
Please correct me if my English is bad.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Mon Mar 09, 2020 8:09 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3549
Location: New Zealand
The check box just enables you to format the output on copy to that of a datasection .


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Tue Mar 10, 2020 7:36 am 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 1264
Location: right here
Documentation needs to be updated (and translated) as well.
The Data checkbox doesn't do it when in Hex-view? Should be disabled then.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] PB 5.71 x64 "Display Hex values" and MemoryViewer
PostPosted: Wed Mar 11, 2020 9:31 am 
Offline
Addict
Addict
User avatar

Joined: Fri Sep 21, 2007 5:52 am
Posts: 3549
Location: New Zealand
#NULL wrote:
Documentation needs to be updated (and translated) as well.
The Data checkbox doesn't do it when in Hex-view? Should be disabled then.


Yes should probably disable it in hex view. this should do it. I've still got some issues with my system at the moment.
So if one of you can add these in MemoryViewer
[code
DisableGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_ChkformatDataSection],1)
DisableGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_ChkformatDataSection],0)
[/code]

Replace the 1st If block in MemoryViewer_Update
Code:
If ViewType = 0 Or ViewType >= 8 ; hex display or string display
    ClearGadgetItems(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_List])
   
    HideGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_Container], 1)
    HideGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_Editor], 0)
   
    DisableGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_Display_DataView],1)
    DisableGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_ChkformatDataSection],1)
  Else 
    FreeGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_List]) ; recreate this to change the number of columns
    OpenGadgetList(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_Container])
    If MemoryOneColumnOnly
      *Debugger\Gadgets[#DEBUGGER_GADGET_Memory_List] = ListViewGadget(#PB_Any, 0, 0, WindowWidth(*Debugger\Windows[#DEBUGGER_WINDOW_Memory])-20, WindowHeight(*Debugger\Windows[#DEBUGGER_WINDOW_Memory])-90)
    Else
      *Debugger\Gadgets[#DEBUGGER_GADGET_Memory_List] = ListIconGadget(#PB_Any, 0, 0, WindowWidth(*Debugger\Windows[#DEBUGGER_WINDOW_Memory])-20, WindowHeight(*Debugger\Windows[#DEBUGGER_WINDOW_Memory])-90, "", 80, #PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_MultiSelect)
    EndIf
    CloseGadgetList()
   
    HideGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_Container], 0)
    HideGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_Editor], 1)
    DisableGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_Display_DataView],0)
    DisableGadget(*Debugger\Gadgets[#DEBUGGER_GADGET_Memory_ChkformatDataSection],0)
  EndIf 


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye