11
Other Discussion / Re: framebuffer problem
« Last post by fredericopissarra on February 23, 2025, 06:44:20 PM »Ah, now i remember : sdl2 is using multithreading so Debugging (at least with my knowledge and radare2) is not working. Seems, that i have to create a few macros for Output of Registers, while doing calculating stuff to find the Point of Errors.Here works perfectly:
Code: [Select]
/* test.c */
#include <stdio.h>
#include <pthread.h>
unsigned int count = -1;
static void *thread( void *p )
{
while ( count-- );
return NULL;
}
int main( void )
{
pthread_t tid;
pthread_create( &tid, NULL, thread, NULL );
getchar();
pthread_join( tid, NULL );
return 0;
}
Code: [Select]
$ cc -g -pthread -o test test.c
$ gdb test
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
...
Reading symbols from test...
(gdb) list
1 #include <stdio.h>
2 #include <pthread.h>
3
4 unsigned int count = -1;
5
6 void *thread( void *p )
7 {
8 while ( count-- );
9
10 return NULL;
(gdb) b 8
Breakpoint 1 at 0x11b5: file test.c, line 8.
(gdb) r
Starting program: /mnt/vol2/work/tmp/test
Downloading separate debug info for system-supplied DSO at 0x7ffff7fc3000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7bff6c0 (LWP 67336)]
[Switching to Thread 0x7ffff7bff6c0 (LWP 67336)]
Thread 2 "test" hit Breakpoint 1, thread (p=0x0) at test.c:8
8 while ( count-- );
(gdb) p count
$1 = 4294967295
(gdb) quit
A debugging session is active.
Inferior 1 [process 67332] will be killed.
Quit anyway? (y or n) y
$