objfile_002dgdbdotext-file.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: objfile-gdbdotext file</title>
  16. <meta name="description" content="Debugging with GDB: objfile-gdbdotext file">
  17. <meta name="keywords" content="Debugging with GDB: objfile-gdbdotext file">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="Auto_002dloading-extensions.html#Auto_002dloading-extensions" rel="up" title="Auto-loading extensions">
  26. <link href="dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section" rel="next" title="dotdebug_gdb_scripts section">
  27. <link href="Auto_002dloading-extensions.html#Auto_002dloading-extensions" rel="previous" title="Auto-loading extensions">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="objfile_002dgdbdotext-file"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section" accesskey="n" rel="next">dotdebug_gdb_scripts section</a>, Up: <a href="Auto_002dloading-extensions.html#Auto_002dloading-extensions" accesskey="u" rel="up">Auto-loading extensions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="The-objfile_002dgdb_002eext-file"></a>
  65. <h4 class="subsection">23.4.1 The <samp><var>objfile</var>-gdb.<var>ext</var></samp> file</h4>
  66. <a name="index-objfile_002dgdb_002egdb"></a>
  67. <a name="index-objfile_002dgdb_002epy"></a>
  68. <a name="index-objfile_002dgdb_002escm"></a>
  69. <p>When a new object file is read, <small>GDB</small> looks for a file named
  70. <samp><var>objfile</var>-gdb.<var>ext</var></samp> (we call it <var>script-name</var> below),
  71. where <var>objfile</var> is the object file&rsquo;s name and
  72. where <var>ext</var> is the file extension for the extension language:
  73. </p>
  74. <dl compact="compact">
  75. <dt><code><samp><var>objfile</var>-gdb.gdb</samp></code></dt>
  76. <dd><p>GDB&rsquo;s own command language
  77. </p></dd>
  78. <dt><code><samp><var>objfile</var>-gdb.py</samp></code></dt>
  79. <dd><p>Python
  80. </p></dd>
  81. <dt><code><samp><var>objfile</var>-gdb.scm</samp></code></dt>
  82. <dd><p>Guile
  83. </p></dd>
  84. </dl>
  85. <p><var>script-name</var> is formed by ensuring that the file name of <var>objfile</var>
  86. is absolute, following all symlinks, and resolving <code>.</code> and <code>..</code>
  87. components, and appending the <samp>-gdb.<var>ext</var></samp> suffix.
  88. If this file exists and is readable, <small>GDB</small> will evaluate it as a
  89. script in the specified extension language.
  90. </p>
  91. <p>If this file does not exist, then <small>GDB</small> will look for
  92. <var>script-name</var> file in all of the directories as specified below.
  93. (On MS-Windows/MS-DOS, the drive letter of the executable&rsquo;s leading
  94. directories is converted to a one-letter subdirectory, i.e.
  95. <samp>d:/usr/bin/</samp> is converted to <samp>/d/usr/bin/</samp>, because Windows
  96. filesystems disallow colons in file names.)
  97. </p>
  98. <p>Note that loading of these files requires an accordingly configured
  99. <code>auto-load safe-path</code> (see <a href="Auto_002dloading-safe-path.html#Auto_002dloading-safe-path">Auto-loading safe path</a>).
  100. </p>
  101. <p>For object files using <samp>.exe</samp> suffix <small>GDB</small> tries to load first the
  102. scripts normally according to its <samp>.exe</samp> filename. But if no scripts are
  103. found <small>GDB</small> also tries script filenames matching the object file without
  104. its <samp>.exe</samp> suffix. This <samp>.exe</samp> stripping is case insensitive and it
  105. is attempted on any platform. This makes the script filenames compatible
  106. between Unix and MS-Windows hosts.
  107. </p>
  108. <dl compact="compact">
  109. <dd><a name="set-auto_002dload-scripts_002ddirectory"></a><a name="index-set-auto_002dload-scripts_002ddirectory"></a>
  110. </dd>
  111. <dt><code>set auto-load scripts-directory <span class="roman">[</span><var>directories</var><span class="roman">]</span></code></dt>
  112. <dd><p>Control <small>GDB</small> auto-loaded scripts location. Multiple directory entries
  113. may be delimited by the host platform path separator in use
  114. (&lsquo;<samp>:</samp>&rsquo; on Unix, &lsquo;<samp>;</samp>&rsquo; on MS-Windows and MS-DOS).
  115. </p>
  116. <p>Each entry here needs to be covered also by the security setting
  117. <code>set auto-load safe-path</code> (see <a href="Auto_002dloading-safe-path.html#set-auto_002dload-safe_002dpath">set auto-load safe-path</a>).
  118. </p>
  119. <a name="with_002dauto_002dload_002ddir"></a><p>This variable defaults to <samp>$debugdir:$datadir/auto-load</samp>. The default
  120. <code>set auto-load safe-path</code> value can be also overriden by <small>GDB</small>
  121. configuration option <samp>--with-auto-load-dir</samp>.
  122. </p>
  123. <p>Any reference to <samp>$debugdir</samp> will get replaced by
  124. <var>debug-file-directory</var> value (see <a href="Separate-Debug-Files.html#Separate-Debug-Files">Separate Debug Files</a>) and any
  125. reference to <samp>$datadir</samp> will get replaced by <var>data-directory</var> which is
  126. determined at <small>GDB</small> startup (see <a href="Data-Files.html#Data-Files">Data Files</a>). <samp>$debugdir</samp> and
  127. <samp>$datadir</samp> must be placed as a directory component &mdash; either alone or
  128. delimited by <samp>/</samp> or <samp>\</samp> directory separators, depending on the host
  129. platform.
  130. </p>
  131. <p>The list of directories uses path separator (&lsquo;<samp>:</samp>&rsquo; on GNU and Unix
  132. systems, &lsquo;<samp>;</samp>&rsquo; on MS-Windows and MS-DOS) to separate directories, similarly
  133. to the <code>PATH</code> environment variable.
  134. </p>
  135. <a name="show-auto_002dload-scripts_002ddirectory"></a><a name="index-show-auto_002dload-scripts_002ddirectory"></a>
  136. </dd>
  137. <dt><code>show auto-load scripts-directory</code></dt>
  138. <dd><p>Show <small>GDB</small> auto-loaded scripts location.
  139. </p>
  140. <a name="add_002dauto_002dload_002dscripts_002ddirectory"></a><a name="index-add_002dauto_002dload_002dscripts_002ddirectory"></a>
  141. </dd>
  142. <dt><code>add-auto-load-scripts-directory <span class="roman">[</span><var>directories</var>&hellip;<span class="roman">]</span></code></dt>
  143. <dd><p>Add an entry (or list of entries) to the list of auto-loaded scripts locations.
  144. Multiple entries may be delimited by the host platform path separator in use.
  145. </p></dd>
  146. </dl>
  147. <p><small>GDB</small> does not track which files it has already auto-loaded this way.
  148. <small>GDB</small> will load the associated script every time the corresponding
  149. <var>objfile</var> is opened.
  150. So your <samp>-gdb.<var>ext</var></samp> file should be careful to avoid errors if it
  151. is evaluated more than once.
  152. </p>
  153. <hr>
  154. <div class="header">
  155. <p>
  156. Next: <a href="dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section" accesskey="n" rel="next">dotdebug_gdb_scripts section</a>, Up: <a href="Auto_002dloading-extensions.html#Auto_002dloading-extensions" accesskey="u" rel="up">Auto-loading extensions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  157. </div>
  158. </body>
  159. </html>