gdb-python

gdb-python : Parsing structure's each field and print them with proper value, if exists

本秂侑毒 提交于 2019-11-30 15:50:33
I am writing a python script to automate debugging core dump from gdb. i am trying to print data structure which includes kernel data structures and lists(e.g. struct list_head). For example the structure is something like this: struct my_struct { struct my_hardware_context ahw; struct net_device *netdev; struct pci_dev *pdev; struct list_head mac_list; .... .... }; i am using following API tp print this structure: gdb.execute('p (*(struct my_struct *)dev_base->priv)') so i am able to print the content of 'struct my_struct' , struct my_hardware_context ahw, but not the content of pointers and

gdb-python : Parsing structure's each field and print them with proper value, if exists

丶灬走出姿态 提交于 2019-11-29 22:37:16
问题 I am writing a python script to automate debugging core dump from gdb. i am trying to print data structure which includes kernel data structures and lists(e.g. struct list_head). For example the structure is something like this: struct my_struct { struct my_hardware_context ahw; struct net_device *netdev; struct pci_dev *pdev; struct list_head mac_list; .... .... }; i am using following API tp print this structure: gdb.execute('p (*(struct my_struct *)dev_base->priv)') so i am able to print

How to script gdb (with python)? Example add breakpoints, run, what breakpoint did we hit?

给你一囗甜甜゛ 提交于 2019-11-27 11:58:45
问题 I'm trying to create a little unit test with gdb, for a embedded mcu that is controlled by OpenOCD (that gives me control over my target via a gdb server). So I would like to automate this with some scripting of gdb. I would like to write some kind of script for gdb that more or less does this: Add a couple of breakpoints Start the program When we stop, where did it stop (get the frame info) Quit. Any ideas? A example on how to do this in python gdb scripting would be nice. Thanks Johan Note

How to enable gdb pretty printing for C++ STL objects in Eclipse CDT?

拥有回忆 提交于 2019-11-26 07:25:37
问题 I\'m trying to add pretty printing for STL objects in eclipse cdt. I tried to follow the steps described here: http://sourceware.org/gdb/wiki/STLSupport I checked out the python folder, but I can\'t seem to get this done... I created a gdbinit and selected for my debug configuration, but whenever I try to start debugging I get the following error: Error while executing Python code. !STACK 0 java.lang.Exception: /home/lizardking/workspace/eu.sofia.kpi.cpp.x86.testapp/.gdbinit:6: Error in