summaryrefslogtreecommitdiff
path: root/usr/src/tools/ctf/dwarf/common/dwarf_string.c
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2011-05-22 03:13:22 +0100
committerRichard Lowe <richlowe@richlowe.net>2011-05-22 03:13:22 +0100
commit07dc1947c362e187fb955d283b692f8769dd5def (patch)
tree5933d1a754972260a22d1bda9ea247bab7979dae /usr/src/tools/ctf/dwarf/common/dwarf_string.c
parentba2b2c94236651f014e4f9255b7075e654a853dd (diff)
downloadillumos-joyent-07dc1947c362e187fb955d283b692f8769dd5def.tar.gz
2004 newer gcc, and sanity, would benefit from a newer libdwarf
Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Joshua M. Clulow <josh@sysmgr.org> Approved by: Gordon Ross <gwr@nexenta.com>
Diffstat (limited to 'usr/src/tools/ctf/dwarf/common/dwarf_string.c')
-rw-r--r--usr/src/tools/ctf/dwarf/common/dwarf_string.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/usr/src/tools/ctf/dwarf/common/dwarf_string.c b/usr/src/tools/ctf/dwarf/common/dwarf_string.c
index 886174ee8a..fafa5a097c 100644
--- a/usr/src/tools/ctf/dwarf/common/dwarf_string.c
+++ b/usr/src/tools/ctf/dwarf/common/dwarf_string.c
@@ -1,6 +1,7 @@
/*
- Copyright (C) 2000, 2002 Silicon Graphics, Inc. All Rights Reserved.
+ Copyright (C) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
+ Portions Copyright (C) 2009-2010 David Anderson. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
@@ -19,10 +20,10 @@
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
- Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
+ Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
http://www.sgi.com
@@ -40,42 +41,38 @@
int
dwarf_get_str(Dwarf_Debug dbg,
- Dwarf_Off offset,
- char **string,
- Dwarf_Signed * returned_str_len, Dwarf_Error * error)
+ Dwarf_Off offset,
+ char **string,
+ Dwarf_Signed * returned_str_len, Dwarf_Error * error)
{
- int res;
+ int res = DW_DLV_ERROR;
if (dbg == NULL) {
- _dwarf_error(NULL, error, DW_DLE_DBG_NULL);
- return (DW_DLV_ERROR);
+ _dwarf_error(NULL, error, DW_DLE_DBG_NULL);
+ return (DW_DLV_ERROR);
}
- if (offset == dbg->de_debug_str_size) {
- /* Normal (if we've iterated thru the set of strings
- using dwarf_get_str and are at the end). */
- return DW_DLV_NO_ENTRY;
+ if (offset == dbg->de_debug_str.dss_size) {
+ /* Normal (if we've iterated thru the set of strings using
+ dwarf_get_str and are at the end). */
+ return DW_DLV_NO_ENTRY;
}
- if (offset > dbg->de_debug_str_size) {
- _dwarf_error(dbg, error, DW_DLE_DEBUG_STR_OFFSET_BAD);
- return (DW_DLV_ERROR);
+ if (offset > dbg->de_debug_str.dss_size) {
+ _dwarf_error(dbg, error, DW_DLE_DEBUG_STR_OFFSET_BAD);
+ return (DW_DLV_ERROR);
}
if (string == NULL) {
- _dwarf_error(dbg, error, DW_DLE_STRING_PTR_NULL);
- return (DW_DLV_ERROR);
+ _dwarf_error(dbg, error, DW_DLE_STRING_PTR_NULL);
+ return (DW_DLV_ERROR);
}
- res =
- _dwarf_load_section(dbg,
- dbg->de_debug_str_index,
- &dbg->de_debug_str,
- error);
+ res = _dwarf_load_section(dbg, &dbg->de_debug_str,error);
if (res != DW_DLV_OK) {
return res;
}
- *string = (char *) dbg->de_debug_str + offset;
+ *string = (char *) dbg->de_debug_str.dss_data + offset;
*returned_str_len = (strlen(*string));
return DW_DLV_OK;