Hi Sanjiv, On Wed, Jul 1, 2009 at 7:02 PM, Sanjiv Gupta<sanjiv.gupta at microchip.com> wrote:> I found out the problem. Looks like I can not rely on argv[0] to contain the > full path of the executable always.Yeah, that's what I was thinking.> Can I rely on: > static Path GetMainExecutable(const char *argv0, void *MainAddr);Clang relies on it. According to http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp MainAddr can be any symbol in the binary. -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Thanks. This framework has made writing a driver a pleasure. It couldn't have been easier to write a driver. - Sanjiv Mikhail Glushenkov wrote:> Hi Sanjiv, > > On Wed, Jul 1, 2009 at 7:02 PM, Sanjiv Gupta<sanjiv.gupta at microchip.com> wrote: > >> I found out the problem. Looks like I can not rely on argv[0] to contain the >> full path of the executable always. >> > > Yeah, that's what I was thinking. > > >> Can I rely on: >> static Path GetMainExecutable(const char *argv0, void *MainAddr); >> > > Clang relies on it. According to > > http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp > > MainAddr can be any symbol in the binary. > >
Hi Sanjiv, On Thu, Jul 2, 2009 at 4:06 AM, Sanjiv Gupta<sanjiv.gupta at microchip.com> wrote:> Thanks. > This framework has made writing a driver a pleasure. It couldn't have been > easier to write a driver.Glad to hear that! -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments