Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a query interface? #37

Open
diguasange opened this issue Oct 12, 2023 · 2 comments
Open

Add a query interface? #37

diguasange opened this issue Oct 12, 2023 · 2 comments

Comments

@diguasange
Copy link

Perhaps ddbug can provide a interface to query the given struct/union, such as:

typedef struct xxx{
int aa;
int bb;
}xxx_tag;

Input the xxx/xxx_tag,ddbug can output struct info like this:

type xxx_tag = struct xxx
size: 8
members:
0[4] aa:int
8[4] bb:int

And if there is a struct-nesting, also output nested structs info.
Even support multi-threads to query, ddbug can be a great tool for debugging.

@philipc
Copy link
Collaborator

philipc commented Oct 12, 2023

For the command line, filtering by name works already:

$ target/release/ddbug.exe target/debug/ddbug.exe -c type -f name=_IMAGE_FILE_HEADER
struct _IMAGE_FILE_HEADER
        size: 20
        members:
                0[2]    Machine: WORD
                2[2]    NumberOfSections: WORD
                4[4]    TimeDateStamp: DWORD
                8[4]    PointerToSymbolTable: DWORD
                12[4]   NumberOfSymbols: DWORD
                16[2]   SizeOfOptionalHeader: WORD
                18[2]   Characteristics: WORD

I can see it would be useful to add the ability to recursively print anything referenced by the selected items though.

The http interface doesn't have a search function, but it still needs a lot of improvements in general anyway. However, if we did add searching to it then you could click through to see the referenced items.

I'm not sure what you mean by supporting multi-threads to query. Do you mean for calling the parser crate from your own program?

@diguasange
Copy link
Author

Yeah, I search a structure info by using ddbug executable file in my own program, and return the result. But when there are too many query requests, processing will be slower, especially when there is nesting.
So if there is a way to provide .so or dll libraries, I can query the info by using multi-threads to improve query speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants