127 questions
1
vote
1
answer
62
views
How can I resolve type traits in gdb Python API?
Consider a type like
#include <type_traits>
template<typename T>
struct Foo {
std::remove_cv_t<T> m;
};
which uses a type trait to deduce the type of one of its members from a ...
1
vote
0
answers
57
views
python gdb frame unwind does not recogonize structure member variables
I am trying to print the value of a member variable of a structure instantiated in the caller function as below. While the read_var on older() frame works for the structure variable itself, it doesn't ...
0
votes
0
answers
812
views
Issues Connecting Ghidra to GDBServer on Windows
all buttons non active
I'm trying to set up remote debugging for my application on Windows using Ghidra and GDBServer.
trying_connect_to_gdb
GDB successfully connects to GDBServer. However, when I ...
0
votes
1
answer
79
views
python gdb extension: i'm trying to get the calling line and file info for a macro call but getting wrong values due to comments
I have the following C++ code:
main.cpp:
#include "a.h"
int main(){
int x[3];
some_macro(x)
// comment
// comment
return x[2];
}
a.h:
template <typename T>
inline ...
2
votes
1
answer
168
views
Overwriting segfaulting instructions with NOPs doesn't fix segfault in gdb
I thought it would be cool to add a command to gdb that will look at the instruction pointer and overwrite the current instruction with NOPs. The idea being that if you are debugging, and your program ...
0
votes
0
answers
27
views
Why can't I connect gdb to the main function by running a python script
enter image description here
gdb opens a local file and points to mian function without using a script. I hope this script I wrote will point to main function as well,Another question is does gdb ...
0
votes
1
answer
270
views
Get the char* value with python gdb
With GDB and Python I tried to get the char* value on x1 register
python
a= gdb.execute("x/s $x1", to_string=True)
print(a)
end
But I got
0xbb4aaa: "SomeString"
I want to ...
0
votes
1
answer
3k
views
Apply material and texture image using python in blender 3.4
Code is working it is importing my files and exporting into .glb format
but issue when i open glb file it dose not contain texture image it shows grey...
here is my code
import bpy
import os
dir_path ...
0
votes
0
answers
128
views
writing a c++ script for using GDB commands and GDB results (like variable values) while running another c++ program
I need a c++ script to automate GDB debugging another c++ program. the c++ script has to be able to run gdb commands and get the results from it and use it inside the script to save variable values ...
0
votes
0
answers
62
views
setting command alias through python API in gdb
I have written a small python script that adds new commands to gdb and for others to use it, they can just source the python file in their ~/.gdbinit, but I would now like to add some useful aliases ...
0
votes
0
answers
177
views
Get source line of a struct definition in GDB python script?
There is gdb.lookup_type("SomeType") in GDB python API as listed blow, but I cannot find a way to get the source file and line number where the type is defined, much like what the GDB ...
0
votes
0
answers
162
views
Looking up templated type in gdb's Python
I've loaded up two versions of a C++ library in gdb, opened up the built-in Python interpreter, and run
import gdb
gdb.lookup_type('Foo<Bar>')
In one version, it works just fine. However, in ...
0
votes
1
answer
851
views
gdb-multiarch lx-symbols failed
I am trying to debug an aarch64 Linux kernel loaded in QEMU from x86 host. When 'lx-symbols' command executed for loading the symbols from gdb, it has shown
Undefined command: "lx-symbols"
...
1
vote
1
answer
219
views
How to implement a GDB function depending on the architecture
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 ...
0
votes
1
answer
565
views
gdb gef not working after fresh compilation of gdb 12.1 and gef 2022.06
I recently compiled gdb to 12.1 and attempted to install gef via the following cmd bash -c "$(curl -fsSL https://gef.blah.cat/sh)"
the code on line 52 in the image is import abc
the ...
2
votes
0
answers
153
views
Viewing Data in Python Extensions GDB
Suppose I have a class:
class RawMessage(NamedTuple):
data: Dict
timestamp: float
...
The keys and values in this dictionary are probably all integers, but I don't want to state that with ...
2
votes
0
answers
373
views
Put a breakpoint in shared library with GEF GDB
I want to put a breakpoint in a Linux share library in specific offset ( in libTest.so in function 0x1234 ) while I debugging with GEF GDB. But I want to put it with gdb script.
If I run vmmap ...
0
votes
0
answers
76
views
gdb: how to make a filtering query for displaying a structure in a container?
In gdb currently I can print the contents of a container, such as std::list, which contains a structure type. This type, however, is quite large and I need only values of some selected fields in every ...
0
votes
1
answer
317
views
How do I use the second Value constructor in gdb's python API?
In gdb's Values From Inferior documentation, there's a second constructor for creating objects within python. It states:
Function: Value.__init__ (val, type)
This second form of the gdb.Value ...
1
vote
0
answers
330
views
Debug symbols when using poetry install
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
2
votes
0
answers
232
views
How to get info from crash dump of python
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 ...
0
votes
1
answer
792
views
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 ...
3
votes
2
answers
1k
views
How to set a gdb breakpoint on a label in all template function instantiations
Suppose I have the following C++:
template <int I> int bar(int i) {
++i;
label1:
return I * i;
}
int main(int argc, char **) { return bar<2>(argc); }
Is it possible to set a gdb ...
2
votes
1
answer
1k
views
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 ...
0
votes
1
answer
371
views
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 ...