This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

threads/1858: remote debugging a multithreaded application with gdb creates a SIGTRAP


>Number:         1858
>Category:       threads
>Synopsis:       remote debugging a multithreaded application with gdb creates a SIGTRAP
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 02 04:18:00 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator:     kraj@mvista.com
>Release:        unknown-1.0
>Organization:
>Environment:
native build on i686
>Description:
The attached program can not be debugged because of following error
=======================================
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
The program no longer exists.

on gdbserver I get the following error.
=======================================
Child terminated with signal = 5

Child terminated with signal = 0x5
GDBserver exiting

======================================

however if I dont set breakpoints and just run as such then the program runs fine and exits are OK.


>How-To-Repeat:
compile the attached file
gcc -pthread test.c -g -O0

run gdbserver

gdbserver localhost:1234 a.out

run gdb 

gdb a.out

(gdb) target remote localhost:1234 
(gdb) b main
(gdb) r
(gdb) b sleeping
(gdb) c
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-csrc; name="test.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.c"

I2RlZmluZSBfUkVFTlRSQU5UICAgIC8qIGJhc2ljIDMtbGluZXMgZm9yIHRocmVhZHMgKi8KI2lu
Y2x1ZGUgPHB0aHJlYWQuaD4KCiNkZWZpbmUgTlVNX1RIUkVBRFMgNQojZGVmaW5lIFNMRUVQX1RJ
TUUgMTAKdm9pZCAqc2xlZXBpbmcodm9pZCAqKTsgICAvKiB0aHJlYWQgcm91dGluZSAqLwp2b2lk
IHNsZWVwX21vcmUoKTsKCmludCBpOwpwdGhyZWFkX3QgdGlkW05VTV9USFJFQURTXTsgICAgICAv
KiBhcnJheSBvZiB0aHJlYWQgSURzICovCgppbnQKbWFpbihpbnQgYXJnYywgY2hhciAqYXJndltd
KQp7CiAgICAgICBmb3IgKCBpID0gMDsgaSA8IE5VTV9USFJFQURTOyBpKyspCiAgICAgICAgICAg
IHB0aHJlYWRfY3JlYXRlKCZ0aWRbaV0sIE5VTEwsIHNsZWVwaW5nLAoJICAgICAgICAgICAgICAg
ICAgICh2b2lkICopU0xFRVBfVElNRSk7CgkgICAgZm9yICggaSA9IDA7IGkgPCBOVU1fVEhSRUFE
UzsgaSsrKQoJCXB0aHJlYWRfam9pbih0aWRbaV0sIE5VTEwpOwoJcHJpbnRmKCJtYWluKCkgcmVw
b3J0aW5nIHRoYXQgYWxsICVkIHRocmVhZHMgaGF2ZSB0ZXJtaW5hdGVkXG4iLCBpKTsKCXJldHVy
biAoMCk7Cn0KCnZvaWQgKgpzbGVlcGluZyh2b2lkICphcmcpCnsKICAgIGludCBzbGVlcF90aW1l
ID0gKGludClhcmc7CiAgICBwcmludGYoInRocmVhZCAlZCBzbGVlcGluZyAlZCBzZWNvbmRzIC4u
LlxuIiwgcHRocmVhZF9zZWxmKCksIHNsZWVwX3RpbWUpOwogICAgc2xlZXAoc2xlZXBfdGltZSk7
CiAgICBwcmludGYoIlxudGhyZWFkICVkIGF3YWtlbmluZ1xuIiwgcHRocmVhZF9zZWxmKCkpOwp9
Cg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]