public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* S/390 modernization tasks
@ 2003-04-23 23:18 Jim Blandy
  2003-04-24 19:17 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Blandy @ 2003-04-23 23:18 UTC (permalink / raw)
  To: gdb


At the moment, s390-tdep.c uses quite a few deprecated gdbarch
methods.  Here's a list of the changes currently needed to bring that
code forward.  So much has changed that I'm sure some of the
descriptions of what needs to be done aren't exactly right, but at the
very least, I think they'll point to areas that need attention.

- The way a target maps out its register set has changed.

  These old methods don't seem to be necessary any more:
  - DEPRECATED_MAX_REGISTER_RAW_SIZE
  - DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE

  The new method gdbarch_register_type seems to replace:
  - gdbarch_pseudo_register_read
  - gdbarch_pseudo_register_write

- Some interfaces now use regcaches instead of byte arrays.

  A number of gdbarch methods have been converted from using a raw
  registers array (or the equivalent) to using the more opaque
  regcache structure.  These include:
  - EXTRACT_RETURN_VALUE
  - STORE_RETURN_VALUE
  - EXTRACT_STRUCT_VALUE_ADDRESS (which the s390 can't do anyway)

- There is a new, much simpler interface for frame unwinding.

  One simply registers a function that, given a frame's PC, returns a
  structure of pointers to functions that can unwind that frame's
  registers.  This seems to replace a number of functions:
  - DEPRECATED_FRAME_CHAIN
  - DEPRECATED_FRAME_SAVED_PC
  - DEPRECATED_INIT_FRAME_PC
  - DEPRECATED_INIT_FRAME_PC_FIRST
  - DEPRECATED_FRAME_INIT_SAVED_REGS
  - DEPRECATED_INIT_EXTRA_FRAME_INFO
  - DEPRECATED_SAVED_PC_AFTER_CALL
  - DEPRECATED_POP_FRAME

- The generic_find_dummy_frame function now returns a regcache.

  The functions s390_frame_saved_pc_nofix and s390_frame_chain use
  deprecated_generic_find_dummy_frame, which returns an array of bytes
  containing values for the registers saved in the dummy frame.  The
  new generic_find_dummy_frame interface returns a regcache instead.

  The functions that use generic_find_dummy_frame will all go away (I
  think) under the new frame unwinding system, so this may not need
  attention if that's done first.  However, it is a quick improvement
  that one could get out of the way before undertaking the larger
  project.

- There is a new inferior function call interface.

  The new push_dummy_call gdbarch method combines all the following
  into one call with a lot of arguments:
  - DEPRECATED_PUSH_ARGUMENTS
  - DEPRECATED_PUSH_RETURN_ADDRESS
  - DEPRECATED_DUMMY_WRITE_SP
  - DEPRECATED_STORE_STRUCT_RETURN

- The DEPRECATED_PC_IN_CALL_DUMMY function isn't necessary any more.

  Each dummy frame structure now holds the address at which its return
  breakpoint is set; this means that generic code (specifically,
  pc_in_dummy_frame) can recognize PC's at call dummy breakpoints.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: S/390 modernization tasks
  2003-04-23 23:18 S/390 modernization tasks Jim Blandy
@ 2003-04-24 19:17 ` Andrew Cagney
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2003-04-24 19:17 UTC (permalink / raw)
  To: Jim Blandy; +Cc: gdb

> At the moment, s390-tdep.c uses quite a few deprecated gdbarch
> methods.  Here's a list of the changes currently needed to bring that
> code forward.  So much has changed that I'm sure some of the
> descriptions of what needs to be done aren't exactly right, but at the
> very least, I think they'll point to areas that need attention.
> 
> - The way a target maps out its register set has changed.
> 
>   These old methods don't seem to be necessary any more:
>   - DEPRECATED_MAX_REGISTER_RAW_SIZE
>   - DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE
> 
>   The new method gdbarch_register_type seems to replace:

FYI,

# The methods REGISTER_VIRTUAL_TYPE, MAX_REGISTER_RAW_SIZE,
# MAX_REGISTER_VIRTUAL_SIZE, MAX_REGISTER_RAW_SIZE,
# REGISTER_VIRTUAL_SIZE and REGISTER_RAW_SIZE are all being replaced
# by REGISTER_TYPE.

(gdbarch.sh)

so

>   - gdbarch_pseudo_register_read
>   - gdbarch_pseudo_register_write

these are safe.

> - Some interfaces now use regcaches instead of byte arrays.

It's more strict, all interfaces are passed either an explicit regcache 
or frame.  Even the old and faithful read_register() is on the way out.

>   A number of gdbarch methods have been converted from using a raw

I think I've fixed all of them.  The ones remaining are like 
TARGET_READ_FP (which I'm about to deprecate) which still rely on the 
implicit global register cache.

>   registers array (or the equivalent) to using the more opaque
>   regcache structure.  These include:
>   - EXTRACT_RETURN_VALUE
>   - STORE_RETURN_VALUE
>   - EXTRACT_STRUCT_VALUE_ADDRESS (which the s390 can't do anyway)
> 
> - There is a new, much simpler interface for frame unwinding.
> 
>   One simply registers a function that, given a frame's PC, returns a
>   structure of pointers to functions that can unwind that frame's
>   registers.  This seems to replace a number of functions:
>   - DEPRECATED_FRAME_CHAIN
>   - DEPRECATED_FRAME_SAVED_PC
>   - DEPRECATED_INIT_FRAME_PC
>   - DEPRECATED_INIT_FRAME_PC_FIRST
>   - DEPRECATED_FRAME_INIT_SAVED_REGS
>   - DEPRECATED_INIT_EXTRA_FRAME_INFO
>   - DEPRECATED_SAVED_PC_AFTER_CALL
>   - DEPRECATED_POP_FRAME

See "frame-unwind.h" and "frame-base.h" for the interfaces; and the d10v 
for a working example.

The important things are:

- each unwinder is responsible for unwinding one type of frame
- an unwinder can't assume or query the type of the next inner frame

> - The generic_find_dummy_frame function now returns a regcache.

Oops, generic_find_dummy_frame isn't a replacement for 
deprecated_generic_find_dummy_frame.  Per the fixme:

/* FIXME: cagney/2002-11-08: The function only exists because of
    deprecated_generic_get_saved_register.  Eliminate that function and
    this, to, can go.  */

Perhaphs I should deprecate this as well.

>   The functions s390_frame_saved_pc_nofix and s390_frame_chain use
>   deprecated_generic_find_dummy_frame, which returns an array of bytes
>   containing values for the registers saved in the dummy frame.  The
>   new generic_find_dummy_frame interface returns a regcache instead.
> 
>   The functions that use generic_find_dummy_frame will all go away (I
>   think) under the new frame unwinding system, so this may not need
>   attention if that's done first.  However, it is a quick improvement
>   that one could get out of the way before undertaking the larger
>   project.

> - There is a new inferior function call interface.
> 
>   The new push_dummy_call gdbarch method combines all the following
>   into one call with a lot of arguments:
>   - DEPRECATED_PUSH_ARGUMENTS
>   - DEPRECATED_PUSH_RETURN_ADDRESS
>   - DEPRECATED_DUMMY_WRITE_SP
>   - DEPRECATED_STORE_STRUCT_RETURN

It gained two parameters:

- an explicit regcache
- an explicit call dummy address

The typical PUSH_ARGUMENTS was already doing much of the above using 
implicit regcache and dummy-address parameters.

  - The DEPRECATED_PC_IN_CALL_DUMMY function isn't necessary any more.
> 
>   Each dummy frame structure now holds the address at which its return
>   breakpoint is set; this means that generic code (specifically,
>   pc_in_dummy_frame) can recognize PC's at call dummy breakpoints.

Sort of.  More to the point is that tdep frame code is no longer 
responsible for handling dummy frames, and hence, no longer needs to 
identify dummy frames.

Looks like I need to mark up even more functions.

Andrew


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-24 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-23 23:18 S/390 modernization tasks Jim Blandy
2003-04-24 19:17 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).