Questions tagged [gdb]

1

votes
1

answer
279

Views

Proc*C Application Crashing With Oracle 12.2

While running some applications on 172.19.112.43 server, oracle is causing applications to crash. Oracle Version 12.2 , Linux Version - Red Hat Enterprise Linux Server release 6.0 (Santiago). Please find below the crash trace: 0 0x00007f332756754b in raise () from /lib64/libpthread.so.0 1 0x0000...
chetan
1

votes
0

answer
249

Views

Pretty-printer is not working when remote debugging an arm board via vs code

I'm trying to remote debug a c++ app from a VM ubuntu 16.04 amd64 host to a debian armbian target of cubietruck board (ARM® Cortex™-A7 Dual-Core) via vs code. I have follwed this guide https://medium.com/@spe_/debugging-c-c-programs-remotely-using-visual-studio-code-and-gdbserver-559d3434fb78 wit...
dk13
1

votes
0

answer
583

Views

Visual Studio 2017 Linux remote debugging (gdbserver)

After I installed gdbserver on my remote machine (Ubuntu 16.04.4 LTS), I tested the following c++ code by making a 'cross-platform console application (linux)' project in Visual Studio 2017: #include int main() { printf('hello from testLinuxDebug!\n'); return 0; } I added the connection information...
Simon
1

votes
0

answer
95

Views

How gdb runs without capabilities?

I'm trying to understand why gdb is able to debug a process even if it runs without capabilities. My non-root user has the following configuration: $ /sbin/capsh --print Current: = Bounding set =cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_s...
Alvin
1

votes
1

answer
66

Views

How to let gdb recognize eret instruction when connect to mips emulator?

I print the packets exchanged between gdb and qemu-i386, I see that when I type si in gdb and current pc point to iret instruction, the gdb will send vCont;s:1 to qemu-i386-server, but if the current pc point to normal instruction, the gdb will send Z0;addr:4 and vCont;c:1 to qemu to let qemu contin...
wt.cc
1

votes
1

answer
79

Views

struct values are changing from one function to other in unexpected manner

#include #include #include #include typedef struct { unsigned char a[3]; unsigned short data[3]; unsigned int d1; unsigned int d2; } abc; void f1(abc *ptr) { printf('values are :0x%x \t0x%x \t0%x',ptr->data[0],ptr->data[1],ptr->data[2]); //Hex map of ptr is given below (taken by gdb --> x/2...
shekhar singh
1

votes
1

answer
84

Views

KGDB not associating address with symbol

I am trying to debug the Linux kernel, specifically the bluetooth kernel module. I want to step through the code in net/bluetooth/l2cap_core.c Host machine: linux mint 18.3 (running in VM). Target machine: raspberry pi 3b+ I compiled the kernel with debugging symbols on the host machine, using cros...
box
1

votes
0

answer
50

Views

why backtrace info is corrupt after the thread run sleep?

I try to get the backtrace of all threads of a process. I wrote a test program: #include #include #include int func_a(int *a) { *a++; return 0; } void* test_thread(void* args) { int a = 0; while(1) { func_a(&a); //sleep(1); } fprintf(stdout, '%d\n', a); return NULL; } int main(int argc, char **ar...
tok101
1

votes
1

answer
27

Views

GDB: How to restrain the scope of convenience variable

So I have 2 custom commands: define foo set $i = 10 end define bar set $i = 100 foo print $i
my_question
1

votes
1

answer
47

Views

Including Extra Debuging Info in Source File for debugging using gdb in Code::Blocks

When debugging C++ source in Code::Blocks, points passed a function parameter or a members of data structures are just displayed as their address. After some research I found I can enter the a custom watch as @ to get it to display as an array, however I can't edit the default display on the structu...
Glen Fletcher
1

votes
1

answer
123

Views

C - Gdb doesn't let me see values in stack memory

I'm reading a book and to practice with C and assembly I'm using this simple script to analyse the functioning of memory: void test_function(int a, int b, int c, int d) { int flag; char buffer[10]; flag = 31337; buffer[0] = 'A'; } int main() { test_function(1, 2, 3, 4); } This is the gdb output. I h...
AllExJ
1

votes
0

answer
179

Views

KDevelop won't start debugging

I used to be able to debug my program but now all of a sudden the debugger won't get past loading libc - or so it would seem. The debugger breaks with a backtrace pointing to #0 __libc_read() at /build/glibc-OTsEL5/glibc-2.27/sysdeps/unix/sysv/linux/read.c:27 When I then continue the debugger nothin...
Tim Kuipers
1

votes
0

answer
58

Views

Issue with GDB going deep into system calls with step

Using gdb 7.12-6 - (on debian linux in a virtualbox) I have the problems described below using step strangely using gdb 7.4.1-debian everything seems to be fine and there are no issues (debian linux in an older virtualbox on a different computer) I am trying to step through code. I don't want to us...
tom
1

votes
0

answer
236

Views

How to debug Django segmentation faults?

I think after some update my Django app has started to segfault time after time. Below is my attempt to debug using gdb, however I cannot see the root cause: # gdb -ex=r --args ../pyenv/bin/python3 -X faulthandler manage.py runserver 127.0.0.1:8000 GNU gdb (GDB) 8.1.1 Copyright (C) 2018 Free Softwa...
NarūnasK
1

votes
0

answer
85

Views

Debugging for hard to recreate C bug. Dynamic breakpoint

I have a hard to recreate bug and I'm hoping to use a python GDB script to stop the process when the bug is detected (I'll run it in debug till the error is regenerated). In reference to Stray chars seen out of snprintf. I've currently made a script that can create a break-point and parallely readin...
clmno
1

votes
0

answer
117

Views

I cannot break with GDB and QEMU

I am debugging the Linux Kernel (latest version) using GDB and QEMU. I have set DEBUG_INFO to yes in the configuration file. Here is how I call QEMU: $> qemu-system-x86_64 -snapshot -m 4G -serial stdio -kernel ~/Documents/kernel/arch/x86_64/boot/bzImage -initrd ~/D\ ocuments/kernel/initrd/initrd_x86...
Julien Séveno-Piltant
1

votes
0

answer
263

Views

gdb debugging python (3) process on alpine linux, can't use py-list

well a python server process is currently crashing regularly (every few days), going high in cpu usage yet not actively processing anything. The process runs in an alpine linux docker. To help finding the problem I'd like to see the exact line on which the process is busy. As the process is already...
paul23
1

votes
0

answer
34

Views

How can I find all the memory access addresses done via a load or store operations (ARM processor) with gdb or any other tool

I need to find the address of each memory location accessed by my program running on a Raspberyy pi3 based on ARMv7 ISA. In essence i want to capture all the loads and stores of my program to build a detailed memory trace. The final intention is to study how a particular memory access pattern affec...
Dakshina
1

votes
0

answer
78

Views

Call Stack of a Selected frame

I am debugging a segmentation fault from the core file and trying to get as much info as possible. Below is a snippet of my bt command. (gdb) bt #0 0x00000000007d4cf1 in alloc_real (vv=0x7f259e9bed20, drop_ssr=false) task_remove.c:2350 #1 0x00000000007d54f8 in ssr_unalloc (vv=0x7f259e9bed20, skip_...
Rndp13
1

votes
1

answer
68

Views

Emacs gdb: Show variable permanently in addition to locals i

I am using emacs for programming, and recently also gdb. The 'locals' window does show local variables but not arguments to a function, which in a way also could be considered local variables. For example, if I have void foo(char *bar) { int n; .... } then n is shown in the 'locals' but not bar. Of...
user52366
1

votes
1

answer
32

Views

Passing characters and non-printable values into LLDB as arguments

With lldb, how can I pass in a long string - which includes hex characters - as a command line argument ? Some of the hex characters may be non-printable. (lldb) setting set target.run-args 'AAAA\\x66\\x6f\\x6f' (lldb) settings show target.run-args target.run-args (array of strings) = [0]: 'AAAA\x6...
rustyMagnet
1

votes
0

answer
92

Views

How do I print out the contents of a file in hex using gdb?

I'm trying to build a program that resizes a bmp image by a factor of f, but having problems identifying what's going wrong with the program. I thought of using gdb to examine what is being read from the sourced image and written to the new image but when I try to print the contents of the final ima...
stalris
1

votes
1

answer
41

Views

Bug in gdb libstdc++ pretty-printers with gcc 8 installed from macports (macOS)

I set up gdb libstdc++ pretty-printers as described in GDB Wiki. But pretty printing didn't work, gdb kept printing raw data. I changed printers.py to fix it: --- python/libstdcxx/v6/printers.py.old 2018-10-13 13:57:11.000000000 +0300 +++ python/libstdcxx/v6/printers.py 2018-10-13 14:35:55.000000000...
Snich
1

votes
0

answer
24

Views

GDB PEMicro interface debugging not showing up

I recently installed Kinetis Deign Studio 3.2.0 on Mac OSX High Sierra and am I trying to flash a FRDM-KL26Z (am studying this at the University and everybody use Windows, unfortunatly). I installed the GDB PEMicro packs, but the problem is that the only configuration that shows up into the Flash Co...
ics
1

votes
0

answer
58

Views

Missing info on high level stack frames using gdb with pygdbmi

I am trying to automate the task of finding out which line of code caused a crash. I have an output from AFL which will make a simple vulnerable program crash, and I would like to run it with GDB to find the crashing line, through a script. I am using pygdbmi which is based on the GDB/MI interface....
ClonedOne
1

votes
0

answer
139

Views

Turn-off gdb “Inferior exited normally” messages

Is there a way to turn off [Inferior 1 (process 18410) exited normally] Warning: not running or target is remote messages from gdb? I've tried: set logging off set verbose off set print thread-events off set print inferior-events off with no success
Roee
1

votes
1

answer
23

Views

gdb debugger unfamiliar with code displayed

I am fairly new to using gdb debugger and so coming across the code being displayed when I ran gdb left me having no use for the debugger. I am unfamiliar with the code being displayed but a did a little research and I assume I accidentally opened up a 'thread'? It's hard to explain something I do n...
Andy Rivera
1

votes
1

answer
55

Views

Does pdb has the layout src like gdb?

In gdb, we can use layout src to get a pretty good debug text-UI. Does pdb(The Python Debugger) have something equivalent? In pdb, I can only see the next line that is going to be executed, which is annoying. gdb text ui is shown below:
youkaichao
1

votes
1

answer
472

Views

Can Visual Studio Code use GDB to attach to process without the “Program” property?

I am debugging a shared C++ library called from python on Ubuntu 18.04. I can attach GDB to this using gdb -p PID (where PID is the python process ID). I like the promises of Visual Studio Code, but the default debug launch.json requires 'program' property attach, but gdb does not need this. { 'n...
Gaf
1

votes
0

answer
60

Views

GDB (intel) : print works but not info address

The tree is as follows module M type A real , allocatable :: dd (:) end type A type B type (A) , pointer :: aa end type B type C type(B) , pointer :: bb end type C type(C) , allocatable :: cc(:) end module M In gdb: print M::cc(10) % bb % aa % dd(100) $1 = 0 However, info address M::cc(10) %...
newkid
1

votes
0

answer
99

Views

GDB suspends when it reaches breakpoint on stripped binary

I am not sure if it is a bug or I am using gdb incorrectly, but when I Strip binary (remove symbols) Load it under gdb Put breakpoint anywhere Run program reaching breakpoint gdb gets suspended (like I would press C-z), which is very annoying and sometimes breaks execution. Why does it happen? I co...
radrow
1

votes
1

answer
140

Views

Eclipse CDT cannot set watchpoint (always disabled - greyed out)

I cannot set a watchpoint in Eclipse (Photon) using CDT. According to this answer to this question about setting memory breakpoints in CDT, one should be able to set a watchpoint by doing the following: Highlight the variable in the editor, or select it in the Outline view. Click Run > Toggle Watchp...
Keith Morgan
1

votes
1

answer
128

Views

How do I clear a breakpoint from the processor after GDB is killed?

I was debugging a Free Pascal application in GDB running in a Linux environment over SSH when my SSH connection dropped. I have seen from experience that GDB is closed when this happens, and to be sure, I ran pidof gdb and nothing returned. I reopened GDB and attached to the same running application...
Adam Hanny
1

votes
0

answer
116

Views

Creating debug symbols for gdb manually

Intro. For my compilers course I have to translate some language to assembler. Now my code has a segfault, and I have hard time debugging it. Having an ability to watch variables would simplify the process a lot, but the final asm code has only registers and their derivatives. Question. How can I cr...
dyukha
1

votes
1

answer
59

Views

How to debug an Qt-Android application build with cmake?

I want to debug a Qt based Android application which is build using cmake (instead of qmake). The androiddeployqt command bundles the apk and adds gdbserver. Then I can launch the gdb server via: adb shell run-as com.package.name /data/data/com.package.name/lib/libgdbserver.so --once :5055 --attach...
JaM
1

votes
1

answer
28

Views

Debugging Issue on Assemble Code by using GDB

I tried to use gdb to debug the Assemble code but got error message,it said: (gdb) run Starting program: /root/assembler_program/bsawp.o /bin/bash: /root/assembler_program/bsawp.o: cannot execute binary file The code: .section .text .globl _start _start: nop movl 0x12345678 , %ebx bswap %ebx mo...
Lance
1

votes
0

answer
98

Views

LLVM IR: expose variables to GDB?

I am writing a custom programming language. I am generating LLVM IR as an intermediate (via LLVMlite), and I want to expose variables to GDB. This is an example of the generated IR: ; ModuleID = 'tests/debuginfo.xan' source_filename = 'debuginfo.xan' target triple = 'x86_64-unknown-linux-gnu' target...
NoOneIsHere
1

votes
0

answer
52

Views

Debugging third-party C library used by application written in C

I faced some trouble when developing my application in C and could not find a reason. So I need some advice about how to debug native application which uses 3rd party libraries. I'm developing sound application under Linux with alsa and the function applying configuration returns negative value wit...
Some Name
1

votes
0

answer
41

Views

How can I pass the data type in a generic linked list to the GDB print command?

I am writing a GDB pretty printer in Python for this linked list data structure: struct listNode { void *data; /* node's data */ struct listNode *next; /* next node in list */ }; struct xlist { struct listNode *head;...
Telgar
1

votes
0

answer
23

Views

GDB's “info sharedlibrary” shows same “from” and “to” address for all libraries

I have a driver that loads a shared library, and in the library there is a segfault in the ISR. I can get the address of the segfault and I'm trying to get some context as to where that segfault is. However, the address lies outside of the address space of the loaded libraries (it's at 0x79something...
Brydon Gibson

View additional questions