Re: How to get the body of a function/asm statement in hexadecimal

2023-01-29 Thread Ali Çehreli via Digitalmars-d-learn
On 1/29/23 14:19, max haughton wrote: > it is not trivial to find where the *end* of a > function is I suspected as much and did run ... > objdump ... to fool myself into thinking that 0xc3 was . Well, arguments e.g. pointer values can have 0xc3 bytes in them. So, yes, I am fooled! :) Ali

Re: How to get the body of a function/asm statement in hexadecimal

2023-01-29 Thread max haughton via Digitalmars-d-learn
On Sunday, 29 January 2023 at 21:45:11 UTC, Ruby the Roobster wrote: I'm trying to do something like ```d void main() { auto d = *d.writeln; } void c() { } ``` In an attempt to get the hexadecimal representation of the machine code of a function. Of course, function pointers

Re: How to get the body of a function/asm statement in hexadecimal

2023-01-29 Thread Ali Çehreli via Digitalmars-d-learn
On 1/29/23 13:45, Ruby the Roobster wrote: > Of course, function pointers cannot be dereferenced. Since you want to see the bytes, just cast it to ubyte*. The following function dumps its own bytes: import std; void main() { enum end = 0xc3; for (auto p = cast(ubyte*)&_Dmain; true;

How to get the body of a function/asm statement in hexadecimal

2023-01-29 Thread Ruby the Roobster via Digitalmars-d-learn
I'm trying to do something like ```d void main() { auto d = *d.writeln; } void c() { } ``` In an attempt to get the hexadecimal representation of the machine code of a function. Of course, function pointers cannot be dereferenced. What do? Furthermore, I would like to be able to