From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22562 invoked by alias); 6 Nov 2008 07:48:23 -0000 Received: (qmail 22547 invoked by uid 22791); 6 Nov 2008 07:48:22 -0000 X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.189) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 06 Nov 2008 07:47:46 +0000 Received: by ti-out-0910.google.com with SMTP id d10so246477tib.12 for ; Wed, 05 Nov 2008 23:47:45 -0800 (PST) Received: by 10.110.53.19 with SMTP id b19mr1801144tia.21.1225957665413; Wed, 05 Nov 2008 23:47:45 -0800 (PST) Received: by 10.110.42.9 with HTTP; Wed, 5 Nov 2008 23:47:45 -0800 (PST) Message-ID: Date: Thu, 06 Nov 2008 07:48:00 -0000 From: teawater To: "gdb-patches@sourceware.org" Subject: [RFA] Process record and replay, 4/10 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_24866_26873976.1225957665382" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00100.txt.bz2 ------=_Part_24866_26873976.1225957665382 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 1614 The process record and replay target has six function pointers record_beneath_to_resume, record_beneath_to_wait, record_beneath_to_prepare_to_store, record_beneath_to_xfer_partial, record_beneath_to_insert_breakpoint and record_beneath_to_remove_breakpoint. This patch add code to function "update_current_target" make these pointers always point to the function of lower strata target than process record and replay target. When GDB in record mode, we need to call the really debug function in low strata target because process record and replay target need call this function to control the inferior. Struct target_ops already has a pointer "beneath" point to low strata target, but process record and replay target doesn't use it. Because if low strata target doesn't set some function pointers, process record and replay target will need to call the function pointers of the target that is low strata target of this target. If this target doesn't set them too, it will need to call anothers. So use "beneath" is not a good choice and "multi-thread" target that need function pointers of low strata target doesn't use "beneath" too. 2008-11-06 Hui Zhu * target.c (update_current_target): Set function points record_beneath_to_resume, record_beneath_to_wait, record_beneath_to_prepare_to_store, record_beneath_to_xfer_partial, record_beneath_to_insert_breakpoint and record_beneath_to_remove_breakpoint point to the function of target that lower than process record and replay target. target.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) ------=_Part_24866_26873976.1225957665382 Content-Type: text/plain; name=target_record_beneath.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fn73ognf0 Content-Disposition: attachment; filename=target_record_beneath.txt Content-length: 2489 LS0tIGEvdGFyZ2V0LmMKKysrIGIvdGFyZ2V0LmMKQEAgLTQxLDYgKzQxLDcg QEAKICNpbmNsdWRlICJ0YXJnZXQtZGVzY3JpcHRpb25zLmgiCiAjaW5jbHVk ZSAiZ2RidGhyZWFkLmgiCiAjaW5jbHVkZSAic29saWIuaCIKKyNpbmNsdWRl ICJyZWNvcmQuaCIKIAogc3RhdGljIHZvaWQgdGFyZ2V0X2luZm8gKGNoYXIg KiwgaW50KTsKIApAQCAtMzg3LDYgKzM4OCwxMiBAQCB1cGRhdGVfY3VycmVu dF90YXJnZXQgKHZvaWQpCiAgICAgICBpZiAoIWN1cnJlbnRfdGFyZ2V0LkZJ RUxEKSBcCiAJY3VycmVudF90YXJnZXQuRklFTEQgPSAoVEFSR0VUKS0+RklF TEQKIAorICByZWNvcmRfYmVuZWF0aF90b19yZXN1bWUgPSBOVUxMOworICBy ZWNvcmRfYmVuZWF0aF90b19zdG9yZV9yZWdpc3RlcnMgPSBOVUxMOworICBy ZWNvcmRfYmVuZWF0aF90b194ZmVyX3BhcnRpYWwgPSBOVUxMOworICByZWNv cmRfYmVuZWF0aF90b19pbnNlcnRfYnJlYWtwb2ludCA9IE5VTEw7CisgIHJl Y29yZF9iZW5lYXRoX3RvX3JlbW92ZV9icmVha3BvaW50ID0gTlVMTDsKKwog ICBmb3IgKHQgPSB0YXJnZXRfc3RhY2s7IHQ7IHQgPSB0LT5iZW5lYXRoKQog ICAgIHsKICAgICAgIElOSEVSSVQgKHRvX3Nob3J0bmFtZSwgdCk7CkBAIC00 NzYsNiArNDgzLDM1IEBAIHVwZGF0ZV9jdXJyZW50X3RhcmdldCAodm9pZCkK ICAgICAgIC8qIERvIG5vdCBpbmhlcml0IHRvX21lbW9yeV9tYXAuICAqLwog ICAgICAgLyogRG8gbm90IGluaGVyaXQgdG9fZmxhc2hfZXJhc2UuICAqLwog ICAgICAgLyogRG8gbm90IGluaGVyaXQgdG9fZmxhc2hfZG9uZS4gICovCisK KyAgICAgIC8qIFNldCB0aGUgcmVhbCBiZW5lYXRoIGZ1bmN0aW9uIHBvaW50 ZXJzLiAqLworICAgICAgaWYgKHQgIT0gJnJlY29yZF9vcHMpCisgICAgICAg IHsKKyAgICAgICAgICAgaWYgKCFyZWNvcmRfYmVuZWF0aF90b19yZXN1bWUp CisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcmVjb3JkX2JlbmVh dGhfdG9fcmVzdW1lID0gdC0+dG9fcmVzdW1lOworICAgICAgICAgICAgIH0K KyAgICAgICAgICAgaWYgKCFyZWNvcmRfYmVuZWF0aF90b193YWl0KQorICAg ICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHJlY29yZF9iZW5lYXRoX3Rv X3dhaXQgPSB0LT50b193YWl0OworICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgaWYgKCFyZWNvcmRfYmVuZWF0aF90b19zdG9yZV9yZWdpc3RlcnMpCisg ICAgICAgICAgICAgeworICAgICAgICAgICAgICAgcmVjb3JkX2JlbmVhdGhf dG9fc3RvcmVfcmVnaXN0ZXJzID0gdC0+dG9fc3RvcmVfcmVnaXN0ZXJzOwor ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgaWYgKCFyZWNvcmRfYmVuZWF0 aF90b194ZmVyX3BhcnRpYWwpCisgICAgICAgICAgICAgeworICAgICAgICAg ICAgICAgcmVjb3JkX2JlbmVhdGhfdG9feGZlcl9wYXJ0aWFsID0gdC0+dG9f eGZlcl9wYXJ0aWFsOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgaWYg KCFyZWNvcmRfYmVuZWF0aF90b19pbnNlcnRfYnJlYWtwb2ludCkKKyAgICAg ICAgICAgICB7CisgICAgICAgICAgICAgICByZWNvcmRfYmVuZWF0aF90b19p bnNlcnRfYnJlYWtwb2ludCA9IHQtPnRvX2luc2VydF9icmVha3BvaW50Owor ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgaWYgKCFyZWNvcmRfYmVuZWF0 aF90b19yZW1vdmVfYnJlYWtwb2ludCkKKyAgICAgICAgICAgICB7CisgICAg ICAgICAgICAgICByZWNvcmRfYmVuZWF0aF90b19yZW1vdmVfYnJlYWtwb2lu dCA9IHQtPnRvX3JlbW92ZV9icmVha3BvaW50OworICAgICAgICAgICAgIH0K KyAgICAgICAgfQogICAgIH0KICN1bmRlZiBJTkhFUklUCiAK ------=_Part_24866_26873976.1225957665382--