AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein In Asm-Prozedur eine Exception auslösen
Thema durchsuchen
Ansicht
Themen-Optionen

In Asm-Prozedur eine Exception auslösen

Ein Thema von Amateurprofi · begonnen am 2. Nov 2023 · letzter Beitrag vom 11. Nov 2023
Antwort Antwort
Seite 4 von 4   « Erste     234   
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.071 Beiträge
 
Delphi 12 Athens
 
#31

AW: In Asm-Prozedur eine Exception auslösen

  Alt 10. Nov 2023, 13:46
no, with is only for results greater a Register aka SizeOf(Pointer)
or for Results with managed types, such as string and interface.
Neuste Erkenntnis:
Seit Pos einen dritten Parameter hat,
wird PoSex im Delphi viel seltener praktiziert.
  Mit Zitat antworten Zitat
Benutzerbild von paule32.jk
paule32.jk

Registriert seit: 24. Sep 2022
Ort: Planet Erde
356 Beiträge
 
Delphi 11 Alexandria
 
#32

AW: In Asm-Prozedur eine Exception auslösen

  Alt 10. Nov 2023, 20:41
@kas ob:

ehmm... with self, I mean not the Delphi keyword in Context of Classes/Records.
with self, I mean the internal working Design of Microsoft Windows.
Like himitsu said - it could be for "self" managed Code (COM+).

And I can bet, that Microsoft have a secret Layer'ed File with Numbers (I pointed: 2 ^64 = 18 Trillion GiBytes dataflow. So, each managed Type becomes a (GUID) Number, and as such, all the Component(s) are different and can directly accessed. Instead to use String like in Delphi, and C++ Builder Debug Symbols.
In older Window's, the DLL Functions could be called by Value, and Name.
Frag doch einfach
Alles was nicht programmiert werden kann, wird gelötet
  Mit Zitat antworten Zitat
Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.586 Beiträge
 
Delphi 11 Alexandria
 
#33

AW: In Asm-Prozedur eine Exception auslösen

  Alt 10. Nov 2023, 23:01
I don't understand what you mean, but the stack layout is documented here:
https://learn.microsoft.com/en-us/cpp/build/stack-usage
Sebastian Jänicke
Alle eigenen Projekte sind eingestellt, ebenso meine Homepage, Downloadlinks usw. im Forum bleiben aktiv!
  Mit Zitat antworten Zitat
Benutzerbild von paule32.jk
paule32.jk

Registriert seit: 24. Sep 2022
Ort: Planet Erde
356 Beiträge
 
Delphi 11 Alexandria
 
#34

AW: In Asm-Prozedur eine Exception auslösen

  Alt 10. Nov 2023, 23:11
hello @jaenicke:

I point to: PROLOG and EPILOG

You can not simply call Exception Functions or any Functions of any Classes without .Create a Instance.
This give MAVs.
Frag doch einfach
Alles was nicht programmiert werden kann, wird gelötet
  Mit Zitat antworten Zitat
Kas Ob.
Online

Registriert seit: 3. Sep 2023
351 Beiträge
 
#35

AW: In Asm-Prozedur eine Exception auslösen

  Alt 11. Nov 2023, 07:59
@kas ob:

ehmm... with self, I mean not the Delphi keyword in Context of Classes/Records.
with self, I mean the internal working Design of Microsoft Windows.
Like himitsu said - it could be for "self" managed Code (COM+).
I am lost here, i don't understand this point or how it is relevant to raising an exception.

Notice that, exception are raised by an interrupt instruction, meaning it have standard way to raise, this doesn't have anything to do the OS (Windows/Linux...) it is standard by hardware, were the OS Kernel should have installed its debugger to capture/receive these hardware generated interrupt.

That was one, and second is notice how Delphi raise the Exception, we create a class then we pass the class to specific procedure to raise it, we don't call any element of that class.
Code:
type
  TMyException = class(Exception)
  end;

var
  MyExcept: TMyException;
begin
  MyExcept.Create('Error Message');
  // we do
  raise MyExcept;
  // and there is no way to raise it from within like
  MyExcept.raise;
end.
If we could do MyExcept.Raise then we should pass the except as self here, but we do raise MyExcept, which take a parameter to the System._RaiseExcept which has hidden way (aka compiler magic) to fill the parameter with the exception class, meaning it is declared as such
Code:
procedure RaiseExcept(Obj: TObject);
The fact we pass the created exception as parameter is merely a coincidence.

And I can bet, that Microsoft have a secret Layer'ed File with Numbers (I pointed: 2 ^64 = 18 Trillion GiBytes dataflow. So, each managed Type becomes a (GUID) Number, and as such, all the Component(s) are different and can directly accessed. Instead to use String like in Delphi, and C++ Builder Debug Symbols.
In older Window's, the DLL Functions could be called by Value, and Name.
Also don't understand this, GUID for COM literally stored in specific Windows format standardized with specific VMT, so we have what we can call a class but it is a bunch of linked look-up tables each have its own GUID stored in central table for that created class, so no secret DB for them, just a service belongs to the OS have the control over the registration for these COM/DCOM, and fill the data in the registry, in readable way.
Also these strings in Delphi are the same in other languages (eg. C#..), in all cases these GUID strings will be translated into bytes from their hex values, into the specific structure to be read then looked up.
So if you use a hex editor/viewer on an application, you will not find any string like these GUID in an interface, but you will find the HEX values for them.
Kas
  Mit Zitat antworten Zitat
Benutzerbild von paule32.jk
paule32.jk

Registriert seit: 24. Sep 2022
Ort: Planet Erde
356 Beiträge
 
Delphi 11 Alexandria
 
#36

AW: In Asm-Prozedur eine Exception auslösen

  Alt 11. Nov 2023, 08:57
@kas ob

First, the only Standard Interrupt on Windows is INT 3. It will be handled as/for Debug reason. This Interrupt is addressed into the GDT, and IDT Table (that is an Operating System Issue). I don't want go into the depth with this, because it will cover more things, that you don't understand.

Again, you need to create a Instance of a Exception Class to "stack up" the Exception.
Each Exception (class) need then stack Prolog, and Epilog.
The Prolog is for clean "build stack", the Epilog is for clean "destroy stack". This is a very import memory thing, because each Exception "can" have Parameters like .Create(42); or .Create('foo'); or .Create('foo','fufu',42); or simply .Create;

Exception's will be "raise" with: raise EExceptionClass.Create; or EExceptionClass.Create(42); ...
Again, you can not do simply raise EExceptionClass.MyExcept; because raise point then into memory where "not" your code have access, and Windows will prompt you with MAV's.

Second, Microsoft Windows uses very often COM+ (Component Object Model) things.
That is based on the Terminal Server Services, and/or the Remote Access Services (RD Remote Desktop).
This services are for centralized the maintain flow of Enterprise/Corporation's firms Computerdesk.

To hold the traffic and latency of Applications for this Services on a low Level, Microsoft plays a little bit with it's own technologies.
As such, they transmit data in form of image data, and plain text (like numbers that describe, what Function is to call on the counter part of the connection. This is then from Server to Client, and Client to Server.

- You can take a look onto the RPC Protocol, and it's implementation (Tools).
- You will realize that many things are based on numbers

RPC is a very old Protocol from Unix Workstations, and Unix Servers back into the 1970th.
Frag doch einfach
Alles was nicht programmiert werden kann, wird gelötet
  Mit Zitat antworten Zitat
Kas Ob.
Online

Registriert seit: 3. Sep 2023
351 Beiträge
 
#37

AW: In Asm-Prozedur eine Exception auslösen

  Alt 11. Nov 2023, 09:57
@kas ob
First, the only Standard Interrupt on Windows is INT 3. It will be handled as/for Debug reason. This Interrupt is addressed into the GDT, and IDT Table (that is an Operating System Issue). I don't want go into the depth with this, because it will cover more things, that you don't understand.
There is more than one Interrupt https://www.felixcloutier.com/x86/intn:into:int3:int1
I do understand it all.

Again, you need to create a Instance of a Exception Class to "stack up" the Exception.
Each Exception (class) need then stack Prolog, and Epilog.
The Prolog is for clean "build stack", the Epilog is for clean "destroy stack". This is a very import memory thing, because each Exception "can" have Parameters like .Create(42); or .Create('foo'); or .Create('foo','fufu',42); or simply .Create;
You are confusing the exception and its class with the SEH structure that will trap the exception, exception will not have Prolog or Epilog, these are and should be for each function/procedure for the unwinder to unwind till reaching the last exception trap, and they has nothing to do with the exception itself or its parameter, except where it did raised and where to start to unwind, if the parameters of the context is known for the OS then it will handle it, otherwise it will pass these SEH, also exception not only raised manually, eg. most of the assembly code that access memory can and might raise Page Faults which also are exception, and none the less will be passed to last SEH, only if the OS decide to, does these have prolog or epilog !!? no is the answer, and they don't have exception class at all, the OS will build parameters then do the unwind then pass these parameters to the last SEH found, if the applicaiton have one then it is OK, if not then most likely the OS will kill that process/application.

Second, Microsoft Windows uses very often COM+ (Component Object Model) things.
That is based on the Terminal Server Services, and/or the Remote Access Services (RD Remote Desktop).
This services are for centralized the maintain flow of Enterprise/Corporation's firms Computerdesk.
Honestly, i have no idea what COM or COM+ or DCOM has to do here in this thread, but for the sake of clarification
https://stackoverflow.com/questions/...onent-services
https://www.geeksforgeeks.org/differ...com-and-dcom/#
So in very short sentences, COM is Windows way to overcome compatibility and portability for code over many or any programming language.
COM+ is advanced COM with extra layer of security and authentication.
DCOM is Distributed COM, provide the ability be for COM+ to be called and executed remotely, and by remotely not only over wire or Internet connection but also on different users accounts and different session, different domains also supported...etc.
That is it.
Kas
  Mit Zitat antworten Zitat
Benutzerbild von paule32.jk
paule32.jk

Registriert seit: 24. Sep 2022
Ort: Planet Erde
356 Beiträge
 
Delphi 11 Alexandria
 
#38

AW: In Asm-Prozedur eine Exception auslösen

  Alt 11. Nov 2023, 10:15
Honestly, i have no idea what COM or COM+ or DCOM has to do here in this thread, but for the sake of clarification
This should be a Bonus Information, to keep in mind, that Microsoft Windows used "self references" its function references.
Don't make you hard on this. I don't can expect that you can understand all these things of Computers and the differences between the Calling Convention, ABI, and Operating interna of each one. Because all OS have it's own kernel behavior.

And yes, you can do INT'errupt on 32/64-Bit machines, but then, you have to switch from the 32/64-bit protected-mode into the 16-bit real-mode of the CPU. But doing this, you have to "store" all registers, before you switch, and after you switch back into 64-bit CPU mode, you have to "re-store" all registers to avoid crash or prompts of MAV's.
Frag doch einfach
Alles was nicht programmiert werden kann, wird gelötet
  Mit Zitat antworten Zitat
Kas Ob.
Online

Registriert seit: 3. Sep 2023
351 Beiträge
 
#39

AW: In Asm-Prozedur eine Exception auslösen

  Alt 11. Nov 2023, 10:49
@paule32.jk :
I am sorry for wasting your time.
Kas
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 4 von 4   « Erste     234   


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:07 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz