Questions tagged [gdb]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
1
vote
0answers
22 views

How to analyze results after software-based fault injection campaign? [closed]

I am working on a software-based fault injection technique based on gdb to inject faults (bit flip) into a running program (c code). I have developed a tool to perform fault injecting at run-time. ...
4
votes
1answer
1k views

Hardware breakpoint in GDB +QEMU missing start_kernel

I am trying to debug a kernel running on QEMU with GDB. The kernel has been compiled with these options: CONFIG_DEBUG_INFO=y CONFIG_GDB_SCRIPTS=y I launch the kernel in qemu with the following ...
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 ...
7
votes
6answers
3k views

Run program at lower CPU speed?

It would be very useful for me to run specific programs in a Linux environment with a fixed (lower) CPU clock speed (say, runat 400mhz ./my-program --argument-of="my program" for getting that clock ...
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?
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
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 ...
5
votes
1answer
5k views

permission denied for ptrace under GDB

I have set a super simple C program and compiled it with GCC (with the -g flag). I've tried running it with gdb a.out, set a breakpoint on main and run it, but GDB ignored my breakpoint and simply ran ...
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
1answer
165 views

Get backtrace from core dump using gdb via shell script(non interactive)

I have core dump file and gdb. I can do gdb <executable> <core_file> (gdb)bt This will give me backtrace but I want to do this using a shell script and in non-interactive mode. ...
1
vote
1answer
117 views

How to enable TUI for gdb on Debian 9?

When debugging it is often helpful to loot at assembly, but on Debian 9 when I try layout asm I get: Undefined command: "layout". Try "help". According to some internet research it seems like I ...
2
votes
2answers
82 views

How to build the GDB documentation from source?

I've downloaded the GDB source: git clone git://sourceware.org/git/binutils-gdb.git now how do I generate the documentation from source as can be downloaded from: https://sourceware.org/gdb/current/...
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
3answers
22 views

gdb-customize command, how to test whether a variable is set?

I'm debuging with gdb and need to define some helper commands. Basically I want my customized command to operate differently depending on the number of args given. So I have to test whether $arg* is ...
5
votes
2answers
691 views

Safest way to force close a file descriptor

Sometimes you need to unmount a filesystem or detach a loop device but it is busy because of open file descriptors, perhaps because of a smb server process. To force the unmount, you can kill the ...
15
votes
3answers
27k views

How to compile without optimizations -O0 using CMake

I am using Scientific Linux (SL). I am trying to compile a project that uses a bunch of C++ (.cpp) files. In the directory user/project/Build, I enter make to compile and link all the .cpp files. I ...
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 ...
4
votes
1answer
177 views

How to prevent a process from writing to the systemd journal?

I am using a third party .NET Core application (a binary distribution used by a VS Code extension) that unfortunately has diagnostic logging enabled with no apparent way to disable it (I did already ...
16
votes
2answers
3k views

What does C@t{++} mean in the gdb man page?

I was reading the manpage for gdb and I came across the line: You can use GDB to debug programs written in C, C@t{++}, Fortran and Modula-2. The C@t{++} looks like a regex but I can't seem to decode ...
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++ ...
4
votes
1answer
279 views

Why some libraries and other parts get repeated in the linux virtual memory with gdb?

This is the result of looking at virtual memory of a process in gdb; I have some questions regarding this: Why are some parts of the virtual memory are repeated? For example, our program (stack6) and ...
18
votes
5answers
32k views

How can I find a memory leak of a running process?

Is there a way, I can find the memory leak of a running process? I can use Valgrind for finding memory leaks before the start of a process. I can use GDB to attach it to a running process. How could I ...
5
votes
1answer
363 views

How to produce a VLC stack trace?

I've reported a VLC bug and included the output of gdb's bt full, but the response from a project representative is that the trace is "incomplete". How can I produce a trace that would be usable to a ...
1
vote
1answer
514 views

Obtaining a code dump from a binary

Is it possible to dump the assembly language code of a binary using GDB? I tried to use the "l" command but it says No symbol table is loaded. Use the "file" command.. I use the file command and it ...
1
vote
2answers
749 views

where does gdb put the log file?

This starts partially from why doesn't gdb like aliases Now I put the following arguments - gdb firefox-esr (gdb) set logging file my-firefox-esr-1802018.log (gdb) set pagination 0 (gdb) show ...
0
votes
1answer
350 views

Quit program run by GDB when terminate screen

I am running my program using screen and GDB. How I run my program: screen -dmS adapter "./run-adapter.sh" In run-adapter.sh gdb -ex "handle SIGPIPE nostop noprint pass" -ex run -args ./Adapter ...
4
votes
2answers
4k views

gdb in one command

When I debug an executable program with arguments arg1 arg2 with gdb I perform the following sequence gdb file ./program run arg1 arg2 bt quit How can I do the same from one command line in shell ...
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 ...
5
votes
1answer
7k views

GDB cannot exec my test program

My computer run with Ubuntu 14.04. GDB seems to be abnormal in different account. For example I make a very simple test. I write a file under ~/test/test.c like this: #include <stdio.h> #...
0
votes
1answer
227 views

Why does pstack launch gdb (and how to prevent it)?

Running pstack on a process sometimes causes gdb to attach to that process on one of my Linux servers. Why would pstack launch gdb, and how can I prevent that? Details: gdb is running as: /user/bin/...
1
vote
1answer
281 views

How to trace line by line by “gdb” C/C++ code? [closed]

I have installed gdb and added -g option to my compilation command, but when I try (gdb) s or (gdb) n it says: The program is not being run. It only works when I try (gdb) r and goes and stops ...
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....
1
vote
2answers
4k views

Turning off kASLR to debug linux kernel using qemu and gdb

I'm trying to debug linux kernel using qemu and gdb. The problem is that gdb won't stop at breakpoint. I've searched about it and found that turning kASLR off may help, because kASLR confuses gdb. ...
-1
votes
1answer
57 views

Powerline and gdb

GDB in TUI-Mode shows strange behaviour. I'm using powerline and it seems that the font is the wrong one. Exist there a solution to have a pretty command line? How can I invoke a program not using ...
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 ...
1
vote
1answer
2k views

GDB command to print the address of starting of buffer (stack)

For gdb debugger (gdb) p &buffer This command is used to print the content of starting of buffer (stack), or print the address? If it is content, how to print the address?
11
votes
1answer
4k views

How to make gdb not ask me “y or n”?

When I use GDB command add-symbol-file to load the symbol, GDB always asks me 'y or n', like this: gdb> add-symbol-file mydrv.ko 0xa0070000 add symbol table from file "mydrv.ko" at ....
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 ...
10
votes
4answers
1k views

why doesn't gdb like aliases [duplicate]

I made an alias ff and sourced it from ~/.zsh/aliases.zsh. The aliases run well themselves: alias ff ff='firefox --safe-mode' and it runs as expected. But when I try to run it under gdb I get: &...
5
votes
3answers
1k views

GDB step in delays

I am making a nice presentation of ARM assembly code execution and I would need GDB to step the code every 1 second infinitely long (well until I press CTRL+C). Has anyone got solution? I don't want ...
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 ...
5
votes
2answers
2k views

The structure of /proc/kcore on 64-bit machine and relation to physical memory

Let me preface this question by saying that I've found a lot of answers for questions similar to my question but for 32-bit machines. However, I can't find anything for 64-bit machines. Please no ...
2
votes
2answers
421 views

Conque-GDB in vim: how to set size

I use Conque-GDB as a plugin in Vim. Here is how my Vim now looks like: As you see I also use the Nerdtree and I can easily change its size: https://codeyarns.com/2014/05/08/how-to-change-size-of-...
3
votes
2answers
957 views

GDB throws error on Arch Linux

When I try stepping through a program, gdb throws this error std::ostream::operator<< (this=0x6013c0 <std::cout@@GLIBCXX_3.4>, __n=2) at /build/gcc/src/gcc-build/x86_64-unknown-linux-gnu/...
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: ...
5
votes
2answers
323 views

bash / gdb autocompletes core file on RedHat but not on Ubuntu

When a program dumps core, we have set our kernel.core_pattern to put the core file in a particular location with a certain filename etc. kernel.core_pattern = | /var/core_file_handler.py %e %s %p %...