This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Reusing GCC code in GDB
- From: Alan Hayward <Alan dot Hayward at arm dot com>
- To: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Cc: nd <nd at arm dot com>
- Date: Tue, 13 Mar 2018 11:42:50 +0000
- Subject: Reusing GCC code in GDB
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan dot Hayward at arm dot com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
I’m looking at a GDB issue where GDB is not consistent with GCC*, and requires (more or less) the rewrite of a self-contained section of code in the GDB aarch64 backend.
Given GCC already has the correct behaviour, I’m considering copying the block of GCC code (all from gcc/config/aarch64/aarch64.c) into GDB (gdb/aarch64-tdep.c) and replacing the GCC structures with the equivalent GDB ones. Unless the gdb code requires it, I’m NOT planning on changing the function names, code comments or code flow logic.
Given that GDB and GCC are both FSF projects, I was hoping that this would be ok. However, I wanted to check first before I went ahead.
Thanks,
Alan.
*pr gdb/22943. The issue is passing structures in FP registers for function arguments (HVAs and HFAs). GDB doesn’t take into account nested structures. I’m looking at using the gcc function aarch64_vfp_is_call_or_return_candidate() and the sub functions it uses.