You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
9.0KB

  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 6.5, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>objfile-gdbdotext file (Debugging with GDB)</title>
  17. <meta name="description" content="objfile-gdbdotext file (Debugging with GDB)">
  18. <meta name="keywords" content="objfile-gdbdotext file (Debugging with GDB)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  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="prev" title="Auto-loading extensions">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.indentedblock {margin-right: 0em}
  32. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  33. blockquote.smallquotation {font-size: smaller}
  34. div.display {margin-left: 3.2em}
  35. div.example {margin-left: 3.2em}
  36. div.lisp {margin-left: 3.2em}
  37. div.smalldisplay {margin-left: 3.2em}
  38. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  50. span.roman {font-family: initial; font-weight: normal}
  51. span.sansserif {font-family: sans-serif; font-weight: normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en">
  57. <a name="objfile_002dgdbdotext-file"></a>
  58. <div class="header">
  59. <p>
  60. 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>
  61. </div>
  62. <hr>
  63. <a name="The-objfile_002dgdb_002eext-file"></a>
  64. <h4 class="subsection">23.4.1 The <samp><var>objfile</var>-gdb.<var>ext</var></samp> file</h4>
  65. <a name="index-objfile_002dgdb_002egdb"></a>
  66. <a name="index-objfile_002dgdb_002epy"></a>
  67. <a name="index-objfile_002dgdb_002escm"></a>
  68. <p>When a new object file is read, <small>GDB</small> looks for a file named
  69. <samp><var>objfile</var>-gdb.<var>ext</var></samp> (we call it <var>script-name</var> below),
  70. where <var>objfile</var> is the object file&rsquo;s name and
  71. where <var>ext</var> is the file extension for the extension language:
  72. </p>
  73. <dl compact="compact">
  74. <dt><code><samp><var>objfile</var>-gdb.gdb</samp></code></dt>
  75. <dd><p>GDB&rsquo;s own command language
  76. </p></dd>
  77. <dt><code><samp><var>objfile</var>-gdb.py</samp></code></dt>
  78. <dd><p>Python
  79. </p></dd>
  80. <dt><code><samp><var>objfile</var>-gdb.scm</samp></code></dt>
  81. <dd><p>Guile
  82. </p></dd>
  83. </dl>
  84. <p><var>script-name</var> is formed by ensuring that the file name of <var>objfile</var>
  85. is absolute, following all symlinks, and resolving <code>.</code> and <code>..</code>
  86. components, and appending the <samp>-gdb.<var>ext</var></samp> suffix.
  87. If this file exists and is readable, <small>GDB</small> will evaluate it as a
  88. script in the specified extension language.
  89. </p>
  90. <p>If this file does not exist, then <small>GDB</small> will look for
  91. <var>script-name</var> file in all of the directories as specified below.
  92. (On MS-Windows/MS-DOS, the drive letter of the executable&rsquo;s leading
  93. directories is converted to a one-letter subdirectory, i.e.
  94. <samp>d:/usr/bin/</samp> is converted to <samp>/d/usr/bin/</samp>, because Windows
  95. filesystems disallow colons in file names.)
  96. </p>
  97. <p>Note that loading of these files requires an accordingly configured
  98. <code>auto-load safe-path</code> (see <a href="Auto_002dloading-safe-path.html#Auto_002dloading-safe-path">Auto-loading safe path</a>).
  99. </p>
  100. <p>For object files using <samp>.exe</samp> suffix <small>GDB</small> tries to load first the
  101. scripts normally according to its <samp>.exe</samp> filename. But if no scripts are
  102. found <small>GDB</small> also tries script filenames matching the object file without
  103. its <samp>.exe</samp> suffix. This <samp>.exe</samp> stripping is case insensitive and it
  104. is attempted on any platform. This makes the script filenames compatible
  105. between Unix and MS-Windows hosts.
  106. </p>
  107. <dl compact="compact">
  108. <dd><a name="set-auto_002dload-scripts_002ddirectory"></a><a name="index-set-auto_002dload-scripts_002ddirectory"></a>
  109. </dd>
  110. <dt><code>set auto-load scripts-directory <span class="roman">[</span><var>directories</var><span class="roman">]</span></code></dt>
  111. <dd><p>Control <small>GDB</small> auto-loaded scripts location. Multiple directory entries
  112. may be delimited by the host platform path separator in use
  113. (&lsquo;<samp>:</samp>&rsquo; on Unix, &lsquo;<samp>;</samp>&rsquo; on MS-Windows and MS-DOS).
  114. </p>
  115. <p>Each entry here needs to be covered also by the security setting
  116. <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>).
  117. </p>
  118. <a name="with_002dauto_002dload_002ddir"></a><p>This variable defaults to <samp>$debugdir:$datadir/auto-load</samp>. The default
  119. <code>set auto-load safe-path</code> value can be also overriden by <small>GDB</small>
  120. configuration option <samp>--with-auto-load-dir</samp>.
  121. </p>
  122. <p>Any reference to <samp>$debugdir</samp> will get replaced by
  123. <var>debug-file-directory</var> value (see <a href="Separate-Debug-Files.html#Separate-Debug-Files">Separate Debug Files</a>) and any
  124. reference to <samp>$datadir</samp> will get replaced by <var>data-directory</var> which is
  125. determined at <small>GDB</small> startup (see <a href="Data-Files.html#Data-Files">Data Files</a>). <samp>$debugdir</samp> and
  126. <samp>$datadir</samp> must be placed as a directory component &mdash; either alone or
  127. delimited by <samp>/</samp> or <samp>\</samp> directory separators, depending on the host
  128. platform.
  129. </p>
  130. <p>The list of directories uses path separator (&lsquo;<samp>:</samp>&rsquo; on GNU and Unix
  131. systems, &lsquo;<samp>;</samp>&rsquo; on MS-Windows and MS-DOS) to separate directories, similarly
  132. to the <code>PATH</code> environment variable.
  133. </p>
  134. <a name="show-auto_002dload-scripts_002ddirectory"></a><a name="index-show-auto_002dload-scripts_002ddirectory"></a>
  135. </dd>
  136. <dt><code>show auto-load scripts-directory</code></dt>
  137. <dd><p>Show <small>GDB</small> auto-loaded scripts location.
  138. </p>
  139. <a name="add_002dauto_002dload_002dscripts_002ddirectory"></a><a name="index-add_002dauto_002dload_002dscripts_002ddirectory"></a>
  140. </dd>
  141. <dt><code>add-auto-load-scripts-directory <span class="roman">[</span><var>directories</var>&hellip;<span class="roman">]</span></code></dt>
  142. <dd><p>Add an entry (or list of entries) to the list of auto-loaded scripts locations.
  143. Multiple entries may be delimited by the host platform path separator in use.
  144. </p></dd>
  145. </dl>
  146. <p><small>GDB</small> does not track which files it has already auto-loaded this way.
  147. <small>GDB</small> will load the associated script every time the corresponding
  148. <var>objfile</var> is opened.
  149. So your <samp>-gdb.<var>ext</var></samp> file should be careful to avoid errors if it
  150. is evaluated more than once.
  151. </p>
  152. <hr>
  153. <div class="header">
  154. <p>
  155. 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>
  156. </div>
  157. </body>
  158. </html>