아래 내용을 통해서 gdb에서 tui모드를 사용할 때, c++ code에 대해서 가독성을 높일 수 있는 색상을 입힐 수 있는 내용이 있나요? 설명해주세요.…
- User
아래 내용을 통해서 gdb에서 tui모드를 사용할 때, c++ code에 대해서 가독성을 높일 수 있는 색상을 입힐 수 있는 내용이 있나요? 설명해주세요.
2071 *** Changes in GDB 8.3 2072 2073 * GDB and GDBserver now support access to additional registers on 2074 PowerPC GNU/Linux targets: PPR, DSCR, TAR, EBB/PMU registers, and 2075 HTM registers. 2076 2077 * GDB now has experimental support for the compilation and injection of 2078 C++ source code into the inferior. This beta release does not include 2079 support for several language features, such as templates, constructors, 2080 and operators. 2081 2082 This feature requires GCC 7.1 or higher built with libcp1.so 2083 (the C++ plug-in). 2084 2085 * GDB and GDBserver now support IPv6 connections. IPv6 addresses 2086 can be passed using the '[ADDRESS]:PORT' notation, or the regular 2087 'ADDRESS:PORT' method. 2088 2089 * DWARF index cache: GDB can now automatically save indices of DWARF 2090 symbols on disk to speed up further loading of the same binaries. 2091 2092 * Ada task switching is now supported on aarch64-elf targets when 2093 debugging a program using the Ravenscar Profile. For more information, 2094 see the "Tasking Support when using the Ravenscar Profile" section 2095 in the GDB user manual. 2096 2097 * GDB in batch mode now exits with status 1 if the last command to be 2098 executed failed. 2099 2100 * The RISC-V target now supports target descriptions. 2101 2102 * System call catchpoints now support system call aliases on FreeBSD. 2103 When the ABI of a system call changes in FreeBSD, this is 2104 implemented by leaving a compatibility system call using the old ABI 2105 at the existing number and allocating a new system call number for 2106 the new ABI. For example, FreeBSD 12 altered the layout of 'struct 2107 kevent' used by the 'kevent' system call. As a result, FreeBSD 12 2108 kernels ship with both 'kevent' and 'freebsd11_kevent' system calls. 2109 The 'freebsd11_kevent' system call is assigned an alias of 'kevent' 2110 so that a system call catchpoint for the 'kevent' system call will 2111 catch invocations of both the 'kevent' and 'freebsd11_kevent' 2112 binaries. This ensures that 'kevent' system calls are caught for 2113 binaries using either the old or new ABIs. 2114 2115 * Terminal styling is now available for the CLI and the TUI. GNU 2116 Source Highlight can additionally be used to provide styling of 2117 source code snippets. See the "set style" commands, below, for more 2118 information. 2119 2120 * Removed support for old demangling styles arm, edg, gnu, hp and 2121 lucid. 2122 2123 * New commands 2124 2125 set debug compile-cplus-types 2126 show debug compile-cplus-types 2127 Control the display of debug output about type conversion in the 2128 C++ compile feature. Commands have no effect while compiling 2129 for other languages. 2130 2131 set debug skip 2132 show debug skip 2133 Control whether debug output about files/functions skipping is 2134 displayed. 2135 2136 frame apply [all | COUNT | -COUNT | level LEVEL...] [FLAG]... COMMAND 2137 Apply a command to some frames. 2138 FLAG arguments allow to control what output to produce and how to handle 2139 errors raised when applying COMMAND to a frame. 2140 2141 taas COMMAND 2142 Apply a command to all threads (ignoring errors and empty output). 2143 Shortcut for 'thread apply all -s COMMAND'. 2144 2145 faas COMMAND 2146 Apply a command to all frames (ignoring errors and empty output). 2147 Shortcut for 'frame apply all -s COMMAND'. 2148 2149 tfaas COMMAND 2150 Apply a command to all frames of all threads (ignoring errors and empty 2151 output). 2152 Shortcut for 'thread apply all -s frame apply all -s COMMAND'. 2153 2154 maint set dwarf unwinders (on|off) 2155 maint show dwarf unwinders 2156 Control whether DWARF unwinders can be used. 2157 2158 info proc files 2159 Display a list of open files for a process. 2160 2161 * Changed commands 2162 2163 Changes to the "frame", "select-frame", and "info frame" CLI commands. 2164 These commands all now take a frame specification which 2165 is either a frame level, or one of the keywords 'level', 'address', 2166 'function', or 'view' followed by a parameter. Selecting a frame by 2167 address, or viewing a frame outside the current backtrace now 2168 requires the use of a keyword. Selecting a frame by level is 2169 unchanged. The MI comment "-stack-select-frame" is unchanged. 2170 2171 target remote FILENAME 2172 target extended-remote FILENAME 2173 If FILENAME is a Unix domain socket, GDB will attempt to connect 2174 to this socket instead of opening FILENAME as a character device. 2175 2176 info args [-q] [-t TYPEREGEXP] [NAMEREGEXP] 2177 info functions [-q] [-t TYPEREGEXP] [NAMEREGEXP] 2178 info locals [-q] [-t TYPEREGEXP] [NAMEREGEXP] 2179 info variables [-q] [-t TYPEREGEXP] [NAMEREGEXP] 2180 These commands can now print only the searched entities 2181 matching the provided regexp(s), giving a condition 2182 on the entity names or entity types. The flag -q disables 2183 printing headers or informations messages. 2184 2185 info functions 2186 info types 2187 info variables 2188 rbreak 2189 These commands now determine the syntax for the shown entities 2190 according to the language chosen by set language auto' means to automatically choose the language of 2192 the shown entities. 2193 2194 thread apply [all | COUNT | -COUNT] [FLAG]... COMMAND 2195 The 'thread apply' command accepts new FLAG arguments. 2196 FLAG arguments allow to control what output to produce and how to handle 2197 errors raised when applying COMMAND to a thread. 2198 2199 set tui tab-width NCHARS 2200 show tui tab-width NCHARS 2201 "set tui tab-width" replaces the "tabset" command, which has been deprecated. 2202 2203 set style enabled [on|off] 2204 show style enabled 2205 Enable or disable terminal styling. Styling is enabled by default 2206 on most hosts, but disabled by default when in batch mode. 2207 2208 set style sources [on|off] 2209 show style sources 2210 Enable or disable source code styling. Source code styling is 2211 enabled by default, but only takes effect if styling in general is 2212 enabled, and if GDB was linked with GNU Source Highlight. 2213 2214 set style filename foreground COLOR 2215 set style filename background COLOR 2216 set style filename intensity VALUE 2217 Control the styling of file names. 2218 2219 set style function foreground COLOR 2220 set style function background COLOR 2221 set style function intensity VALUE 2222 Control the styling of function names. 2223 2224 set style variable foreground COLOR 2225 set style variable background COLOR 2226 set style variable intensity VALUE 2227 Control the styling of variable names. 2228 2229 set style address foreground COLOR 2230 set style address background COLOR 2231 set style address intensity VALUE 2232 Control the styling of addresses. 2233 2234 * MI changes 2235 2236 ** The '-data-disassemble' MI command now accepts an '-a' option to 2237 disassemble the whole function surrounding the given program 2238 counter value or function name. Support for this feature can be 2239 verified by using the "-list-features" command, which should 2240 contain "data-disassemble-a-option". 2241 2242 ** Command responses and notifications that include a frame now include 2243 the frame's architecture in a new "arch" attribute. 2244 2245 * New native configurations 2246 2247 GNU/Linux/RISC-V riscv*- 2248 FreeBSD/riscv riscv*- 2249 2250 * New targets 2251 2252 GNU/Linux/RISC-V riscv*- 2253 CSKY ELF csky*--- 2256 NXP S12Z s12z-- 2258 2259 * Removed targets 2260 2261 GDB no longer supports native debugging on versions of MS-Windows 2262 before Windows XP. 2263 2264 * Python API 2265 2266 ** GDB no longer supports Python versions less than 2.6. 2267 2268 ** The gdb.Inferior type has a new 'progspace' property, which is the program 2269 space associated to that inferior. 2270 2271 ** The gdb.Progspace type has a new 'objfiles' method, which returns the list 2272 of objfiles associated to that program space. 2273 2274 ** gdb.SYMBOL_LOC_COMMON_BLOCK, gdb.SYMBOL_MODULE_DOMAIN, and 2275 gdb.SYMBOL_COMMON_BLOCK_DOMAIN were added to reflect changes to 2276 the gdb core. 2277 2278 ** gdb.SYMBOL_VARIABLES_DOMAIN, gdb.SYMBOL_FUNCTIONS_DOMAIN, and 2279 gdb.SYMBOL_TYPES_DOMAIN are now deprecated. These were never 2280 correct and did not work properly. 2281 2282 ** The gdb.Value type has a new constructor, which is used to construct a 2283 gdb.Value from a Python buffer object and a gdb.Type. 2284 2285 * Configure changes 2286 2287 --enable-ubsan 2288 2289 Enable or disable the undefined behavior sanitizer. This is 2290 disabled by default, but passing --enable-ubsan=yes or 2291 --enable-ubsan=auto to configure will enable it. Enabling this can 2292 cause a performance penalty. The undefined behavior sanitizer was 2293 first introduced in GCC 4.9. 2294 2295 *** Changes in GDB 8.2 2296 2297 * The 'set disassembler-options' command now supports specifying options 2298 for the MIPS target. 2299 2300 * The 'symbol-file' command now accepts an '-o' option to add a relative 2301 offset to all sections. 2302 2303 * Similarly, the 'add-symbol-file' command also accepts an '-o' option to add 2304 a relative offset to all sections, but it allows to override the load 2305 address of individual sections using '-s'. 2306 2307 * The 'add-symbol-file' command no longer requires the second argument 2308 (address of the text section). 2309 2310 * The endianness used with the 'set endian auto' mode in the absence of 2311 an executable selected for debugging is now the last endianness chosen 2312 either by one of the 'set endian big' and 'set endian little' commands 2313 or by inferring from the last executable used, rather than the startup 2314 default. 2315 2316 * The pager now allows a "c" response, meaning to disable the pager 2317 for the rest of the current command. 2318 2319 * The commands 'info variables/functions/types' now show the source line 2320 numbers of symbol definitions when available. 2321 2322 * 'info proc' now works on running processes on FreeBSD systems and core 2323 files created on FreeBSD systems. 2324 2325 * C expressions can now use _Alignof, and C++ expressions can now use 2326 alignof. 2327 2328 * Support for SVE on AArch64 Linux. Note that GDB does not detect changes to 2329 the vector length while the process is running. 2330 2331 * New commands 2332 2333 set debug fbsd-nat 2334 show debug fbsd-nat 2335 Control display of debugging info regarding the FreeBSD native target. 2336 2337 set|show varsize-limit 2338 This new setting allows the user to control the maximum size of Ada 2339 objects being printed when those objects have a variable type, 2340 instead of that maximum size being hardcoded to 65536 bytes. 2341 2342 set|show record btrace cpu 2343 Controls the processor to be used for enabling errata workarounds for 2344 branch trace decode. 2345 2346 maint check libthread-db 2347 Run integrity checks on the current inferior's thread debugging 2348 library 2349 2350 maint set check-libthread-db (on|off) 2351 maint show check-libthread-db 2352 Control whether to run integrity checks on inferior specific thread 2353 debugging libraries as they are loaded. The default is not to 2354 perform such checks. 2355 2356 * Python API 2357 2358 ** Type alignment is now exposed via the "align" attribute of a gdb.Type. 2359 2360 ** The commands attached to a breakpoint can be set by assigning to 2361 the breakpoint's "commands" field. 2362 2363 ** gdb.execute can now execute multi-line gdb commands. 2364 2365 ** The new functions gdb.convenience_variable and 2366 gdb.set_convenience_variable can be used to get and set the value 2367 of convenience variables. 2368 2369 ** A gdb.Parameter will no longer print the "set" help text on an 2370 ordinary "set"; instead by default a "set" will be silent unless 2371 the get_set_string method returns a non-empty string. 2372 2373 * New targets 2374 2375 RiscV ELF riscv*-- 2380 SH-5/SH64 ELF sh64-, SH-5/SH64 support in sh* 2381 SH-5/SH64 running GNU/Linux SH-5/SH64 support in sh*- 2382 SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*- 2383 2384 * Aarch64/Linux hardware watchpoints improvements 2385 2386 Hardware watchpoints on unaligned addresses are now properly 2387 supported when running Linux kernel 4.10 or higher: read and access 2388 watchpoints are no longer spuriously missed, and all watchpoints 2389 lengths between 1 and 8 bytes are supported. On older kernels, 2390 watchpoints set on unaligned addresses are no longer missed, with 2391 the tradeoff that there is a possibility of false hits being 2392 reported. 2393 2394 * Configure changes 2395 2396 --enable-codesign=CERT 2397 This can be used to invoke "codesign -s CERT" after building gdb. 2398 This option is useful on macOS, where code signing is required for 2399 gdb to work properly. 2400 2401 --disable-gdbcli has been removed 2402 This is now silently accepted, but does nothing.
- Assistant
Yes, in the provided changelog (specifically around lines 2115-2118), it is mentioned that GDB version 8.3 includes the ability to use terminal styling for the CLI and the TUI. GNU Source Highlight can be used to provide styling for source code snippets. This means you can enhance readability with syntax coloring, which is especially helpful when analyzing C++ source code within GDB's TUI mode.
- User
한글로 출력해주세요.
- Assistant
네, 제공된 변경 로그(특히 2115-2118 라인 주변)에 따르면 GDB 버전 8.3에는 CLI와 TUI에 대한 터미널 스타일링 기능이 포함되어 있습니다. GNU Source Highlight를 사용하여 소스 코드 스니펫에 스타일을 적용할 수 있습니다. 이는 GDB의 TUI 모드 내에서 C++ 소스 코드를 분석할 때 가독성을 높이는 데 특히 도움이 되는 구문 색상을 사용할 수 있음을 의미합니다.
GDB가 GNU Source Highlight와 연결되어 있어야 소스 코드 스타일링이 적용됩니다. 그런 다음
set style sources명령을 사용하여 소스 코드 스타일링을 활성화할 수 있습니다.GDB TUI 모드 내에서 소스 코드에 색상과 스타일을 적용하는 간단한 가이드는 다음과 같습니다:
-
help set style을 입력하여 GDB에서set style명령 그룹을 사용할 수 있는지 확인합니다. 이 명령은 터미널 스타일링이 지원되는 경우 사용 가능한 명령을 보여줄 것입니다. -
set style enabled on을 사용하여 일반 스타일링을 활성화합니다. -
set style sources on을 사용하여 소스 코드 스타일링을 특별히 활성화합니다. -
set style명령과 특정 요소를 따라 파일 이름, 함수 이름, 변수 이름 및 주소와 같은 다양한 요소의 스타일을 사용자 정의합니다. 예를 들어:set style function foreground blue set style function background black set style function intensity bold위 명령은 함수 이름의 색상을 검은 배경에 파란색으로 굵게 설정합니다.
-
- User
아래 내용을 영어에서 한글로 번역해주세요.
Previous: TUI Commands, Up: TUI [Contents][Index]
25.6 TUI Configuration Variables
Several configuration variables control the appearance of TUI windows.
set tui border-kind kind Select the border appearance for the source, assembly and register windows. The possible values are the following:
space Use a space character to draw the border.
ascii Use ASCII characters ‘+’, ‘-’ and ‘|’ to draw the border.
acs Use the Alternate Character Set to draw the border. The border is drawn using character line graphics if the terminal supports them.
set tui border-mode mode set tui active-border-mode mode Select the display attributes for the borders of the inactive windows or the active window. The mode can be one of the following:
- Assistant
이전: TUI 명령어, 상위: TUI [목차][색인]
25.6 TUI 설정 변수
여러 설정 변수들이 TUI 창의 모양을 제어합니다.
set tui border-kind 종류 소스, 어셈블리 및 레지스터 창의 테두리 모양을 선택합니다. 가능한 값은 다음과 같습니다:
space 테두리를 그리기 위해 공백 문자를 사용합니다.
ascii 테두리를 그리기 위해 ASCII 문자 ‘+’, ‘-’ 및 ‘|’를 사용합니다.
acs 테두리를 그리기 위해 대체 문자 세트(Alternate Character Set)를 사용합니다. 터미널이 지원하는 경우 문자 라인 그래픽을 사용하여 테두리를 그립니다.
set tui border-mode 모드 set tui active-border-mode 모드 비활성 창 또는 활성 창의 테두리에 대한 디스플레이 속성을 선택합니다. 모드는 다음 중 하나일 수 있습니다:
normal 테두리를 표시하기 위해 일반 속성을 사용합니다.
standout 돋보이는 모드를 사용합니다.
reverse 반전 비디오 모드를 사용합니다.
half 반 밝기 모드를 사용합니다.
half-standout 반 밝기와 돋보이는 모드를 사용합니다.
bold 추가 밝기 또는 굵은 모드를 사용합니다.
bold-standout 추가 밝기 또는 굵고 돋보이는 모드를 사용합니다.
set tui tab-width 문자수 탭 정지 위치의 너비를 문자수 문자로 설정합니다. 이 설정은 소스 및 어셈블리 창에서 TAB 문자의 표시에 영향을 미칩니다.
set tui compact-source [on|off] TUI 소스 창이 "간략한" 형태로 표시되는지 설정합니다. 기본 디스플레이는 라인 번호에 더 많은 공간을 사용하는 반면, 간략한 디스플레이는 현재 파일의 라인 번호에 필요한 만큼의 공간만을 사용합니다.
set tui mouse-events [on|off] 켜져 있을 때(기본값), 마우스 클릭은 TUI를 제어합니다(참조: TUI 마우스 지원). 꺼져 있을 때, 마우스 클릭은 터미널에 의해 처리되어 터미널 기본 텍스트 선택이 가능합니다.