11,670 questions
1
vote
0
answers
51
views
How to debug data label in bootloader
Here is context of my work how to get IDT handler address in assembly In order to confirm that I am calculating correctly the IDT handler offset high part, I created this simple bootloader and I want ...
4
votes
1
answer
198
views
Is it possible to know if the debugger is running free or not?
I find hard to explain myself, so i'm starting with my specific need as example and then asks for a more general question.
I have some functions which are dependent of time passed from the last call, ...
7
votes
1
answer
181
views
Reproducing buffer overflow
Trying to reproduce buffer overflow on Ubuntu 24 for learning purposes.
So the goal is to call call_me_twice second time by passing its address into input string.
$ cat bof.c
#include <stdio.h>
...
3
votes
1
answer
118
views
GDB "disassemble" /m and /s flags do not work when specifying address range
I want to automate disassembly generation with GDB, and in the end I settled on disassemble function. I also want to print it with source code added, which can be achieved with /s or /m command. ...
6
votes
1
answer
155
views
What is the purpose of the k0, k1, ... k7 registers?
I am debugging a simple program that prints the string "Hello, world!" three times. In the information about the registers that the gdb program gives, with the command info register, appear ...
0
votes
0
answers
108
views
Having gdb on the host mirror an embedded display and how the target side needs to modify its print function
I have a 128*64 bits monochrome display on my target. gdb controls this, and it runs on the host.
On the target I have the printf statements that are then echoed in the debug window on the host.
But I ...
-2
votes
2
answers
97
views
Application crashes after SFTP operation, GDB & Valgrind show double-free in MySQL result cleanup [closed]
I’m dealing with a repeated crash in a custom Linux application and hoping to get advice or confirmation or suggestion on the root cause.
The application connects to an SFTP server, downloads a daily ...
-3
votes
1
answer
121
views
Why is gdb showing the wrong function name?
In below Cortex-M7 startup assembly, the bl SystemInit is in the Reset_Handler symbol on line 179.
I assemble it with --gstabs to generate debug information.
I launch the QEMU with -S option to stop ...
2
votes
1
answer
97
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
80
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
2
answers
192
views
How to debug external program run in main function in C?
I want to add a breakpoint in the line system("/path/to/world") in VS Code for debugging the /path/to/world program with gdb.
Here is the source code of /path/to/hello.c:
int main(int argc, ...
2
votes
1
answer
100
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)
{
...
2
votes
2
answers
159
views
Location of the first value pushed onto stack in assembly (x86 I386 assembly) (gdb) (AT&T)
Consider the assembly program below:
.section .data
.section .text
.global _start
_start:
pushl $85 #make it obvious in memory
popl %ebx
movl $1, %eax
int $0x80
It ...
0
votes
0
answers
154
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
1
answer
260
views
Input/output error message when running programs in GDB
I'm running a Linux container via Docker on a MacBook M1 running Tahoe (macOS 26.0.1). Following the appendix for setting up GDB in the back of the book I'm using, I start by typing in GDB on the ...