Peng Yu via llvm-dev
2019-Jan-30 15:42 UTC
[llvm-dev] Print void* pointer using !DI* information in human readable format
Hi, Given that the !DI* metadata is available in .ll file, I am wondering if there is a way to case any void* pointer appropriately according to the debug information and print the data pointed by the void* pointer in a human-readable format in C. I think that lldb should have some facility to do this. But I am wondering what is the best way to do it in C. Does anybody know? Is there a library to facilitate this? Thanks. -- Regards, Peng
via llvm-dev
2019-Jan-30 16:16 UTC
[llvm-dev] Print void* pointer using !DI* information in human readable format
> -----Original Message----- > From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Peng > Yu via llvm-dev > Sent: Wednesday, January 30, 2019 10:42 AM > To: llvm-dev > Subject: [llvm-dev] Print void* pointer using !DI* information in human > readable format > > Hi, > > Given that the !DI* metadata is available in .ll file, I am wondering > if there is a way to case any void* pointer appropriately according to > the debug information and print the data pointed by the void* pointer > in a human-readable format in C. > > I think that lldb should have some facility to do this.You should be able to cast the void* pointer to another pointer type and then dereference it. I personally am not familiar with lldb syntax but in gdb it would be something like "p *(other*)pointer"> But I am wondering what is the best way to do it in C. Does anybody > know? Is there a library to facilitate this? Thanks.Assuming you are writing a debugger or other tool to examine the state of a running program, LLVM's DebugInfo library might be helpful. --paulr> > -- > Regards, > Peng > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev