Questions tagged [gdb]

The tag has no usage guidance.

35 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
146 views

Interrupt a slow gdb command?

I unwisely asked gdb to list all defined functions. (gdb) info function Now it is excitedly slurping up CPU and memory. If I'm really quick about it, GDB will stop with Ctrl-C and give me a prompt ...
4
votes
0answers
333 views

gdb hangs on “quit()”

When I want to close gdb, I frequently mistype quit() instead of quit Whenever that happens, gdb hangs indeterminately, and I end up using kill -9 gdb_pid to terminate it. I would like to ask: ...
3
votes
1answer
267 views

Accessing memory mapped registers in gdb

I'm trying to read (hopefully write as well) to the memory mapped hardware registers in a qemu virtual machine using gdb (remote connected). But it's just not working: (gdb) p *0x2000000 Cannot ...
3
votes
0answers
98 views

kgdb not returning control to gdb

I've compiled a kernel with kgdb support and I'm trying to debug it. I have two machines running, a debug machine (running the kgdb kernel) and the machine I'm using to debug it. They are connected ...
2
votes
0answers
129 views

Is there anyway to verify validity of dlopen handle?

In my case after my program cas dlclose program is crashing and I am not getting stack trace for dlclose or any function on upper frames. I know handle value of dlclose . Is there anyway to check if ...
2
votes
0answers
483 views

How to trace at runtime the symbols of loaded shared library?

I want to be able to know what are the symbols that are used from a certain shared library at runtime. I use gdb and I set the solib-search-path to the user defined shared library. I am not sure if ...
2
votes
0answers
72 views

separate debug-info files in FreeBSD

In GNU/Linux, there are debug-link and build-id sections in ELF files which shows separate debug-info files name or CRC32 [https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html]. There ...
2
votes
0answers
738 views

Why would gdb ignore Control C

Centos7, gdb 'GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7'. Here's what I do: I use gdb -p to attach to a process. Set a breakpoint 'c' Now, I realize that I should have set two breakpoints....
2
votes
0answers
107 views

How can you annotate or club info into ELF core files on Linux?

For debugging core files it would be useful to add additional information into a core file at the time it is generated. I'm currently using /proc/sys/kernel/core_pattern to run a 'dumb' script that ...
1
vote
0answers
424 views

Given a core-dump, how to get the files opened by the late process?

Answers to related questions all suggest using lsof or checking under /proc/NPID/, which is not helpful for when the process is already gone and only its core-dump remains. However, it should be ...
1
vote
0answers
68 views

Redirect the output to an already running program

I have a program running on terminal 1 and waiting for input from stdin. I programmed this program so it is vulnerable to buffer-overflow. I want to change it's flow to function2() within the program ...
1
vote
0answers
83 views

How to run GDB in backround and bring it back?

I'm writing bash scripts that launch a test scenarios: several programs that connect to each other. If something crashed, I'd like to have a GDB command line. Looks something like that: myprogram &...
1
vote
0answers
550 views

How to gracefully exit Qemu VM with running kernel

To make sure that my prerequisite knowledge is even correct, I'll first explain what I'm doing (or think that I'm doing). I'm going through a tutorial on running a Yocto Linux kernel inside the Qemu ...
1
vote
0answers
1k views

Linux Kernel module Remote Debugging with GDB + KGDB, Remote 'g' packet reply is too long

I am trying to remotely debug Linux Kernel and I am having issues. My setup: Target machine with Ubnutu Linux with my custom kernel 4.3 which I built with debugging information and KGDB. ...
1
vote
0answers
242 views

Setting breakpoints remotely with gdb/gdbserver

I'm debugging a vulnerable app on a remote host. I've set up gbserver on the host with: gdbserver host:1234 /my/target/app On my local host I've connected with: $ gdb /same/target/app gdb$ target ...
1
vote
0answers
847 views

How to debug a semop failure?

Using a 2.6.30-gentoo-r4 Linux a very complex system of php code is executed (with 4.4.9-pl0-gentoo and 5.2.10-pl0-gentoo), which occasionally runs into a semaphore blocking problem. The call to the ...
1
vote
1answer
2k views

Error installing gdb-arm-linux-gnueabi

I get an error when I try to install the gdb-arm-linux-gnueabi package. This is the error that I obtain when I run apt-get install gdb-arm-linux-gnueabi: $ env LC_ALL=C sudo apt-get install gdb-arm-...
0
votes
0answers
11 views

How to edit function from import table in process with gdb

How can I edit function from import table of process to invoke to another address. For example , my process has fopen function in import table , and has read in import table. I want to edit the ...
0
votes
0answers
27 views

gdb-add-index to speed up binary load time in gdb

Very often I see gdb takes a long time to load large debug binary and I understand that if I put gdb-index section into binary, it should help reduce initial load time when binary is loaded into gdb. ...
0
votes
0answers
17 views

does logging off remove contents of gdb.txt

This is in reference to an earlier question I asked here. What was not clear from that question is what does logging off do when you run that command. Is it just a 'state' of gdb or does it actually ...
0
votes
0answers
14 views

Does GDB keep a history of previous call stacks?

GDB had catched SIGSEGV, I accidentally continued the execution, and now it has catched SIGABRT. Can I still watch the backtrace of the previous call stack (at the moment of SIGSEGV), or is it gone?
0
votes
0answers
17 views

Find applications accessing certain memory address / trace memory access

Is there some way on Linux or Unix systems to determine if a distinct physical or virtual memory address has been accessed? I know the address or list of addresses but want to know if and what ...
0
votes
0answers
31 views

SIGSEGV on dlopen with gdb

I'm currently building a shared library. The goal is to inject this lib in a process. Unfortunaly when I inject this lib in the process I get a SIGESGV about ostream. Here is a MWE to reproduce the ...
0
votes
0answers
62 views

Debugging android kernel goldifish emulator under Mac OS Mojave

I need to debug android kernel goldfish under MacOS Mojave. So i cloned android-goldfish-3.18 and android-aosp-9.0.0_r22. I built aosp under macos while the kernel under debian. Obviously I built ...
0
votes
0answers
147 views

Qemu-user : get memory maps while debugging remotely

I am trying to get the memory map of a process I am debugging remotely (peda pull request link), the process is ran with qemu-user, for example: qemu-arm -L /usr/arm-linux-gnueabihf/ -g 1234 ./ch47 ...
0
votes
1answer
82 views

tracking segfault upon invocation of perl script (mytop tool and similar)

on my gentoo machine, mytop 1.9.1 quits upon invocation with the following output: # mytop Useless use of private variable in void context at /usr/bin/mytop line 1001. "my" variable $data masks ...
0
votes
0answers
14 views

Thread scheduling behavior between steps of GDB compared to non-stepped execution

The GDB manual states that when using all-stop mode for debugging a multithreaded application, it is not possible to advance every thread in lock-step by exactly one statement. This makes sense since ...
0
votes
1answer
78 views

Install new development tools on old system

I run 32 bit Centos 6.9 Linux with installed development tools for it with command: yum groupinstall 'Development Tools' But it installs very old GCC and GDB. What is the best way to install newer ...
0
votes
0answers
580 views

Building newer GDB failed due C++11

I run 32 bit Centos Linux with gdb ver 7.2 on it. I need to update GDB. I got errors below while building GDB 8.1: checking whether g++ supports C++11 features by default... no checking whether g++ ...
0
votes
1answer
123 views

Transferring control of ptrace to another process

I asked this question in the reverse engineering stackexchange: https://reverseengineering.stackexchange.com/questions/15169/transferring-control-of-ptrace-to-another-process because I thought a ...
0
votes
1answer
506 views

gdb stl functions still show as inlined after disabling optimizations

I have built gdb-7.12 with python support in my ubuntu 14.04 and have enabled pretty printing and configured my gdbinit file by following https://sourceware.org/gdb/wiki/STLSupport. But whenever i ...
0
votes
1answer
778 views

Gdb pretty printer is not working in Ubuntu 16.04

I have debugged C++ codes using gdb in Ubuntu 14.04. When I pass a stl container to the print command, it used to print the contents of the container. But then I upgraded to Ubuntu 16.04 LTS a week ...
0
votes
1answer
41 views

GDB - Call second program

I have a program which I want to debug gdb. And I want to call a second program to redirect the output to the first program. How this is done in gdb. I tried it like that: run -2 < $(python ...
0
votes
0answers
1k views

gdb-multiarch command not found

I have installed QEMU in RHEL for running the assembly programs in ARM. I have successfully installed QEMU and ARM. However, for debugging we are thinking to use GDB. I want to install the GDB-...
0
votes
2answers
272 views

Building GDB, cant find libreadline.a

I am trying to build GDB from source, and am encountering a strange problem. I'm not sure what information is relevant, so please let me know if I have not provided enough. I am working on Linux Mint....