[lldb-dev] Help on the way to retrieve header file list
yin at affinic.com
Tue Nov 5 11:21:47 PST 2013
Thank you for the quick answer. I will go ahead to
implement a pass to remove the redundancy in the list.
From: Greg Clayton [mailto:gclayton at apple.com]
Sent: Tuesday, November 05, 2013 9:52 AM
To: Yin Ma
Subject: Re: [lldb-dev] Help on the way to retrieve header file list
No. But you can take advantage of the fact that the basenames and directories returned from the SBFileSpec are uniqued C strings:
const char *
const char *
So you might be able to use that to your advantage to help you unique these files into a std::set:
typedef std::set<std::pair<const char *, const char *>> PathSet;
Then you can run through all files and do:
for (SBFileSpec cu_file : ...)
for (SBFileSpec support_file : ...)
This should solve your problem for you?
On Nov 5, 2013, at 8:14 AM, Yin Ma <yin at affinic.com> wrote:
> I am using module GetCompileUnitAtIndex to retrieve
> Compilation unit. If I directly print Compile_unit.file
> I can get all .c filenames without any .h filename.
> If I use GetSupportFileAtIndex() to retrieve all supportfiles
> And print out. I can get .h filename however, there
> Are a lot of duplication.
> Is there any better way to print all .c and .h filenames without
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
More information about the lldb-dev