From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23364 invoked by alias); 16 Nov 2008 08:20:44 -0000 Received: (qmail 23247 invoked by uid 22791); 16 Nov 2008 08:20:43 -0000 X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.191) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 16 Nov 2008 08:20:08 +0000 Received: by ti-out-0910.google.com with SMTP id d10so1447718tib.12 for ; Sun, 16 Nov 2008 00:20:05 -0800 (PST) Received: by 10.110.103.5 with SMTP id a5mr3469065tic.26.1226823605025; Sun, 16 Nov 2008 00:20:05 -0800 (PST) Received: by 10.110.103.3 with HTTP; Sun, 16 Nov 2008 00:20:04 -0800 (PST) Message-ID: Date: Sun, 16 Nov 2008 23:37:00 -0000 From: teawater To: "gdb-patches@sourceware.org" Subject: [RFA] Resubmit process record and replay, 4/10 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_40474_31193911.1226823605023" 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/msg00412.txt.bz2 ------=_Part_40474_31193911.1226823605023 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 2402 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-16 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(+) Following is the diff with the previous patch: @@ -8,7 +8,7 @@ static void target_info (char *, int); -@@ -387,6 +388,12 @@ update_current_target (void) +@@ -405,6 +406,12 @@ if (!current_target.FIELD) \ current_target.FIELD = (TARGET)->FIELD @@ -21,12 +21,12 @@ for (t = target_stack; t; t = t->beneath) { INHERIT (to_shortname, t); -@@ -476,6 +483,35 @@ update_current_target (void) +@@ -494,6 +501,35 @@ /* Do not inherit to_memory_map. */ /* Do not inherit to_flash_erase. */ /* Do not inherit to_flash_done. */ + -+ /* Set the real beneath function pointers. */ ++ /* Set pointers to functions in the target beneath us. */ + if (t != &record_ops) + { + if (!record_beneath_to_resume) ------=_Part_40474_31193911.1226823605023 Content-Type: text/plain; name=4-target_record_beneath.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fnlf3e4x1 Content-Disposition: attachment; filename=4-target_record_beneath.txt Content-length: 2428 LS0tIGEvdGFyZ2V0LmMKKysrIGIvdGFyZ2V0LmMKQEAgLTQxLDYgKzQxLDcg QEAKICNpbmNsdWRlICJ0YXJnZXQtZGVzY3JpcHRpb25zLmgiCiAjaW5jbHVk ZSAiZ2RidGhyZWFkLmgiCiAjaW5jbHVkZSAic29saWIuaCIKKyNpbmNsdWRl ICJyZWNvcmQuaCIKIAogc3RhdGljIHZvaWQgdGFyZ2V0X2luZm8gKGNoYXIg KiwgaW50KTsKIApAQCAtNDA1LDYgKzQwNiwxMiBAQAogICAgICAgaWYgKCFj dXJyZW50X3RhcmdldC5GSUVMRCkgXAogCWN1cnJlbnRfdGFyZ2V0LkZJRUxE ID0gKFRBUkdFVCktPkZJRUxECiAKKyAgcmVjb3JkX2JlbmVhdGhfdG9fcmVz dW1lID0gTlVMTDsKKyAgcmVjb3JkX2JlbmVhdGhfdG9fc3RvcmVfcmVnaXN0 ZXJzID0gTlVMTDsKKyAgcmVjb3JkX2JlbmVhdGhfdG9feGZlcl9wYXJ0aWFs ID0gTlVMTDsKKyAgcmVjb3JkX2JlbmVhdGhfdG9faW5zZXJ0X2JyZWFrcG9p bnQgPSBOVUxMOworICByZWNvcmRfYmVuZWF0aF90b19yZW1vdmVfYnJlYWtw b2ludCA9IE5VTEw7CisKICAgZm9yICh0ID0gdGFyZ2V0X3N0YWNrOyB0OyB0 ID0gdC0+YmVuZWF0aCkKICAgICB7CiAgICAgICBJTkhFUklUICh0b19zaG9y dG5hbWUsIHQpOwpAQCAtNDk0LDYgKzUwMSwzNSBAQAogICAgICAgLyogRG8g bm90IGluaGVyaXQgdG9fbWVtb3J5X21hcC4gICovCiAgICAgICAvKiBEbyBu b3QgaW5oZXJpdCB0b19mbGFzaF9lcmFzZS4gICovCiAgICAgICAvKiBEbyBu b3QgaW5oZXJpdCB0b19mbGFzaF9kb25lLiAgKi8KKworICAgICAgLyogU2V0 IHBvaW50ZXJzIHRvIGZ1bmN0aW9ucyBpbiB0aGUgdGFyZ2V0IGJlbmVhdGgg dXMuICAqLworICAgICAgaWYgKHQgIT0gJnJlY29yZF9vcHMpCisgICAgICAg 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_40474_31193911.1226823605023--