All Questions
234 questions
2
votes
0
answers
75
views
Tracing Dynamic C Library Function Calls in Linux
I am currently trying to perform a detailed analysis of a dynamic C library's "mimalloc" behavior when loaded by a specific program in a Linux environment. Specifically, I want to ...
1
vote
0
answers
65
views
To integrate arm64 hw watchpoint to linux process in C
I am looking at the Linux breakpoint test case, and try to understand it to put it into a Linux process
https://github.com/torvalds/linux/blob/master/tools/testing/selftests/breakpoints/...
1
vote
0
answers
60
views
VScode wsl,exe Unable to start debugging,
Unable to start debugging, There was an error starting the pipe program C:\Windows\System32\wsl,exe. An error occurred trying to start process C:Windows\System32\wsl.exe with working directory '/mnt/c/...
12
votes
2
answers
1k
views
Stripping ELF binary but keeping symbols / source file locations information for gdb backtrace
I would like to strip an ELF binary compiled with debug information and keep only the minimal required information to provide symbols / source code location output in a GDB backtrace.
It would be ...
2
votes
1
answer
375
views
CSAPP tiny shell lab: stuck at sigprocmask
I am trying the tiny shell lab in CSAPP. But my code stucks when I input an command line.
steven@Steven:/mnt/f/大学/CSAPP/cmu15213/shlab-handout$ ./tsh
tsh> 123
tsh> 123: command not found
123
123
...
1
vote
1
answer
338
views
GDB: set watchpoint into array, defining value size
My program uses a char heap[] array as a representation of a heap, and it may contain values of different sizes. Most notably for this question, the value at (uint16_t*) &heap[0] and (uint16_t*) &...
1
vote
0
answers
33
views
Long-term effects of a debugging session, even after detaching (linux)
Let's start by considering dynamically loaded libraries. As far as I understand, in a smaps output for example, you will typically see a writeable section pointing to a .so file that is actually ...
1
vote
1
answer
229
views
Incorrect joint work of Valgrind with GDB
I'm trying to connect Valgrind to GDB.
I've written a test code:
#include <stdio.h>
int main()
{
int x, i;
for (i=0; i < 10; i++) {
if (x < 10)
printf("...
0
votes
0
answers
84
views
How to execute a "final" C code after debugging is stopped in VS Code?
When you run C code in Visual Studio Code (on Linux) and stop debugging, the atexit() function is not called.
I can understand that the stop (square red button) in VS Code is similar to kill command ...
1
vote
0
answers
204
views
OpenSSL on C writing garbage values after EOF
So I am writing an archiver program to also encrypt-decrypt files sing block cipher. When decrpting from a archive file, and I have checked, in situations where the remaining btes of the fle before ...
0
votes
2
answers
194
views
Setting a return value in debugger in C in order to find input arguments
Is there a way in C (using a debugger) to set the return value and find out what arguments would return that value?
For example, if I have a function that takes in three integers, does something ...
0
votes
0
answers
256
views
linux - how to get a stack trace when a memory address is written to
I have a memory corruption in my c/c++ program which causes a segfault. this was reproduced a few times and the same address gets corrupted every time.
Is there any way I can call a function when this ...
0
votes
0
answers
55
views
where is this zeros came from inside the c main function stack memory area in gdb?
I have below source c souce code
professor@Linux:~/$ cat stack2.c
#include<stdio.h>
int function(int a , int b)
{
int x = 10;
int y = 20;
return 0;
}
int main(int ...
1
vote
2
answers
152
views
How to detect Register Smashing on an Intel CPU in a Multithreaded CUDA application written in C and Python under Linux?
I am currently trying to debug a very large application with many different modules, some written in C, and some in Python. It uses both multithreading and CUDA. It is running on a modern Intel ...
0
votes
2
answers
1k
views
GDB not mapping symbol files to stripped exe
I have a C file, I compiled with -g option and saved the debug symbol to a different file and stripped the executable. When I try to debug this executable with set debug-file-directory /root/test, I ...