gdb

Missing separate debuginfos, use: debuginfo-install glibc-2.17-157.el7_3.1.x86_64

半世苍凉 提交于 2021-02-07 19:01:01
问题 I know this question is answered already in another thread, however I tried all the solutions given in the other thread including - Searching for the package, trying to install the package, installing yum-utils and debuginfo-install glibc Finally, I even set enabled=1 and gpgcheck=0 in redhat.repo under /etc/yum.repos.d, what else should be done for me to get rid of this error? What I am trying to do is, debug a program(using gdb) with a shared object library. The program and .so file are

GDB: Create local variable?

南笙酒味 提交于 2021-02-07 18:42:38
问题 I'm using Xcode's debugger. While stopped at a breakpoint, is there a command I can type in the GDB command prompt to create a local variable? If so, how? Please provide an example. I know I can do it in the code and then recompile the program, but I'm looking for a faster way. 回答1: It's mentioned in the comments, but not as an answer: if you don't need to reference the variable in your code but just want to do some ad-hoc investigation, you can use Convenience Variables Start your variable

Convert large core files to “minicore” files

时光总嘲笑我的痴心妄想 提交于 2021-02-07 18:40:19
问题 How do I reduce core files to just the threads' stacks? I want to be able to run gdb thread apply all bt on the mini core and no more I'm dealing with large (>4GB) multi-threaded Linux ELF core files that are too big to get back for analysis. I've see google-breakpad which is meant to create a "minidump" when a process crashes. In google-breakpad there are two utilities core2md and minidump-2-core which at first glance should be able to convert a core file to minidump format, and then back to

How to get gdb tui assembly output to show instruction?

依然范特西╮ 提交于 2021-02-07 12:23:31
问题 I wanted to see the assembly output but found that in TUI, it would output function signature + offset: which is cool, except for the fact that I'm programming in C++ and the function signature is fully resolved so I get namespaces and template parameters which make the function sig 2 or more lines long. This gets truncated in the TUI of course so it doesn't even get to display the assembly instruction. Is there any way to shorten, change the prefix (perhaps to a file/line format) or not

wait for gdb to attach [duplicate]

て烟熏妆下的殇ゞ 提交于 2021-02-06 10:15:27
问题 This question already has answers here : Is there any way to tell gdb to wait for a process to start and attach to it? (6 answers) Closed 2 years ago . I've been using gdb normally for 1 or 2 projects. I.e. I invoke gdb --args prog args . gdb runs in the same tty as the program I'm debugging. However my latest project is modifying the dtach utility. This is a program like screen, so the tty's are redirected elsewhere, thus I have to use gdb's attach functionality. The problem with gdb attach

wait for gdb to attach [duplicate]

浪尽此生 提交于 2021-02-06 10:15:05
问题 This question already has answers here : Is there any way to tell gdb to wait for a process to start and attach to it? (6 answers) Closed 2 years ago . I've been using gdb normally for 1 or 2 projects. I.e. I invoke gdb --args prog args . gdb runs in the same tty as the program I'm debugging. However my latest project is modifying the dtach utility. This is a program like screen, so the tty's are redirected elsewhere, thus I have to use gdb's attach functionality. The problem with gdb attach

C array size via gdb

独自空忆成欢 提交于 2021-02-06 10:12:33
问题 I know you can print an array in gdb , e.g. (gdb) p *array@10 Is there a gdb command that can tell you its length, e.g. a handy shortcut to typing something like: (gdb) p sizeof(array)/sizeof(int) In the case where the array has been defined at compile time and you want to check it 回答1: You may use ptype to know the type of a symbol. For int array[5] , (gdb) ptype array type = int [5] 回答2: If it's actually defined as an array, e.g. int array[5]; Then yes, you can use what you wrote, although

Is it possible to stop a single thread during debug in Linux?

假装没事ソ 提交于 2021-02-06 09:59:05
问题 What I'd like to know is if it is possible, inside a debugging session in Linux, (read: gdb :)) to stop the execution of a single thread, leaving the other threads to run. If someone is curious to know why keep reading: I wrote a software watchdog C++ class (using Qt). I tested it with a simple multithreaded program, but I'd like to test the code once I integrate it inside the real application as well. If I could stop a thread from the debugger, that will simplify this testing phase. :)

How can I jump to a frame in a stack trace according to the function name in gdb?

和自甴很熟 提交于 2021-02-06 09:46:10
问题 I'm debugging a stack overflow due to infinite recursion. The program fails when the stack is 700 calls deep. I want to jump to the frame in which the function was initially called. However, gdb shows me the stack trace from the top of the stack about 20 entries at a time, and I wonder if I can somehow skip straight to the calling function without looking through the stack trace to find its number. To that end, I want to be able to jump to a stack frame based on its name instead of its number

利用ida内置脚本IDC静态调试和Linux内核动态调试gdb两种方法解决攻防世界no-strings-attached

最后都变了- 提交于 2021-02-05 15:27:38
利用ida内置脚本IDC静态调试和Linux内核动态调试gdb两种方法解决攻防世界no-strings-attached 一、首先来看静态调试的解决办法 1、文件识别 直接拖进PE识别工具 elf/32位 可以看出不是window可执行的PE文件,而是以Linux为内核的ELF文件,要在Linux系统下进行运行。 2、进行汇编与反汇编 话不多说,程序直击拖进ida.(注意这里的程序是32位的,要用32位ida来进行反汇编) 加密是对s和dword_8048A90进行操作 s代码段 由于我们一个一个读取数据太麻烦这里我们利用ida的内置脚本IDC将十分方便 这样我们就得到s全部的数据 接下来我们再打一脚本来模拟加密过程 运行之后我们就可以得到答案 通过静态调试后我们发现flag为 9447{you_are_an_international_mystery} 二、Linux动态调试gdb来解决该问题 从上面ida的分析我们可以知道,加密过程decrypt运行完成后只要知道返回值dest即可,所以利用gdb在decrypt下断点即可 1、gdb ./文件名 载入程序 2、b decrypt(函数名)在decrypt下断点 3、r运行 4、n单步进入 5、x查看值 /s以字符串的形式 $eax 查看寄存器eax的值 来源: oschina 链接: https://my.oschina