diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2008-05-04 09:28:27 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2008-05-04 09:28:27 +0000 |
commit | c47ffbe3b159da69fcc66cb7ad3a69077641b384 (patch) | |
tree | 2b2787dd5be1f1afca6ee3cb7c9ad40950507445 /gdb/auxv.c | |
parent | 55cd6f92dce132108458c2b1bcdba08fc7feb5da (diff) | |
download | gdb-c47ffbe3b159da69fcc66cb7ad3a69077641b384.zip gdb-c47ffbe3b159da69fcc66cb7ad3a69077641b384.tar.gz gdb-c47ffbe3b159da69fcc66cb7ad3a69077641b384.tar.bz2 |
Fix auxv data parsing on 64-bit solaris
* target.h (struct target_ops): New field to_auxv_parse.
* auxv.c (default_auxv_parse): New, renamed from previous
target_auxv_parse.
(target_auxv_parse): Try to call target method. Fallback to
default_auxv_parse if not found.
* procfs.c (procfs_auxv_parse): New.
(init_procfs_ops): On Solaris, in 64-bit mode, install
procfs_auxv_parse.
Diffstat (limited to 'gdb/auxv.c')
-rw-r--r-- | gdb/auxv.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -79,7 +79,7 @@ procfs_xfer_auxv (struct target_ops *ops, Return -1 if there is insufficient buffer for a whole entry. Return 1 if an entry was read into *TYPEP and *VALP. */ int -target_auxv_parse (struct target_ops *ops, gdb_byte **readptr, +default_auxv_parse (struct target_ops *ops, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) { const int sizeof_auxv_field = TYPE_LENGTH (builtin_type_void_data_ptr); @@ -100,6 +100,22 @@ target_auxv_parse (struct target_ops *ops, gdb_byte **readptr, return 1; } +/* Read one auxv entry from *READPTR, not reading locations >= ENDPTR. + Return 0 if *READPTR is already at the end of the buffer. + Return -1 if there is insufficient buffer for a whole entry. + Return 1 if an entry was read into *TYPEP and *VALP. */ +int +target_auxv_parse (struct target_ops *ops, gdb_byte **readptr, + gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) +{ + struct target_ops *t; + for (t = ops; t != NULL; t = t->beneath) + if (t->to_auxv_parse != NULL) + return t->to_auxv_parse (t, readptr, endptr, typep, valp); + + return default_auxv_parse (ops, readptr, endptr, typep, valp); +} + /* Extract the auxiliary vector entry with a_type matching MATCH. Return zero if no such entry was found, or -1 if there was an error getting the information. On success, return 1 after |