Question

I am trying to write a pretty print routing for dbx on solaris to pretty print maps. Now the maps may contain elements of (one) arbitrary type. I dont want to know what they are or handle that. I want to let dbx itself figure out how to print them. I just want to iterate and print keys and values in [key,value] format. But i cant figure out how to call back dbx'es print routines from db_pretty_print. Any ideas ? Thanks.

Was it helpful?

Solution

I don't think you can integrate with db_pretty_print to do what you want. I would suggest you write a function inside your program which can return a character string containing the hex addresses of the objects you want to print. Inside dbx you can write a shell function which calls your "enumerator" function, then the shell function can split the string, and iterate through the addresses, and apply the dbx print function. I'm assuming you'll tell dbx to use the C++ RTTI information to dynamically choose the right type for purposes of the print command. For a C or Fortran program, I don't know how to make dbx dynamically choose the right type for printing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top