Recent

Author Topic: using debuginfo in own code -- RTTI  (Read 1155 times)

Eleazar

  • New Member
  • *
  • Posts: 26
using debuginfo in own code -- RTTI
« on: January 23, 2018, 11:23:02 pm »
Hello,

I am wondering: is it possible to call a function/procedure that displays the values and other info of a variable just like the debugger does in the 'yellow popup' when you hover over a variable?

Why I ask: I was working on code that uses RTTI to find the type of a record, fields in the record, values of these fields etc...With TypeInfo and GetTypeData and .ManagedFldCount I can get some info. However, the next step of reading the values becomes really unhandy by shifting the pointer based on the lengths of each type...
Then I thought:"Hey, when I hover over it, the debbuger shows all the info. Can I use this code?"

Thanks for your input!
Regards, Eleazar

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: using debuginfo in own code -- RTTI
« Reply #1 on: January 23, 2018, 11:32:05 pm »
Do you mean the code that displays the data (once available) in a hint? Or the code that gets the data?

As for getting the data:
The debugger does not use RTTI.

It uses either stabs or dwarf. The code for reading that is in gdb (written in C)

Well there is some code written in pascal.

unit lineinfo / infodwrf  can get linenumbers from an address.

In fpdebug is code that can read dwarf, and does read variables. It is only beta. And much still to do.

Of course that code could read the same exe, that it runs in. But in would be quite some work to get it there.

Eleazar

  • New Member
  • *
  • Posts: 26
Re: using debuginfo in own code -- RTTI
« Reply #2 on: January 23, 2018, 11:43:19 pm »
Thanks for your reply.
Do you mean the code that displays the data (once available) in a hint? Or the code that gets the data?
Yes, the data that is shown in the hint. I would like to use such data in my own program. (I want to iterate through fields in a record without beforehand knowing the names and types of the fields in the record). This should also work in a non-debug environemt of course.
From your comments I understand this is not some code written in Pascal..



 

TinyPortal © 2005-2018