/*
Copyright (C) 2000,2004 Silicon Graphics, Inc. All Rights Reserved.
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
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., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
For further information regarding this notice, see:
*/
#include "config.h"
#include "libdwarfdefs.h"
#include <stdio.h>
#include <string.h>
#include "pro_incl.h"
#include "pro_section.h"
#include "pro_macinfo.h"
/*
I don't much like the error strings this generates, since
like the rest of libdwarf they are simple strings with
no useful numbers in them. But that's not something I can
fix without more work than I have time for
right now. davea Nov 94.
*/
/* these are gross overestimates of the number of
** bytes needed to store a number in LEB form.
** Just estimates, and since blocks are reasonable size,
** the end-block waste is small.
** Of course the waste is NOT present on disk.
*/
static int
{
unsigned char *nextchar;
if (curblk == 0) {
/* initial allocation */
}
newb =
if (!newb) {
return DW_DLV_ERROR;
}
(char *) newb + sizeof(struct dw_macinfo_block_s);
newb->mb_used_len = 0;
/* no space left in block: allocate a new block */
}
newb =
if (!newb) {
return DW_DLV_ERROR;
}
(char *) newb + sizeof(struct dw_macinfo_block_s);
newb->mb_used_len = 0;
}
/* now curblk has enough room */
nextchar =
dbg->de_compose_avail--;
return DW_DLV_OK;
}
static void
{
unsigned char *nextchar;
nextchar =
return;
}
static int
{
unsigned char *nextchar;
int res;
int nbytes;
nextchar =
/* Put the created leb number directly into the macro buffer If
dbg->de_compose_avail is > INT_MAX this will not work as the
'int' will look negative to _dwarf_pro_encode_leb128_nm! */
(char *) nextchar,
(int) dbg->de_compose_avail);
return DW_DLV_ERROR;
}
return DW_DLV_OK;
}
/*
This function actually 'commits' the space used by the
preceeding calls.
*/
static int
{
return DW_DLV_ERROR;
}
return DW_DLV_OK;
}
int
{
int res;
int compose_error_type;
return (DW_DLV_ERROR);
}
if (macname == 0) {
return (DW_DLV_ERROR);
}
if (len == 0) {
return (DW_DLV_ERROR);
}
if (macvalue) {
} else {
len2 = 0;
}
for
space
character
we
add */
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
if (macvalue) {
}
return (DW_DLV_ERROR);
}
return DW_DLV_OK;
}
int
{
int res;
int compose_error_type;
return (DW_DLV_ERROR);
}
if (macname == 0) {
return (DW_DLV_ERROR);
}
if (len == 0) {
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return DW_DLV_OK;
}
int
{
int res;
int compose_error_type;
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return DW_DLV_OK;
}
int
{
int res;
int compose_error_type;
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return DW_DLV_OK;
}
int
{
int res;
int compose_error_type;
return (DW_DLV_ERROR);
}
if (string == 0) {
return (DW_DLV_ERROR);
}
if (len == 0) {
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return (DW_DLV_ERROR);
}
return DW_DLV_OK;
}
int
Dwarf_Error * error)
{
/* Total num of bytes in .debug_macinfo section. */
/* Points to first byte of .debug_macinfo buffer. */
/* Fills in the .debug_macinfo buffer. */
/* Used to scan the section data buffers. */
/* Get the size of the debug_macinfo data */
mac_num_bytes = 0;
}
/* Tthe final entry has a type code of 0 to indicate It is final
for this CU Takes just 1 byte. */
mac_num_bytes += 1;
return (0);
}
m_prev = 0;
if (m_prev) {
m_prev = 0;
}
}
*macinfo_ptr = 0; /* the type code of 0 as last entry */
if (m_prev) {
m_prev = 0;
}
return (int) dbg->de_n_debug_sect;
}