Questions tagged [gdb-python]

Questions related to GDB's Python API.

Questions related to GDB's Python API.

121 questions
0
votes
1 answer

Makefile : no rule to make target '/constants.py.in' needed by '/constants.py'. Stop

i'm currently working on an ubuntu 18.0.4.5 machine and i've been trying to figure out the whole kernel debugging process. I've stumbled upon the need to auto run GDB scripts along with the vmlinux file, particulary the script residing under…
0
votes
0 answers

executing a function in the inferior process, and getting the returned result to python

As mentioned in a previous question (How to examine a gdb.Type) I'm writing some specialized gdb scripting in python. I want to call a function pointer, obtained from the inferior process, on a value, also obtained from the inferior process, and get…
0
votes
1 answer

Can't insert hardware breakpoint with GDB

I tried to set watch into address (gdb) watch 0x7536546 but I got an error Warning: Could not insert hardware watchpoint 6. Could not insert hardware breakpoints: You may have requests too many hardware breakpoints/watchpoints That the first…
MicrosoctCprog
  • 460
  • 1
  • 3
  • 23
0
votes
2 answers

Unload source file with GDB

(gdb) source script.py loaded script file to GDB How to unload that script? How to unload all loaded script or view all script that loaded ?
user13145920
  • 179
  • 1
  • 9
0
votes
1 answer

Run python script with gdb with alias

When I want to run python into gdb I using source /tmp/gdb/tmp/parser.py Can I set an alias so in the next time I want to call this script I use only parser.py or parser (without setting the script into working directory How can I pass args to…
MicrosoctCprog
  • 460
  • 1
  • 3
  • 23
0
votes
0 answers

What is the purpose of Embeded code under share tab in GDB

In GDB online debugger, when I click on the "Share" tab, 1st option is: shareable link 2nd option is embedded code What is the purpose of the embedded code?
hayat
  • 3
  • 2
0
votes
1 answer

Can I define a gdb command that works with pointer or object?

Suppose I create a gdb user-defined command like this: define pfoo call foo_printer($arg0) end where foo_printer takes a pointer argument. Then if I have a pointer variable pf I can do: pfoo pf But if I have a non-pointer variable f, I need to…
John H.
  • 1,551
  • 1
  • 12
  • 18
0
votes
1 answer

Building gdb 10.1 from source with custom python

I'm trying to build the latest gdb 10.1 from source. [My reason for wanting to do it is that I'm trying to debug a program that links to a custom build of Python 2.7.18, and my system gdb was linked to the build of Python 2.7.5 in my /lib64…
Eos Pengwern
  • 1,467
  • 3
  • 20
  • 37
0
votes
0 answers

How to debug python source code using GDB in Cygwin for Windows 10 (x64)

I usually code in python and I need a debugger. I chose GDB as it also helps in debugging my c++ applications. i have read the python documentation on GDB debugger but it isn't clear to me still. i had cygwin installed and with it i have also…
Saaransh Garg
  • 156
  • 1
  • 16
0
votes
1 answer

using gdb python api, how to fetch the value of a c variable during debug session

I am new to gdb python api. But I am not sure how can I get the get the value of a particular variable during the debug session import gdb print("Import Sucess") gdb.execute('b 36') gdb.execute('r') gdb.execute('stepi') #o=gdb.parameter('print…
0
votes
1 answer

Intel Pin GDB Runtime Overhead

I am running a Python gdb script on a program that runs with a Pintool. Specifically, I used the -appdebug_enable switch and created a semantic breakpoint in the Pintool that automatically triggers the breakpoint and runs the Python script that I…
vanbastelaer
  • 368
  • 2
  • 15
0
votes
1 answer

passing c++ variables to python via gdb

I am developing/debugging a c++ code which extensively uses c++ STL vectors and blitz cpp arrays (vectors/arrays are multidimensional, upto 4D/5D arrays) I am currently using cout/print to log the outputs of inputs/outputs of functions but it is…
CutePoison
  • 131
  • 1
  • 6
0
votes
0 answers

GDB Python: Parsing field name for structure array

Can anyone please explain how can i parse array of structure for getting fields of structure. Using script mentioned in this gdb python : Can anyone explain me how to use this script written in this post? Trying to parse below structure: typedef…
0
votes
2 answers

CUDA/PyCUDA: Diagnosing launch failure that disappears under cuda-gdb

Anyone know likely avenues of investigation for kernel launch failures that disappear when run under cuda-gdb? Memory assignments are within spec, launches fail on the same run of the same kernel every time, and (so far) it hasn't failed within the…
Bolster
  • 7,460
  • 13
  • 61
  • 96
0
votes
1 answer

Determining whether a C struct is packed or not

I'm extracting C struct layout from and executable using gdb-python. I manage to get all the fields, offsets, types & sizes. Still, when trying to re-generate the struct's code, I do not have any indication for whether it was marked with GCC's…
Uri Hoenig
  • 138
  • 6
1 2 3
8 9