I am writing a python(v2.7) script in GDB(v7.5.1-0.7.29). I want to quit the python script when certain condition got false. But i do not want to quit GDB. I tried using sys.exit(), exit() and quit(), but in those case they also quit GDB. Is there…
I have a struct in C++ something like this:
struct HeapBlock {
char* data;
}
struct DataBlock {
int size;
HeapBlock hb;
}
These are part of a framework and have several other members, helpers and so on, but these are are the important…
Can't we traverse the array of structs ? I mean for each index by checking the content of structs and print each field accordingly? As we can do for a struct like
s = gdb.parse_and_eval(expr)
for k in s.type.keys():
v = s[k]
if…
I am working on a project where I need to track changes to particular set of variables in any given application code to model memory access patterns.
I can think of two approaches mainly, please give your thoughts on them.
My initial thought is…
Rust recently introduced #![debugger_visualizer(gdb_script_file = "...")] to allow embedding GDB pretty-printers in libraries.
I'm playing around with this feature, with not that much knowledge in GDB pretty-printers in the first place, and I'm…
there may very well be an answer to this question, but it's really hard to google for.
you can add commands to gdb by writing them in python. I am interested in debugging one of those python scripts that's running in gdb session.
my best guess is to…
What I'm trying to do is ask the user for a type of math operator(Not sure if I used the correct term. I'm new to python.), and use that in place of a math operator in an equation.
Here I tried:
math_thing = int(input('Enter a type of math…
I'd like to call print('somestr') in a python script called in GDB ((gdb) source my_script.py), and style the output in console colors. I tried the python colorama package which works in terminal, but not when invoking from GDB. Is there a way to…
I'm writing a GDB script in python to print some debug information of the application. The thing is multiple architectures are supported: x86, alpha, aarch64, and probably some more later. The function printing the debug information varies from the…
I need to run gdb with python script, like ~/.gdb/qtprinters.py which require a high version
python.
our system gdb use default python version 2.7 and I installed a new gdb in my home with version 12.1 and also install an anaconda3 tool, but seems I…
I have a few complex classes generated by a third party domain-specific tool. The classes are complex because the tool tries to be generic as much as possible, so that I was asked to design a GDB pretty printer python script to improve the debugging…
Can I install a python package with binary extension compiled with debug symbols when using poetry? For example, this way a gdb or py-spy will get the necessary pretty-printing output
I have a python server running (cherrypy webserver). When a URL /a is hit, it uses ctypes to call a C library function. The library function is causing a seg-fault which results in the python server crashing and generating a 250MB crash dump.
If I…
I'm trying to find a way to get a list of members of a c++ class object from the python api in GDB.
So far, the only solution I've been able to find has been to use the ptype and then try to parse it for the members, and I was wondering if…
I'm writing some specialized gdb scripting in python, and I have some questions about the gdb.Type class. I see a lot of methods for producing related types, like Type.const and Type.volatile, but how do I examine a Type instance, and ask "is this…