This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 07/11] s390: Hook s390 into OSABI mechanism
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: prudo at linux dot vnet dot ibm dot com (Philipp Rudo)
- Cc: gdb-patches at sourceware dot org, arnez at linux dot vnet dot ibm dot com (Andreas Arnez)
- Date: Tue, 5 Dec 2017 14:20:55 +0100 (CET)
- Subject: Re: [PATCH v2 07/11] s390: Hook s390 into OSABI mechanism
- Authentication-results: sourceware.org; auth=none
Philipp Rudo wrote:
Just a couple of quick comments on the common vs. Linux split.
> + set_gdbarch_guess_tracepoint_registers (gdbarch,
> + s390_guess_tracepoint_registers);
This is OS-independent as far as I can see.
> + /* Frame handling. */
> + frame_unwind_append_unwinder (gdbarch, &s390_stub_frame_unwind);
> + frame_unwind_append_unwinder (gdbarch, &s390_sigtramp_frame_unwind);
> + frame_unwind_append_unwinder (gdbarch, &s390_frame_unwind);
> + frame_base_set_default (gdbarch, &s390_frame_base);
All of that *except* the sigtramp unwinder is OS-independent. In fact,
if move the prolog-based sniffer to common code, you'll see that you no
longer need to export various internal routines from s390-tdep.c to
s390-linux-tdep.c.
This may require swapping the order of the stub and the sigtramp unwinder,
but that should be harmless. In the end you should have this sequence:
- first, in common code, announce all the DWARF-based unwinders
- then, in Linux ABI code, announce the sigtramp unwinder
- finally, back in common code, announce all the fallback unwinders
> set_gdbarch_process_record (gdbarch, s390_process_record);
> set_gdbarch_process_record_signal (gdbarch, s390_linux_record_signal);
The first of these should be generic, only the second is Linux specific
(that's why there are two different callbacks to begin with!).
> + /* Miscellaneous. */
> + set_gdbarch_stap_is_single_operand (gdbarch, s390_stap_is_single_operand);
> + set_gdbarch_gcc_target_options (gdbarch, s390_gcc_target_options);
> + set_gdbarch_gnu_triplet_regexp (gdbarch, s390_gnu_triplet_regexp);
Are these really Linux-specific?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com