1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
| GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>.
For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from demo... (gdb) l 1 1 #include <iostream> 2 #include <stdio.h> 3 4 using namespace std; 5 6 struct String { 7 int len; 8 char s[10]; 9 char *p; 10 int length; (gdb) 11 }; 12 13 int main() { 14 String st; 15 printf("s: %s\n", st.s); 16 printf("s ptr: %p\n", st.s); 17 printf("(&s) ptr: %p\n", &(st.s)); 18 printf("p: %s\n", st.p); 19 st.p = st.s; 20 printf("p: %s\n", st.p); (gdb) 21 return 0; 22 } 23 (gdb) r Starting program: /home/qeuroal/tmp/demo [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, main () at test_v2.cpp:13 13 int main() { (gdb) disassemble Dump of assembler code for function main(): 0x00005555555551a9 <+0>: endbr64 0x00005555555551ad <+4>: push %rbp 0x00005555555551ae <+5>: mov %rsp,%rbp 0x00005555555551b1 <+8>: sub $0x30,%rsp => 0x00005555555551b5 <+12>: mov %fs:0x28,%rax 0x00005555555551be <+21>: mov %rax,-0x8(%rbp) 0x00005555555551c2 <+25>: xor %eax,%eax 0x00005555555551c4 <+27>: lea -0x30(%rbp),%rax 0x00005555555551c8 <+31>: add $0x4,%rax 0x00005555555551cc <+35>: mov %rax,%rsi 0x00005555555551cf <+38>: lea 0xe2e(%rip),%rax # 0x555555556004 0x00005555555551d6 <+45>: mov %rax,%rdi 0x00005555555551d9 <+48>: mov $0x0,%eax 0x00005555555551de <+53>: call 0x555555555080 <printf@plt> 0x00005555555551e3 <+58>: lea -0x30(%rbp),%rax 0x00005555555551e7 <+62>: add $0x4,%rax 0x00005555555551eb <+66>: mov %rax,%rsi 0x00005555555551ee <+69>: lea 0xe16(%rip),%rax # 0x55555555600b 0x00005555555551f5 <+76>: mov %rax,%rdi 0x00005555555551f8 <+79>: mov $0x0,%eax 0x00005555555551fd <+84>: call 0x555555555080 <printf@plt> 0x0000555555555202 <+89>: lea -0x30(%rbp),%rax 0x0000555555555206 <+93>: add $0x4,%rax 0x000055555555520a <+97>: mov %rax,%rsi 0x000055555555520d <+100>: lea 0xe02(%rip),%rax # 0x555555556016 0x0000555555555214 <+107>: mov %rax,%rdi 0x0000555555555217 <+110>: mov $0x0,%eax 0x000055555555521c <+115>: call 0x555555555080 <printf@plt> 0x0000555555555221 <+120>: mov -0x20(%rbp),%rax 0x0000555555555225 <+124>: mov %rax,%rsi 0x0000555555555228 <+127>: lea 0xdf5(%rip),%rax # 0x555555556024 0x000055555555522f <+134>: mov %rax,%rdi 0x0000555555555232 <+137>: mov $0x0,%eax 0x0000555555555237 <+142>: call 0x555555555080 <printf@plt> 0x000055555555523c <+147>: lea -0x30(%rbp),%rax 0x0000555555555240 <+151>: add $0x4,%rax 0x0000555555555244 <+155>: mov %rax,-0x20(%rbp) 0x0000555555555248 <+159>: mov -0x20(%rbp),%rax 0x000055555555524c <+163>: mov %rax,%rsi 0x000055555555524f <+166>: lea 0xdce(%rip),%rax # 0x555555556024 0x0000555555555256 <+173>: mov %rax,%rdi 0x0000555555555259 <+176>: mov $0x0,%eax 0x000055555555525e <+181>: call 0x555555555080 <printf@plt> 0x0000555555555263 <+186>: mov $0x0,%eax 0x0000555555555268 <+191>: mov -0x8(%rbp),%rdx 0x000055555555526c <+195>: sub %fs:0x28,%rdx 0x0000555555555275 <+204>: je 0x55555555527c <main()+211> 0x0000555555555277 <+206>: call 0x5555555550a0 <__stack_chk_fail@plt> 0x000055555555527c <+211>: leave 0x000055555555527d <+212>: ret End of assembler dump. (gdb) l 1 1 #include <iostream> 2 #include <stdio.h> 3 4 using namespace std; 5 6 struct String { 7 int len; 8 char s[10]; 9 char *p; 10 int length; (gdb) 11 }; 12 13 int main() { 14 String st; 15 printf("s: %s\n", st.s); 16 printf("s ptr: %p\n", st.s); 17 printf("(&s) ptr: %p\n", &(st.s)); 18 printf("p: %s\n", st.p); 19 st.p = st.s; 20 printf("p: %s\n", st.p); (gdb) 21 return 0; 22 } 23 (gdb) diass Undefined command: "diass". Try "help". (gdb) disassemble Dump of assembler code for function main(): 0x00005555555551a9 <+0>: endbr64 0x00005555555551ad <+4>: push %rbp 0x00005555555551ae <+5>: mov %rsp,%rbp 0x00005555555551b1 <+8>: sub $0x30,%rsp => 0x00005555555551b5 <+12>: mov %fs:0x28,%rax 0x00005555555551be <+21>: mov %rax,-0x8(%rbp) 0x00005555555551c2 <+25>: xor %eax,%eax 0x00005555555551c4 <+27>: lea -0x30(%rbp),%rax 0x00005555555551c8 <+31>: add $0x4,%rax 0x00005555555551cc <+35>: mov %rax,%rsi 0x00005555555551cf <+38>: lea 0xe2e(%rip),%rax # 0x555555556004 0x00005555555551d6 <+45>: mov %rax,%rdi 0x00005555555551d9 <+48>: mov $0x0,%eax 0x00005555555551de <+53>: call 0x555555555080 <printf@plt> 0x00005555555551e3 <+58>: lea -0x30(%rbp),%rax 0x00005555555551e7 <+62>: add $0x4,%rax 0x00005555555551eb <+66>: mov %rax,%rsi 0x00005555555551ee <+69>: lea 0xe16(%rip),%rax # 0x55555555600b 0x00005555555551f5 <+76>: mov %rax,%rdi 0x00005555555551f8 <+79>: mov $0x0,%eax 0x00005555555551fd <+84>: call 0x555555555080 <printf@plt> 0x0000555555555202 <+89>: lea -0x30(%rbp),%rax 0x0000555555555206 <+93>: add $0x4,%rax 0x000055555555520a <+97>: mov %rax,%rsi 0x000055555555520d <+100>: lea 0xe02(%rip),%rax # 0x555555556016 0x0000555555555214 <+107>: mov %rax,%rdi 0x0000555555555217 <+110>: mov $0x0,%eax 0x000055555555521c <+115>: call 0x555555555080 <printf@plt> 0x0000555555555221 <+120>: mov -0x20(%rbp),%rax 0x0000555555555225 <+124>: mov %rax,%rsi 0x0000555555555228 <+127>: lea 0xdf5(%rip),%rax # 0x555555556024 0x000055555555522f <+134>: mov %rax,%rdi 0x0000555555555232 <+137>: mov $0x0,%eax 0x0000555555555237 <+142>: call 0x555555555080 <printf@plt> 0x000055555555523c <+147>: lea -0x30(%rbp),%rax 0x0000555555555240 <+151>: add $0x4,%rax 0x0000555555555244 <+155>: mov %rax,-0x20(%rbp) 0x0000555555555248 <+159>: mov -0x20(%rbp),%rax 0x000055555555524c <+163>: mov %rax,%rsi 0x000055555555524f <+166>: lea 0xdce(%rip),%rax # 0x555555556024 0x0000555555555256 <+173>: mov %rax,%rdi 0x0000555555555259 <+176>: mov $0x0,%eax 0x000055555555525e <+181>: call 0x555555555080 <printf@plt> 0x0000555555555263 <+186>: mov $0x0,%eax 0x0000555555555268 <+191>: mov -0x8(%rbp),%rdx 0x000055555555526c <+195>: sub %fs:0x28,%rdx 0x0000555555555275 <+204>: je 0x55555555527c <main()+211> 0x0000555555555277 <+206>: call 0x5555555550a0 <__stack_chk_fail@plt> 0x000055555555527c <+211>: leave 0x000055555555527d <+212>: ret End of assembler dump. (gdb) info line 15 Line 15 of "test_v2.cpp" starts at address 0x5555555551c4 <main()+27> and ends at 0x5555555551e3 <main()+58>. (gdb) ni 0x00005555555551be 13 int main() { (gdb) 0x00005555555551c2 13 int main() { (gdb) 15 printf("s: %s\n", st.s); (gdb) disassemble Dump of assembler code for function main(): 0x00005555555551a9 <+0>: endbr64 0x00005555555551ad <+4>: push %rbp 0x00005555555551ae <+5>: mov %rsp,%rbp 0x00005555555551b1 <+8>: sub $0x30,%rsp 0x00005555555551b5 <+12>: mov %fs:0x28,%rax 0x00005555555551be <+21>: mov %rax,-0x8(%rbp) 0x00005555555551c2 <+25>: xor %eax,%eax => 0x00005555555551c4 <+27>: lea -0x30(%rbp),%rax 0x00005555555551c8 <+31>: add $0x4,%rax 0x00005555555551cc <+35>: mov %rax,%rsi 0x00005555555551cf <+38>: lea 0xe2e(%rip),%rax # 0x555555556004 0x00005555555551d6 <+45>: mov %rax,%rdi 0x00005555555551d9 <+48>: mov $0x0,%eax 0x00005555555551de <+53>: call 0x555555555080 <printf@plt> 0x00005555555551e3 <+58>: lea -0x30(%rbp),%rax 0x00005555555551e7 <+62>: add $0x4,%rax 0x00005555555551eb <+66>: mov %rax,%rsi 0x00005555555551ee <+69>: lea 0xe16(%rip),%rax # 0x55555555600b 0x00005555555551f5 <+76>: mov %rax,%rdi 0x00005555555551f8 <+79>: mov $0x0,%eax 0x00005555555551fd <+84>: call 0x555555555080 <printf@plt> 0x0000555555555202 <+89>: lea -0x30(%rbp),%rax 0x0000555555555206 <+93>: add $0x4,%rax 0x000055555555520a <+97>: mov %rax,%rsi 0x000055555555520d <+100>: lea 0xe02(%rip),%rax # 0x555555556016 0x0000555555555214 <+107>: mov %rax,%rdi 0x0000555555555217 <+110>: mov $0x0,%eax 0x000055555555521c <+115>: call 0x555555555080 <printf@plt> 0x0000555555555221 <+120>: mov -0x20(%rbp),%rax 0x0000555555555225 <+124>: mov %rax,%rsi 0x0000555555555228 <+127>: lea 0xdf5(%rip),%rax # 0x555555556024 0x000055555555522f <+134>: mov %rax,%rdi 0x0000555555555232 <+137>: mov $0x0,%eax 0x0000555555555237 <+142>: call 0x555555555080 <printf@plt> 0x000055555555523c <+147>: lea -0x30(%rbp),%rax 0x0000555555555240 <+151>: add $0x4,%rax 0x0000555555555244 <+155>: mov %rax,-0x20(%rbp) 0x0000555555555248 <+159>: mov -0x20(%rbp),%rax 0x000055555555524c <+163>: mov %rax,%rsi 0x000055555555524f <+166>: lea 0xdce(%rip),%rax # 0x555555556024 0x0000555555555256 <+173>: mov %rax,%rdi 0x0000555555555259 <+176>: mov $0x0,%eax 0x000055555555525e <+181>: call 0x555555555080 <printf@plt> 0x0000555555555263 <+186>: mov $0x0,%eax 0x0000555555555268 <+191>: mov -0x8(%rbp),%rdx 0x000055555555526c <+195>: sub %fs:0x28,%rdx 0x0000555555555275 <+204>: je 0x55555555527c <main()+211> 0x0000555555555277 <+206>: call 0x5555555550a0 <__stack_chk_fail@plt> 0x000055555555527c <+211>: leave 0x000055555555527d <+212>: ret End of assembler dump. (gdb) info line 15 Line 15 of "test_v2.cpp" starts at address 0x5555555551c4 <main()+27> and ends at 0x5555555551e3 <main()+58>. (gdb) info line 16 Line 16 of "test_v2.cpp" starts at address 0x5555555551e3 <main()+58> and ends at 0x555555555202 <main()+89>. (gdb) info line 18 Line 18 of "test_v2.cpp" starts at address 0x555555555221 <main()+120> and ends at 0x55555555523c <main()+147>. (gdb) disassemble Dump of assembler code for function main(): 0x00005555555551a9 <+0>: endbr64 0x00005555555551ad <+4>: push %rbp 0x00005555555551ae <+5>: mov %rsp,%rbp 0x00005555555551b1 <+8>: sub $0x30,%rsp 0x00005555555551b5 <+12>: mov %fs:0x28,%rax 0x00005555555551be <+21>: mov %rax,-0x8(%rbp) 0x00005555555551c2 <+25>: xor %eax,%eax => 0x00005555555551c4 <+27>: lea -0x30(%rbp),%rax 0x00005555555551c8 <+31>: add $0x4,%rax 0x00005555555551cc <+35>: mov %rax,%rsi 0x00005555555551cf <+38>: lea 0xe2e(%rip),%rax # 0x555555556004 0x00005555555551d6 <+45>: mov %rax,%rdi 0x00005555555551d9 <+48>: mov $0x0,%eax 0x00005555555551de <+53>: call 0x555555555080 <printf@plt> 0x00005555555551e3 <+58>: lea -0x30(%rbp),%rax 0x00005555555551e7 <+62>: add $0x4,%rax 0x00005555555551eb <+66>: mov %rax,%rsi 0x00005555555551ee <+69>: lea 0xe16(%rip),%rax # 0x55555555600b 0x00005555555551f5 <+76>: mov %rax,%rdi 0x00005555555551f8 <+79>: mov $0x0,%eax 0x00005555555551fd <+84>: call 0x555555555080 <printf@plt> 0x0000555555555202 <+89>: lea -0x30(%rbp),%rax 0x0000555555555206 <+93>: add $0x4,%rax 0x000055555555520a <+97>: mov %rax,%rsi 0x000055555555520d <+100>: lea 0xe02(%rip),%rax # 0x555555556016 0x0000555555555214 <+107>: mov %rax,%rdi 0x0000555555555217 <+110>: mov $0x0,%eax 0x000055555555521c <+115>: call 0x555555555080 <printf@plt> 0x0000555555555221 <+120>: mov -0x20(%rbp),%rax 0x0000555555555225 <+124>: mov %rax,%rsi 0x0000555555555228 <+127>: lea 0xdf5(%rip),%rax # 0x555555556024 0x000055555555522f <+134>: mov %rax,%rdi 0x0000555555555232 <+137>: mov $0x0,%eax 0x0000555555555237 <+142>: call 0x555555555080 <printf@plt> 0x000055555555523c <+147>: lea -0x30(%rbp),%rax 0x0000555555555240 <+151>: add $0x4,%rax 0x0000555555555244 <+155>: mov %rax,-0x20(%rbp) 0x0000555555555248 <+159>: mov -0x20(%rbp),%rax 0x000055555555524c <+163>: mov %rax,%rsi 0x000055555555524f <+166>: lea 0xdce(%rip),%rax # 0x555555556024 0x0000555555555256 <+173>: mov %rax,%rdi 0x0000555555555259 <+176>: mov $0x0,%eax 0x000055555555525e <+181>: call 0x555555555080 <printf@plt> 0x0000555555555263 <+186>: mov $0x0,%eax 0x0000555555555268 <+191>: mov -0x8(%rbp),%rdx 0x000055555555526c <+195>: sub %fs:0x28,%rdx 0x0000555555555275 <+204>: je 0x55555555527c <main()+211> 0x0000555555555277 <+206>: call 0x5555555550a0 <__stack_chk_fail@plt> 0x000055555555527c <+211>: leave 0x000055555555527d <+212>: ret End of assembler dump. (gdb) f #0 main () at test_v2.cpp:15 15 printf("s: %s\n", st.s); (gdb) l 1 1 #include <iostream> 2 #include <stdio.h> 3 4 using namespace std; 5 6 struct String { 7 int len; 8 char s[10]; 9 char *p; 10 int length; (gdb) 11 }; 12 13 int main() { 14 String st; 15 printf("s: %s\n", st.s); 16 printf("s ptr: %p\n", st.s); 17 printf("(&s) ptr: %p\n", &(st.s)); 18 printf("p: %s\n", st.p); 19 st.p = st.s; 20 printf("p: %s\n", st.p); (gdb) 21 return 0; 22 } 23 (gdb) p st.s $1 = "\377\177\000\000\352\347\321\367\377\177" (gdb) p st.p $2 = 0x7ffff7e290c8 <std::wcout+8> "\370\063\342\367\377\177" (gdb) p &st.p $3 = (char **) 0x7fffffffe150 (gdb) p &st.s $4 = (char (*)[10]) 0x7fffffffe144 (gdb) x /10xb s No symbol "s" in current context. (gdb) x /10xb st.s 0x7fffffffe144: 0xff 0x7f 0x00 0x00 0xea 0xe7 0xd1 0xf7 0x7fffffffe14c: 0xff 0x7f (gdb) x /10xb st.p 0x7ffff7e290c8 <_ZSt5wcout+8>: 0xf8 0x33 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7ffff7e290d0 <_ZSt5wcout+16>: 0x06 0x00 (gdb) x /10xb &st.p 0x7fffffffe150: 0xc8 0x90 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe158: 0x88 0x8e (gdb) x /10xx &st.p 0x7fffffffe150: 0xc8 0x90 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe158: 0x88 0x8e (gdb) x /10xb &st.p 0x7fffffffe150: 0xc8 0x90 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe158: 0x88 0x8e (gdb) p st $5 = {len = -136147112, s = "\377\177\000\000\352\347\321\367\377\177", p = 0x7ffff7e290c8 <std::wcout+8> "\370\063\342\367\377\177", length = -136147320} (gdb) p &st $6 = (String *) 0x7fffffffe140 (gdb) p &st. len length p s (gdb) p &st. len length p s (gdb) p &st.len $7 = (int *) 0x7fffffffe140 (gdb) p &st.s $8 = (char (*)[10]) 0x7fffffffe144 (gdb) p &st.p $9 = (char **) 0x7fffffffe150 (gdb) p &st.length $10 = (int *) 0x7fffffffe158 (gdb) x /10xb st Value can't be converted to integer. (gdb) x /10xb &st 0x7fffffffe140: 0x58 0x8f 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe148: 0xea 0xe7 (gdb) p &st $11 = (String *) 0x7fffffffe140 (gdb) x /32xb 0x7fffffffe14a: 0xd1 0xf7 0xff 0x7f 0x00 0x00 0xc8 0x90 0x7fffffffe152: 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x88 0x8e 0x7fffffffe15a: 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x40 0x89 0x7fffffffe162: 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x00 0x18 (gdb) x /32xb &st 0x7fffffffe140: 0x58 0x8f 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe148: 0xea 0xe7 0xd1 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe150: 0xc8 0x90 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe158: 0x88 0x8e 0xe2 0xf7 0xff 0x7f 0x00 0x00 (gdb) p /x st.p $12 = 0x7ffff7e290c8 (gdb) p /x st.len $13 = 0xf7e28f58 (gdb) p /x st.s $14 = {0xff, 0x7f, 0x0, 0x0, 0xea, 0xe7, 0xd1, 0xf7, 0xff, 0x7f} (gdb) p st.s $15 = "\377\177\000\000\352\347\321\367\377\177" (gdb) p st.s /x No symbol "x" in current context. (gdb) p /x st.s $16 = {0xff, 0x7f, 0x0, 0x0, 0xea, 0xe7, 0xd1, 0xf7, 0xff, 0x7f} (gdb) p /x &st.p $17 = 0x7fffffffe150 (gdb) x /64xb &st 0x7fffffffe140: 0x58 0x8f 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe148: 0xea 0xe7 0xd1 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe150: 0xc8 0x90 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe158: 0x88 0x8e 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe160: 0x40 0x89 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe168: 0x00 0x18 0xaf 0x66 0xb1 0xde 0xe5 0xa6 0x7fffffffe170: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x7fffffffe178: 0x90 0x9d 0x82 0xf7 0xff 0x7f 0x00 0x00 (gdb) l 1 1 #include <iostream> 2 #include <stdio.h> 3 4 using namespace std; 5 6 struct String { 7 int len; 8 char s[10]; 9 char *p; 10 int length; (gdb) p /x len No symbol "len" in current context. (gdb) p /x st.len $18 = 0xf7e28f58 (gdb) p /x s No symbol "s" in current context. (gdb) p /x st.x There is no member named x. (gdb) p /x st.s $19 = {0xff, 0x7f, 0x0, 0x0, 0xea, 0xe7, 0xd1, 0xf7, 0xff, 0x7f} (gdb) p /x st.p $20 = 0x7ffff7e290c8 (gdb) p /x st.p $21 = 0x7ffff7e290c8 (gdb) p /x st.p $22 = 0x7ffff7e290c8 (gdb) p /x st.s $23 = {0xff, 0x7f, 0x0, 0x0, 0xea, 0xe7, 0xd1, 0xf7, 0xff, 0x7f} (gdb) set st.p=st.s (gdb) x /64xb &st 0x7fffffffe140: 0x58 0x8f 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe148: 0xea 0xe7 0xd1 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe150: 0x44 0xe1 0xff 0xff 0xff 0x7f 0x00 0x00 0x7fffffffe158: 0x88 0x8e 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe160: 0x40 0x89 0xe2 0xf7 0xff 0x7f 0x00 0x00 0x7fffffffe168: 0x00 0x18 0xaf 0x66 0xb1 0xde 0xe5 0xa6 0x7fffffffe170: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x7fffffffe178: 0x90 0x9d 0x82 0xf7 0xff 0x7f 0x00 0x00 (gdb) p /x st.p $24 = 0x7fffffffe144 (gdb) p /x &st.s $25 = 0x7fffffffe144 (gdb) p /x *st.p $26 = 0xff (gdb) p /x st.length $27 = 0xf7e28e88 (gdb) set st.p = &st.s (gdb) p /x st.p $28 = 0x7fffffffe144 (gdb) q A debugging session is active.
Inferior 1 [process 29494] will be killed.
Quit anyway? (y or n) y
|