static void get_debug_info(Addr instr_addr, const HChar **dir,
const HChar **file, const HChar **fn, UInt* line)
{
- Bool found_dirname;
Bool found_file_line = VG_(get_filename_linenum)(
instr_addr,
- file, dir, &found_dirname,
+ file, dir,
line
);
Bool found_fn = VG_(get_fnname)(instr_addr, fn);
Bool get_debug_pos(BBCC* bbcc, Addr addr, AddrPos* p)
{
const HChar *file, *dir;
- Bool found_file_line, found_dirname;
+ Bool found_file_line;
int cachepos = addr % DEBUG_CACHE_SIZE;
found_file_line = VG_(get_filename_linenum)(addr,
&file,
&dir,
- &found_dirname,
&(p->line));
if (!found_file_line) {
file = "???";
const HChar **fn_name, UInt* line_num,
DebugInfo** pDebugInfo)
{
- Bool found_file_line, found_fn, found_dirname, result = True;
+ Bool found_file_line, found_fn, result = True;
UInt line;
CLG_DEBUG(6, " + get_debug_info(%#lx)\n", instr_addr);
found_file_line = VG_(get_filename_linenum)(instr_addr,
file,
dir,
- &found_dirname,
&line);
found_fn = VG_(get_fnname)(instr_addr, fn_name);
Bool VG_(get_filename_linenum) ( Addr a,
/*OUT*/const HChar** filename,
/*OUT*/const HChar** dirname,
- /*OUT*/Bool* dirname_available,
/*OUT*/UInt* lineno )
{
DebugInfo* si;
Word locno;
UInt fndn_ix;
- vg_assert( (dirname == NULL && dirname_available == NULL)
- ||
- (dirname != NULL && dirname_available != NULL) );
-
search_all_loctabs ( a, &si, &locno );
if (si == NULL) {
- if (dirname_available) {
- *dirname_available = False;
+ if (dirname) {
*dirname = "";
}
*filename = ""; // this used to be not initialised....
if (dirname) {
/* caller wants directory info too .. */
*dirname = ML_(fndn_ix2dirname) (si, fndn_ix);
- *dirname_available = (*dirname)[0] != '\0';
}
return True;
know_srcloc = VG_(get_filename_linenum)(
eip,
&buf_srcloc,
- &buf_dirname, &know_dirinfo,
+ &buf_dirname,
&lineno
);
+ know_dirinfo = buf_dirname[0] != '\0';
} else {
const DiInlLoc *cur_inl = iipc && iipc->cur_inltab >= 0
? & iipc->di->inltab[iipc->cur_inltab]
VG_(memset)(buf64, 0, 64);
UInt linenum = 0;
Bool ok = VG_(get_filename_linenum)(
- ip, &buf, NULL, NULL, &linenum
+ ip, &buf, NULL, &linenum
);
if (ok) {
/* For backward compatibility truncate the filename to
/* This one is the most general. It gives filename, line number and
optionally directory name. filename and linenum may not be NULL.
dirname may be NULL, meaning that the caller does not want
- directory name info, in which case dirname_available must also be
- NULL. If dirname is non-null, directory info is written to *dirname, if
+ directory name info.
+ If dirname is non-null, directory info is written to *dirname, if
it is available; if not available, '\0' is written to the first
- byte. In either case *dirname_available is set to indicate whether
- or not directory information was available.
+ byte.
The character strings returned in *filename and *dirname are not
persistent. They will be freed when the DebugInfo they belong to
( Addr a,
/*OUT*/const HChar** filename,
/*OUT*/const HChar** dirname,
- /*OUT*/Bool* dirname_available,
/*OUT*/UInt* linenum );
/* Succeeds only if we find from debug info that 'a' is the address of the