X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=gdb%2Fstap-probe.c;h=50f6d518133a3f7e47ee46f7b2df20d287e52fbe;hb=7f0ae84c80aae6fe8f7573343fe1ab455d18b5d8;hp=5e9a043ffebaf9ec933630fdb7c0a2ff84c3bff3;hpb=47e9d49d2d795224f4b3f04c89c268627b850be4;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c index 5e9a043ffe..50f6d51813 100644 --- a/gdb/stap-probe.c +++ b/gdb/stap-probe.c @@ -1430,9 +1430,6 @@ stap_modify_semaphore (CORE_ADDR address, int set, struct gdbarch *gdbarch) struct type *type = builtin_type (gdbarch)->builtin_unsigned_short; ULONGEST value; - if (address == 0) - return; - /* Swallow errors. */ if (target_read_memory (address, bytes, TYPE_LENGTH (type)) != 0) { @@ -1466,6 +1463,8 @@ stap_modify_semaphore (CORE_ADDR address, int set, struct gdbarch *gdbarch) void stap_probe::set_semaphore (struct objfile *objfile, struct gdbarch *gdbarch) { + if (m_sem_addr == 0) + return; stap_modify_semaphore (relocate_address (m_sem_addr, objfile), 1, gdbarch); } @@ -1474,6 +1473,8 @@ stap_probe::set_semaphore (struct objfile *objfile, struct gdbarch *gdbarch) void stap_probe::clear_semaphore (struct objfile *objfile, struct gdbarch *gdbarch) { + if (m_sem_addr == 0) + return; stap_modify_semaphore (relocate_address (m_sem_addr, objfile), 0, gdbarch); }