Re: multithreaded programs on arm-linux

Frank Meerkoetter
2005-11-04T09:23:36Z

Quoting Daniel Jacobowitz <drow@false.org>:

> On Thu, Nov 03, 2005 at 06:50:47PM +0100, Frank Meerkoetter wrote:
>> objfile is NULL, why i couldn't figure out.
>
> That should be true the first time but not the second, if you've used
> "file".

Ok. The first time objfile is null. The second time target_has_execution
is false.

# ./gdb ./gdb
GNU gdb 6.3
This GDB was configured as "arm-linux"...Using host libthread_db library
"/lib/libthread_db.so.1".

(gdb) l ../../gdb-6.3/gdb/thread-db.c:679
warning: Source file is more recent than executable.

674 }
675 }
676
677 /* Don't attempt to use thread_db on targets which can not run
678 (core files). */
679 if (objfile == NULL || !target_has_execution)
680 {
681 /* All symbols have been discarded. If the thread_db target is
682 active, deactivate it now. */
683 if (using_thread_db)
(gdb)
684 {
685 gdb_assert (proc_handle.pid == 0);
686 unpush_target (&thread_db_ops);
687 using_thread_db = 0;
688 }
689
690 goto quit;
691 }
692
693 if (using_thread_db)
(gdb) b ../../gdb-6.3/gdb/thread-db.c:679
Breakpoint 1 at 0x5c62c: file ../../gdb-6.3/gdb/thread-db.c, line 679.
(gdb) r
Starting program: /progfs/opt/Qtopia/bin/gdb

GNU gdb 6.3
This GDB was configured as "arm-linux".
(gdb) file apdf
Reading symbols from /progfs/opt/Qtopia/bin/apdf...done.
Using host libthread_db library "/lib/libthread_db.so.1".

// first round

Breakpoint 1, thread_db_new_objfile (objfile=0x0) at
../../gdb-6.3/gdb/thread-db.c:679
679 if (objfile == NULL || !target_has_execution)
(gdb) p objfile
$1 = (struct objfile *) 0x0
(gdb) n
683 if (using_thread_db)
(gdb) p using_thread_db
$2 = 0
(gdb) n
729 if (target_new_objfile_chain)
(gdb) p target_new_objfile_chain
$3 = (void (*)()) 0
(gdb) n
731 }
(gdb) c
Continuing.

// second round

Breakpoint 1, thread_db_new_objfile (objfile=0x2ceb08) at
../../gdb-6.3/gdb/thread-db.c:679
679 if (objfile == NULL || !target_has_execution)
(gdb) p objfile
$4 = (struct objfile *) 0x2ceb08
// current_target.to_has_execution = 0
(gdb) n
683 if (using_thread_db)
(gdb) n
729 if (target_new_objfile_chain)
(gdb) n
731 }

Regards,
Frank