Recent

Author Topic: CPU-View  (Read 6094 times)

Alexander (Rouse_) Bagel

  • New Member
  • *
  • Posts: 27
CPU-View
« on: October 19, 2024, 04:00:28 pm »
I do reverse engineering, and I miss the capabilities of the regular FpDebug debugger.
Today I want to show my work that I've been doing for almost a year to make the debugger better. It's not finished yet, it needs a lot of tweaks, but I need someone to look at it.
It's a full GUI debugger with a lot of supported features. I've implemented in it what I was missing. I think it makes sense to add many of my solutions to the main debugger.
CPU-View is under development and I make changes to it every day, I miss the opinion of specialists who are immersed in this task (it's not application level - it should really be system engineers).
There are not enough IOTA interfaces, all debugging is laid directly on specific windows. If they let me - I could offer my implementation.
https://github.com/AlexanderBagel/CPUView

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: CPU-View
« Reply #1 on: October 19, 2024, 05:46:27 pm »
Looks great.
I'll have to finish a few things right now, but I will have a look asap.

I would be happy to help integrate most of this with the IDE.  Though probably keeping the asm,reg,dump windows as separate (but anyone with anchordock can combine them).

One thing that may be a bit more complicated (unless you already have something / I haven't looked) is the register view. The Problem is that there are different CPUs supported. (We have the remote arm, and Mac M1/2/3, and with gdb even more).
So there will be a need for a generic and for cpu specific reg-windows (or for backends to provide display info).

Also I haven't checked on what you done on the interface between frontend and backend. I will comment on that as soon as I had a chance to look through it.

In any case thanks for all the work, and sharing it here.

---
Btw, we now have 2 mem-dump viewers, since I added one too.



As for the interfaces => there are definite needs to create some. Except for the watches the entire front/backend api is legacy (from when there was only one debugger, no front, no back-end).

But as I said details on that to follow.

Alexander (Rouse_) Bagel

  • New Member
  • *
  • Posts: 27
Re: CPU-View
« Reply #2 on: October 19, 2024, 06:15:27 pm »
Yes, MemViewer - it has helped me more than once, thank you very much am for putting it into debugging.

Well, as for registers - I've done a lot of work to isolate them into an abstraction and separate them into a separate data model. Therefore, registers in the debugger can be represented as they are implemented by the current processor. It doesn't matter Intel/Arm/Z80 or otherwise.
« Last Edit: October 19, 2024, 06:19:44 pm by Alexander (Rouse_) Bagel »

Fibonacci

  • Hero Member
  • *****
  • Posts: 646
  • Internal Error Hunter
Re: CPU-View
« Reply #3 on: October 20, 2024, 10:18:00 am »
During my short playtime with it, it crashed twice and froze once

Alexander (Rouse_) Bagel

  • New Member
  • *
  • Posts: 27
Re: CPU-View
« Reply #4 on: October 21, 2024, 05:36:26 am »
During my short playtime with it, it crashed twice and froze once
Got it. I'll check it, apparently I forgot to check synchronization somewhere, which can cause hangs. And something with the dictionaries.

440bx

  • Hero Member
  • *****
  • Posts: 4894
Re: CPU-View
« Reply #5 on: October 21, 2024, 06:58:35 am »
@Alexander,

Your work looks very interesting. 

I wanted to try your CPU viewer and I proceeded to install FMHexViewer, which I believe is needed by the CPU viewer.

Compiling FMHexView produced a compiler error.  Attached is a screenshot of the error messages.

I am using Lazarus v3.99 with FPC v3.2.2 (see attachment for details.)

Any guidance you can provide to eliminate the errors will be greatly appreciated.

Thank you.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Alexander (Rouse_) Bagel

  • New Member
  • *
  • Posts: 27
Re: CPU-View
« Reply #6 on: October 21, 2024, 07:14:01 am »
I am using Lazarus v3.99 with FPC v3.2.2 (see attachment for details.)
I forgot to write the requirements - this is all designed for the current trunk (both Lazarus and FPC)

« Last Edit: October 21, 2024, 07:20:18 am by Alexander (Rouse_) Bagel »

440bx

  • Hero Member
  • *****
  • Posts: 4894
Re: CPU-View
« Reply #7 on: October 21, 2024, 07:41:44 am »
Thank you.

That explains why I'm getting an error.  I'm not using the required version of FPC.

The following question is mostly driven by curiosity.  Couldn't FMHexView be coded using the features in v3.2.2 ?   The reason I ask is because it may be years before the features in the development version appear in a formal release. 

In addition to that, I believe that formal releases are more thoroughly tested than the development version.  This usually means there is less of a chance of a bug being in the compiler than in the application/package, which is nice when using/testing beta software.


(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Alexander (Rouse_) Bagel

  • New Member
  • *
  • Posts: 27
Re: CPU-View
« Reply #8 on: October 21, 2024, 07:46:33 am »
The following question is mostly driven by curiosity.  Couldn't FMHexView be coded using the features in v3.2.2 ?   The reason I ask is because it may be years before the features in the development version appear in a formal release. 

I could redesign it, but then the code would be less efficient. That's why I've been actively proposing fixes to both FPC (both RTL and the compiler itself) and LCL for the last year, so that the common code base works the same on both Delphi and Lazarus.

440bx

  • Hero Member
  • *****
  • Posts: 4894
Re: CPU-View
« Reply #9 on: October 21, 2024, 08:12:26 am »
The reasons you mention make sense.

Thank you for the update.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: CPU-View
« Reply #10 on: October 21, 2024, 02:21:11 pm »
I just updated my FPC 3.3.1 to the latest b693af69a6

But I get
Code: Text  [Select][+][-]
  1. FWHexView.Common.pas(630,29) Error: Identifier not found "TExtended80Rec"

I can find a declaration in the source, but it is ifdefed
Code: Pascal  [Select][+][-]
  1. {$if defined(SUPPORT_EXTENDED) or defined(FPC_SOFT_FPUX80)}
and apparently not build in.

That said, give a variable
Code: Pascal  [Select][+][-]
  1.   Buff: TExtended80Support;

Why fill it with
Code: Pascal  [Select][+][-]
  1.       FillChar(Buff, SizeOf(TExtended80Rec), 0);
?




Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: CPU-View
« Reply #11 on: October 21, 2024, 02:32:03 pm »
Ok, I fixed that with the declared type. Compiles.

Running an app, and opening CPU-View => all empty.
Stays empty even if I step, or restart the debugged app with the  Window already open.

Statusbar says:
Pid: 0 Tid: 0 
State Unknown
Addr 0x0 (No access)


And yes, I have the very latest Lazarus. And FPC updated too.

Windows 10 - 64 bit
Using the FpDebug backend

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: CPU-View
« Reply #12 on: October 21, 2024, 02:48:30 pm »
Interesting, it works if the app is a GUI app, and has a form open. But not if it is a console app. (Well, may be something else, but that is the main diff I noted)

Alexander (Rouse_) Bagel

  • New Member
  • *
  • Posts: 27
Re: CPU-View
« Reply #13 on: October 21, 2024, 02:57:28 pm »
I just updated my FPC 3.3.1 to the latest b693af69a6

But I get
Code: Text  [Select][+][-]
  1. FWHexView.Common.pas(630,29) Error: Identifier not found "TExtended80Rec"

Oops, that's a mistake - I'll fix it. Thank you.

Alexander (Rouse_) Bagel

  • New Member
  • *
  • Posts: 27
Re: CPU-View
« Reply #14 on: October 21, 2024, 02:59:19 pm »
Interesting, it works if the app is a GUI app, and has a form open. But not if it is a console app. (Well, may be something else, but that is the main diff I noted)

Thanks, I'll check into why it's not connecting.

 

TinyPortal © 2005-2018