The gdb tag has no usage guidance.
0
votes
0answers
19 views
gdbserver Further execution is probably impossible
Ive got a stock version of gdbserver running on a qnx machine. When I attempt to debug I get the warning shown below. Then occasionally I can get it to print a value
gdblog: I use a command file to ...
1
vote
1answer
28 views
gdbserver as an inetdamon broken pipe
Ive added gdbserver in the inetd.conf and etc/services yet when I attempt to connect as follows I immediately get Remote communication error. Target disconnected.: Broken pipe.
(gdb) target extended-...
0
votes
0answers
13 views
Unable to Debug on FreeBSD 11.0
I have written a c++ program. But when I try to debug using gdb, it is not able to do so and throws this output.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) b main
Breakpoint 1 at ...
1
vote
0answers
36 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 ...
0
votes
0answers
21 views
Change memory allocator behaviour to assist memory corruption debugging / gflags.exe analogue for linux
I'm debugging a memory corruption issue in closed-sourced linux application and, due to it's specifics, nor gdb nor valgrind could help me to trace the root cause - overrun corrupts some thread and ...
0
votes
0answers
22 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 ...
1
vote
0answers
38 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-...
2
votes
0answers
41 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 ...
0
votes
1answer
65 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
53 views
Run GDB command line multiple times
Due to my mother language is not English. So, excuse me for this bad introduction of my question. I would explain what I need through figure shown below.
As you can see, we have a folder which ...
2
votes
1answer
83 views
Elapsed time in gdb
Is there a way to measure elapsed time running the program under gdb?
Look to this:
<------------bp---------------------------------->
Assume that we are debugging a file and in some random ...
0
votes
0answers
21 views
good options, arguments to put when using gdb debugger to debug a program?
I am running Debian. Sometimes whenever a program is mis-behaving i.e. crashing I use the following arguments to run gdb on the program. I do have either -dbg or -dbgsym packages installed of the ...
1
vote
1answer
20 views
Are FPU/SSE/AVX registers not saved in core dumps?
While doing post-mortem debugging of my x86-64 application, I've come across a strange symptom:
(gdb) p/x $xmm1
$8 = {v4_float = {<unavailable>, <unavailable>, <unavailable>, <...
3
votes
1answer
76 views
Why does a gdb client fail to talk to its gdb server when started by this “expect” script?
I'm building a continuous integration environment for a firmware codebase, programming an ARM Cortex M0 using a Segger JLink device and running tests on the target using gdb and Segger's RTT tool.
I ...
0
votes
1answer
323 views
How to step-into, step-over and step-out with GDB?
I typed help while I was in the GDB but didn't find anything about step-into, step-over and step-out. I put a breakpoint in an Assembly program in _start (break _start). Afterwards I typed next and it ...
1
vote
1answer
31 views
Can you translate stack data? What is the data? [closed]
What I want to know is how is the data in a stack translated. We can see the data like: 0x80808080 but does it have a meaning?
What parts of the numbers stand for something different? And what does '...
2
votes
0answers
31 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 ...
1
vote
0answers
55 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....
3
votes
1answer
75 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 %...
0
votes
0answers
24 views
How do I debug packages that I've made?
I've created a number of packages using mock and rpmbuild to form my own software repository. As a part of the build, RPM will extract debug symbols and source files and install them in a debuginfo ...
0
votes
0answers
17 views
GDB not copying desired string (Buffer Overflow attempt)
Ok so I am trying to learn about buffer overflows and there is this simple program that is vulnerable of a BoF because it copies the first argument into a buffer of 5 characters. In the source code, ...
0
votes
1answer
22 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 ...
1
vote
0answers
536 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.
...
2
votes
1answer
185 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/...
3
votes
1answer
104 views
GDB hangs forever on Solaris
GDB seems to hang everytime when I try run command from gdb prompt. When I ran ps, there are two gdb processes that have been spawned and pstack reveals the following -
15:47:02:/home/stufs1/...
0
votes
2answers
604 views
gdb installation in beaglebone black with customized linux kernel
I am developing an application for the beaglebone black which I cross compile using arm gcc compiler then port on the compiled binary file to the beaglebone black using scp command and run there on ...
1
vote
1answer
321 views
gdb attach permission question (ptrace_scope is read-only)
When using gdb to attach to the process. It shows
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
...
1
vote
0answers
66 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 ...
0
votes
1answer
210 views
gdb displays not all variables in KDevelop [closed]
Hoping, the image describes the issue much better than I can do.
Generally, I'm debugging a multithreaded application in KDevelop with gdb.
I'm debugging the app step by step (F11 shortcut) and have ...
2
votes
1answer
30 views
gdb: stop the program when the variable changes
So I was wondering how to stop gdb every time my variable (test_v) changes
I know
watch test_v
Do I do
watch test_v
stop
To stop the program every time the variable test_v changes?
3
votes
1answer
952 views
How to set up gdb to scan through heap memory?
I want to print out and analyze the contents of the system heap. Obviously, this should be a privileged operation, and might go against the grain of what GDB was intended to do.
Specifically, I want ...
1
vote
2answers
6k views
How to compile without optimizations -O0 using CMake?
I am using scientific linux. I am trying to compile a project that uses a bunch of cpp files.
In the directory user/project/Build, I enter make to compile and link all the cpp files. I then have to ...
0
votes
2answers
3k views
gdb always program exited with code 01
I am using scientific linux. I am trying to compile a project that uses a bunch of cpp files. Right now, it compiles successfully, but the values/data I'm getting are definitely wrong.
In the ...
4
votes
1answer
1k 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 ...
1
vote
1answer
127 views
How do I get linux-gate.dso on a newer linux system?
I would like to find out which method my 32bit QEMU guest is using for system calls. There's an excellent article explaining linux-gate.dso (http://www.trilithium.com/johan/2005/08/linux-gate/). ...
2
votes
1answer
2k 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
83 views
Obtaining a code dump from a binary
Sorry about my newbie question but 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" ...
1
vote
1answer
589 views
GDB up arrow doesn't work
I searched a lot about similar problems but found nothing. When running gdb I couldn't use up arrow for walking through previous commands. Up and down arrows are just ignored. I have started to ...
2
votes
2answers
669 views
Using gdb to inspect environment variables
I have been trying to find the address of the SHELL environment variable in a program on a Ubuntu 12.04 machine. I have turned off ASLR.
I found similar posts : SO question and blog post
I have ...
2
votes
0answers
78 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 ...
5
votes
1answer
2k views
Can anything useful be done with a truncated core?
We have processes written in a mix of Python, Java and C++ that core dump from time to time. They allocate more memory in chunks as needed during runtime, and are known to crash when their allocation ...
5
votes
1answer
621 views
How to save the result of printf to a variable in GDB?
(gdb)printf "Hello %d", 7
Hello 7
(gdb)set $MyVar = printf "Hello %d", 7 // ???
How to save the result of printf "Hello %d", 7 to $MyVar?
4
votes
1answer
690 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
....
1
vote
1answer
5k views
Missing separate debuginfos
I'm trying to debug a code using GDB in a Fedora machine. It produces this message each time I run it.
Missing separate debuginfos, use: debuginfo-install glibc-2.18-12.fc20.x86_64 libgcc-4.8.3-1....
7
votes
2answers
821 views
How to determine what instructions a process is executing?
I know about strace and ltrace, but that only tells me what system calls and library calls a process is executing, respectively. I would like to know exactly what instructions a process is executing. ...
2
votes
1answer
2k views
“Missing separate debuginfo for …” when running gcore
I am running the following:
command: gcore 56058
output:
Missing separate debuginfo for /lib64/libdl.so.2
Try: zypper install -C "debuginfo(build-id)=dcca9c1f648bda0a7318a7c8844982c440e3e4a3"
...
0
votes
0answers
420 views
qtcreator debugger shows <unavailable synchronous data> when trying to view the contents of std::map
I'm running QtCreator 4.8.0 on a Ubuntu 12.04 (64bit) machine.
apt-cache policy qtcreator shows:
qtcreator:
Installed: 2.4.1-0ubuntu2
Candidate: 2.4.1-0ubuntu2
Version table:
*** 2.4.1-...
1
vote
0answers
463 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 ...
5
votes
1answer
532 views
Backtrace of “git clone” running inside qemu-user-emulation based arm-chroot
I'm running a wheezy:armhf chroot using qemu user emulation on my jessie:x86_64 system. Somehow, a git clone on a particular private repository will hang inside the chroot, while succeed natively. ...
1
vote
1answer
2k views
what are some of the best resources to learn advanced debugging techniques using gdb? [closed]
I know the basics of how to use gdb. But I would like to learn some advanced debugging techniques using gdb. What are the best resources - books, blogs, tutorials - that any of you use regularly. I ...