Skip to main content

Questions tagged [gdb]

The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages.

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 views

Missing symbols for libraries when attempting to perform analysing of core dump

I'm trying to analyze core dump files of the systemd process, but encountering errors due to missing symbols. Can anyone advise what debug symbols need to be installed to successfully analyze these ...
supmethods's user avatar
0 votes
0 answers
27 views

GDB 'section' command doesn't seem to work as expected

As I understand it, the section command can be used to tell gdb that a specific section of the object file is loaded in a specific address. In my understanding this should also entail relocating all ...
ariel marcovitch's user avatar
1 vote
1 answer
118 views

Bus error (core dumped) on several apps

I'm encountering a weird behaviour with my endeavourOS system. For context, it seems to have started happening after a malformed svg file made inkscape and my system crash, after which I needed to ...
CrunchySlime's user avatar
0 votes
1 answer
17 views

Pass Enter key to dist-upgrade's prompt, running inside a GUI terminal on a remote machine, accessible henceforth only over SSH

I earlier had RDP access to a remote machine (a typical physical desktop PC) using which I launched a sudo apt dist-upgrade inside a GUI gnome-terminal. Since then I have lost the RDP connection and ...
lineage's user avatar
  • 113
1 vote
0 answers
34 views

NetBSD - how to display information about kernel memory in GDB?

I'm debugging the NetBSD kernel with gdb, but I would like to be able to display information about the memory region an address is in. I'm mainly interested in finding out the permissions of a page of ...
Isaac's user avatar
  • 111
1 vote
1 answer
127 views

Permission denied when opening a file in gdb

I'm implementing some CTF challenges. The flags are in some text files, that get read from the programs. To protect the flags I have changed the owner of the files, but have set the setuid to the ...
r3k0j's user avatar
  • 15
1 vote
1 answer
122 views

How can I break at module_init()? This loadable kernel module is preventing SSH logins

I am porting the driver for a USB device to Rocky Linux 9.3. Once the module is inserted, new logins by ssh are unresponsive. Blacklisting the module and rebooting restores normal functionality. ...
William Dickerson's user avatar
0 votes
0 answers
84 views

How to debug a binary file with gdb

I currently have a binary program that usually ends locking up after some time using. I can cause it when clicking on the bar on the right side of the screen and moving it swiftly with mouse's left ...
user2752471's user avatar
0 votes
0 answers
16 views

httpd crash with ssl_io_filter_cleanup () from /usr/lib64/httpd/modules/mod_ssl.so

version: httpd-2.4.54-1.el8.x86_64 Core generated when i do httpd condrestart for a task and also i can see some ssl_error_logs which is related to the core file pid. gdb logs: Core was generated by `/...
Bhanuchander Udhayakumar's user avatar
2 votes
0 answers
502 views

How to suppress "Failed to set controlling terminal" warning in GDB when setting program to run on another terminal?

I'm using GDB to debug a program, and I want to direct its output to a different terminal than the one where GDB is running. Here's what I've been doing: Open a second terminal, check its device name ...
Sebastian Carlos's user avatar
0 votes
0 answers
74 views

how to use non-stop mode of gdb to debug linux kernel using qemu

I am using qemu and gdb to debug the Linux kernel. I wanted to stop one thread while letting other threads continue running. I found that there is a command called non-stop in gdb which can help me ...
plznobug's user avatar
0 votes
0 answers
85 views

How to debug bzImage's decompress?

I already know that vmlinux is needed when debugging the kernel through gdb. But I need to debug the decompress and EFI entrypoint of bzImage. In this case, how can I debug bzImage with gdb? Currently,...
user212942's user avatar
0 votes
0 answers
196 views

Debugging memory leakage: No backtrace saved in core dump after segmentation fault

I am working on an embedded Linux system (kernel-5.10.186), and I want to debug a memory leakage in a program. With pmap -x PID, I found the process's heap is increasing consistently. To figure out ...
wangt13's user avatar
  • 443
0 votes
1 answer
191 views

Debugging the Linux kernel using QEMU + (K)GDB -- some doubts and queries

I'm trying to debug the Linux kernel (v3.13) via QEMU. I am using this, this and this as reference. Since my host is Linux Mint Victoria, it was too much of a hassle trying to compile the kernel as ...
Skegg's user avatar
  • 121
0 votes
0 answers
120 views

Gdb stuck in tty

I'm trying to debug Hyprland and running it with gdb completely freezes all keyboard input and forces you to restart the computer. You can't Ctrl+C or Ctrl+Alt+F[1-6] to get away. It's completely ...
Daniel Krajnik's user avatar
-1 votes
2 answers
121 views

How can we edit the source code of GNU's gdb debugger?

I am on a Linux(Ubuntu 22) machine with gcc installed. We know that gcc comes with gdb as debugger. There are many commands in gdb and I want to change the behaviour of some inbuilt commands(disp). ...
Matthew kale's user avatar
0 votes
0 answers
24 views

gdb watch a expr in a loop

code snippet: foreach(lc, vars) { if (IsA(lfirst(lc), Var)) { Var *var = (Var *) lfirst(lc); /* if system column, return error */ if (var->varattno < 0) ...
jian's user avatar
  • 577
0 votes
1 answer
576 views

gdb print out a pointer is null or not

source:https://git.postgresql.org/cgit/postgresql.git/tree/src/backend/optimizer/plan/planner.c (gdb) n 3556 if (root->group_pathkeys) (gdb) s 3558 else if (root->...
jian's user avatar
  • 577
0 votes
0 answers
47 views

Same binary & different permissions, How can it be?

I was doing a pwn ctf and found a weird situation. The ctf includes binary file and a server. There is a given elf 64 bit. checksec output (same local & server). Arch: amd64-64-little RELRO: ...
Ori's user avatar
  • 1
0 votes
1 answer
59 views

gdb execute through to a specific function

https://git.postgresql.org/cgit/postgresql.git/tree/src/test/modules/delay_execution/delay_execution.c https://stackoverflow.com/questions/11967440/stepping-into-specific-function-in-gdb I loaded the ...
jian's user avatar
  • 577
0 votes
0 answers
122 views

Unable to break to libc function from gdb

Target: gdbserver --wrapper env "LD_PRELOAD=/test.so" -- :1234 /bin/true Debugger: # gdb-multiarch -ex 'set arc arm' -ex 'target remote :1234' ... For help, type "help". Type &...
user212942's user avatar
0 votes
1 answer
167 views

How to debug (gdb) a binary that is invoked with xvfb-run?

I have a binary that I usually run as follows: $ xvfb-run ./bin --param1 foo However, now that I need to debug it using GDB, I'm not able to do: $ gdb --args xvfb-run ./bin --param1 foo because &...
albertoperdomo2's user avatar
1 vote
1 answer
278 views

quick-swap TUI mode while using vi keybindings in GDB

In the default mode of gdb, pressing ctrl+x a turns on and off the UI, and ctrl+x 2 cycles through different split views. There are a number of similar useful shortcuts. I can turn on vi emulation ...
Fraser's user avatar
  • 111
0 votes
1 answer
373 views

How can I remotely debug linux module using GDB?

I searched all over the internet but couldn't find proper steps to debug linux module remotely using gdb. I am tring qemu but facing many issues there. Is there any other tool that I can use or if not ...
Sumit Patil's user avatar
1 vote
1 answer
675 views

GDB fails to download debuginfo for math.h

I have a simple clock program that uses math.h functions. I am currently on Kubuntu 21.10, the GCC version is (Ubuntu 12.2.0-3ubuntu1) 12.2.0, and the GDB version is (Ubuntu 12.1-3ubuntu2) 12.1. The ...
Lakshay Rohila's user avatar
1 vote
1 answer
215 views

Iterate through files and excute gdb command for each file in bash scripting

I'm trying to find a files with name and copy it into one text file using bash scripting What I need to do is I want to add one more command to it so that it is iterate through these files and execute ...
Angela's user avatar
  • 11
0 votes
1 answer
773 views

Finding the address of an environment variable with and without GDB

I am trying to do an exploit, which spawns a shell, the shellcode is inside an environment variable and I launch the program or GDB with a clean environment so the variable is at the top. env -i MYVAR=...
Josh's user avatar
  • 3
0 votes
2 answers
2k views

Permission error when attaching GDB to PID of running process

I have such a toy C++ program #include <iostream> int main() { int n{}; std::cin >> n; // waits for input std::cout << n << std::endl; } which pauses upon ...
Enlico's user avatar
  • 1,677
1 vote
1 answer
65 views

Start GDB with No Help Information

Every time I start gdb, the following information is displayed: GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &...
Ziqi Fan's user avatar
  • 237
1 vote
1 answer
583 views

How to install gdb with no package manager?

I'm trying to reverse engineer some software on a system that runs embedded Linux. I've ssh-ed into it, and right now I'm trying to attach gdb to one of the processes so I can get some information on ...
Josh Tint's user avatar
0 votes
0 answers
325 views

debugger as a tool to get to root shell

according to the answer in the reference: Can gdb debug suid root programs? Claims that: "You can only debug a setuid or setgid program if the debugger is running as root. The kernel won't let ...
linuxbeginner's user avatar
5 votes
3 answers
23k views

How to Set up Environment Variables in "launch.json" Configuration When Using GDB Integration in VS Code

I have a setup in launch.json for vscode as follows: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information,...
Ziqi Fan's user avatar
  • 237
0 votes
1 answer
316 views

calling vim with mpiexec says "Warning: Output is not to a terminal / Warning: Input is not from a terminal"

My question is a bit technical. For specific reason, I need to call vim after mpiexec. Example : mpiexec -n 1 vim mytext.txt But this gives the following warning message: Vim: Warning: Output is not ...
Kiven Jecquas's user avatar
2 votes
0 answers
336 views

Debug & analyze pthread_mutex_lock issues

I've being recently facing some hardcore issues with Mutex lock for Linux, notably MySQL, memcache & APCu. Example: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting ...
Wiika's user avatar
  • 121
1 vote
1 answer
709 views

What does debug symbol actually mean on Arch linux for gdb debugging?

P.S. English is not my native language; please excuse typing errors. I've (maybe) understand the basically main idea of symbol in ELF file in dynamic link. Refering to textbooks, if I need dynamic ...
KSroido's user avatar
  • 25
1 vote
0 answers
332 views

Is it possible to get each thread's `comm` from a core dump with gdb?

I wrote a C program that uses multiple threads. For convenience I set the threads comm to some individual value for each thread, and that even might change depending on the state of the thread (a bit ...
U. Windl's user avatar
  • 1,493
3 votes
2 answers
3k views

How can I get glibc/libstdc++ sources and set them up for gdb to find?

I'm debugging this program which raises an exception. This makes my debugger look for some source code, e.g. ../sysdeps/unix/sysv/linux/raise.c - and fail to find it. Now, I realize it's not necessary ...
einpoklum's user avatar
  • 9,653
1 vote
0 answers
351 views

Can't compile linux kernel with -Og/-O0 option for debugging purpoces

Having custom hardware running embedded Linux (OpenWrt) like a charm. CPU - is IMX6ULL (ArmV7) so it is supported by Jlink to debug over JTAG interface. Starting GDB server and step by step debugging ...
user3583807's user avatar
1 vote
1 answer
546 views

How to have gdb start in vi mode by default?

I know that I can use CTRL+ALT+J in gdb to get vim keybindings but how do I get gdb to start in vi mode by default ?
cassepipe's user avatar
  • 179
0 votes
1 answer
437 views

How to catch and break on a Fortran 90 runtime error in GDB?

Is it possible to have Fortran 90 break at a runtime error in GDB? I show here a MWE for a simple routine test.f90 which throws an out of bounds error: program main implicit none integer ...
tdstoff's user avatar
0 votes
3 answers
496 views

GDB Disassemble: Print only raw binary data (using column and awk)

I'm trying to get only the raw binary data from the gdb disassemble output. My current output is the following: $ gdb -batch -ex "disassemble/r btif_set_adapter_property" libbluetooth_qti.so ...
dtrunk's user avatar
  • 103
0 votes
1 answer
675 views

Two processes mapped in the same address space

I have noticed that when I open two processes with GDB for debugging, /proc/PID/maps indicate the same address regions for the two : cat /proc/4170/maps 555555554000-555555555000 r--p 00000000 08:01 ...
Aramya's user avatar
  • 1
1 vote
1 answer
415 views

How to kill an orphan Terminal process

I have a java program that executes several shell files (one by each iteration). The shell file only has one command, start cross-gdb with a path to a gdbinit file. The program works fine, but (from ...
husin alhaj ahmade's user avatar
5 votes
2 answers
3k views

GDB Installed From homebrew on macOS Big Sur Fails to Load Symbols From elf32-i386 Binary

for the past little bit I've been slowly working on developing a hobbyist kernel, and for all that time I've been using GDB with QEMU to investigate memory locations and registers and what not. ...
aurxenon's user avatar
1 vote
0 answers
3k views

Ptrace: Function Not Implemented in GDB Installed on Multiarch/Qemu-User-Static Arm64v8/Alpine Docker Container

I want to debug an aarch64 ELF using GDB installed on an arm64v8/alpine docker on my x86_64 16.04 Ubuntu VirtualBox, which itself is installed on my Mac. In particular, to set up the docker I use the ...
Newbie's user avatar
  • 135
0 votes
1 answer
1k views

Emulating an AARCH64 Binary calling libgps on x86_64 Ubuntu using QEMU gives "Error relocating: symbol not found" Errors

This is similar to the issue posted here and here. I want to reverse engineer a binary called gpslogger but before debugging it using GDB, I wish to simply emulate it using QEMU (qemu-aarch64) since ...
Newbie's user avatar
  • 135
1 vote
0 answers
138 views

I'm having a hard time getting gdb to work on mojave

I'm running Mojave on my Macbook pro. I've installed gdb 8.3 via brew. I've codesigned it following the instructions given in https://sourceware.org/gdb/wiki/PermissionsDarwin I've also turned system ...
Richard Gostanian's user avatar
4 votes
1 answer
1k views

How to debug Linux kernel with JTAG + GDB?

I've successfully established a JTAG connection and serial port connection to my development board. I've followed the below diagram (with a little bit of difference). my GDB_client is on my Linux host ...
Mahyar Shokraeian's user avatar
0 votes
0 answers
310 views

How to debug a cpp file that's part of a so file in the software?

So I have this software which has multiple .so files. For one of the so file and I made some changes to the code but I want to see the line by line execution of file present in the so file. Just to ...
Himanshuman's user avatar
1 vote
1 answer
1k views

The memory dump of a process by using GDB inside a bash script - errors, problems

I want to dump some program's memory segment to a file. Because the working time of my program is milliseconds, I use named pipe to stop its execution and dump its memory content by gdb meanwhile. The ...
MiniMax's user avatar
  • 4,153