11,668 questions
2
votes
1
answer
74
views
How and why does my program change its input buffer? Using GDB to find out where. (Converting string to int in NASM x86 32bit)
%macro mov_dd 2
push eax
push ebx
mov dword eax, [%1]
mov ebx, [eax]
mov dword [%2], ebx
pop ebx
pop eax
%endmacro
section .data
text db "Enter first Number: &...
0
votes
1
answer
71
views
Unable to step into torch.nn.functional.linear using VS Code debugging
I want to step into the linear function using VS Code's step-in , but it skips automatically when I click "step into". Could anyone help me with this?
I used DEBUG=1 when compiling PyTorch.
...
2
votes
1
answer
85
views
Question about running GDB with stripped binary and debug symbol file separately
I wrote a simple example program as below and tried to debug using gdb.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
int function1(void)
{
...
0
votes
0
answers
135
views
backtrace_symbols can see the full stack but gdb backtrace can't
I have two separate c++ CMake projects, a library and an application. Both are build using in Debug mode with
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -O0 -fno-inline -fno-omit-...
2
votes
2
answers
211
views
Why GDB is unable to break on main()?
I am launching my a.out application manually by passing it as an argument to dynamic loader like below. My application is compiled in debug mode.
*gdb --args /lib64/ld-linux-x86-64.so.2 ./a.out
I am ...
0
votes
0
answers
54
views
GDB scripting, uiout, stream redirection, and suppressing text output of certain commands
I have a gdb debug function my_debug() in a gdb Python script, which I'd like to run while stopped at a breakpoint, but from different contexts/cases:
either by calling gdb in a sort of a batch mode (...
0
votes
0
answers
45
views
watching variables on vscode with gdb
I am debugging a VectorCAST environment on Windows (host x64, MinGW GDB 9.2) using VS Code with cppdbg.
When I try to watch a global variable (e.g., vcSlotIteration) through the VS Code Debug Console, ...
2
votes
0
answers
84
views
How to debug C++ code in a Python extension (VLLM) and speed up compilation?
I’m working with VLLM (open-source) which includes C++ extension code compiled for Python.
I installed it using
CXXFLAGS="-Og -g" pip install -e .
I want to debug the C++ code from Python by ...
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 ...
5
votes
2
answers
262
views
Function templates leave out debug lines
I am working in a codebase that makes heavy use of templates. This causes many issues with debugging, because the compiler leaves almost no debugging information behind to tie object code back to ...
2
votes
0
answers
103
views
Inspecting AddressSanitizer metadata in a core dump
Suppose I have a core dump from a program compiled with AddressSanitizer (ASan), as well as all relevant libraries and debug info, and suppose further that ASan was configured to record a full stack ...
0
votes
1
answer
70
views
How to read gs value in gdb?
I'm trying to debug a canary related issue,
0x080493c2 <+157>: mov eax,DWORD PTR [ebp-0xc]
0x080493c5 <+160>: xor eax,DWORD PTR gs:0x14
Now I need to read gs:0x14
(gdb) ...
2
votes
1
answer
134
views
How can a process be terminated if not by signal, normal termination (exit, _exit), or system calls to exit/exit-group on Linux?
Debug environment: Ubuntu Linux 24.04, VSCode, a c++ app being debugged using the VSCODE-hosted version of gdb (the default Microsoft-supplied C/C++ debugger).
I am trying to debug a problem in my app....
1
vote
1
answer
80
views
Cygwin GDB not working under Codeblocks, (error 2: The system cannot find the file specified.)
The title says it all.
This question is quite the same with this question. However, the difference is that now it is 2 years and 4 major versions of cygwin gdb later. I want to believe that keeping ...
0
votes
1
answer
212
views
Launch.json set up for VSCode debugging on qemu within docker container
New to docker/qemu/gdb.
I am able to "make debug" and "make gdb" and debug from CLI. However, I got an error (no executable specified) when I try to use VSCode debugger to attach ...
0
votes
0
answers
38
views
How to prevent OpenOCD or GDB from overwriting Cross Trigger Interface configuration when starting cores?
I have programmed the Cross Trigger Interface (CTI) to halt multiple cores simultaneously during debugging using OpenOCD. This setup works fine initially, but when I start some cores using GDB, it ...
0
votes
0
answers
43
views
Use variables in monitor command
I am trying to automate something in gdb: I want to call monitor rtt setup <addr> <size> with the appropriate values from the _SEGGER_RTT symbol.
This works when I do it manually, but I ...
1
vote
1
answer
446
views
Unable to start debugging. Unexpected GDB output from command "-exec-run"
On a pristine new Windows 11, installed Visual Studio code, MSYS2(ucrt64), and under it: base_devel, gcc, gdb, cmake. In Visual Studio code when first opening a .cpp file I accepted its advice to ...
0
votes
1
answer
56
views
GDB not detecting GLib auto-load python scripts
Following this article, GDB is installed in the same prefix as glib (I'm using official distro packages. However, when I run info auto-load python-scripts, I get No auto-load scripts. I have enable ...
0
votes
0
answers
57
views
How can i debug my graphics DJGPP programs?
Debugging in MS-DOS is one of the roadblocks that i have with MS-DOS programming, i'm using DJGPP and i have no complaints with it's gdb debugger, but the issues lies with the fact that once i turn on ...
0
votes
0
answers
53
views
Question on gdb integration flow in vscode for C++ application on Linux
I moved from emacs to VS Code few months back. We have a large C++ code base. In emacs, I used to debug using gud-gdb interface. However, I have not been able to successfully setup gdb with vs code.
I ...
1
vote
0
answers
89
views
How to print a variable and set its value without casting its type
been using gas assembler and here is code below that moves a data between register and memory
3 .section .data
4 constant:
5 .int 10
6
7 .section .text
8 .globl _start
9 ...
0
votes
0
answers
56
views
How to debug QEMU live migration with GDB without causing the destination VM to hang?
I'm trying to debug the QEMU source code to track dirty page updates during live migration. My goal is to inspect the behavior inside functions like cpu_physical_memory_set_dirty_lebitmap() on the ...
0
votes
0
answers
37
views
GDB use interactively AND dump a core file [duplicate]
Is there a way to instruct GDB to still dump a core file, even when being used interactively?
I'm trying to find something for the init/config file
0
votes
0
answers
94
views
gdb + vscode + windows: type not supported, extension doesn’t fix it
I am trying to set up debugging for C++ with GDB or LLDB in a Windows VM running via Parallels on a Mac. Here's my launch.json. When I press F5 I always get the message, "Configured debug type '...