Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Cache and manage frames for GDB, the GNU debugger. | 1 /* Cache and manage frames for GDB, the GNU debugger. |
| 2 | 2 |
| 3 Copyright (C) 1986-1987, 1989, 1991, 1994-1996, 1998, 2000-2004, | 3 Copyright (C) 1986-1987, 1989, 1991, 1994-1996, 1998, 2000-2004, |
| 4 2007-2012 Free Software Foundation, Inc. | 4 2007-2012 Free Software Foundation, Inc. |
| 5 | 5 |
| 6 This file is part of GDB. | 6 This file is part of GDB. |
| 7 | 7 |
| 8 This program is free software; you can redistribute it and/or modify | 8 This program is free software; you can redistribute it and/or modify |
| 9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
| 10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 441 if (!frame_id_p (l)) | 441 if (!frame_id_p (l)) |
| 442 return 0; | 442 return 0; |
| 443 | 443 |
| 444 return (l.inline_depth != 0); | 444 return (l.inline_depth != 0); |
| 445 } | 445 } |
| 446 | 446 |
| 447 int | 447 int |
| 448 frame_id_eq (struct frame_id l, struct frame_id r) | 448 frame_id_eq (struct frame_id l, struct frame_id r) |
| 449 { | 449 { |
| 450 int eq; | 450 int eq; |
| 451 uint32_t max_addr = (uint32_t) -1; | |
|
eaeltsin
2013/08/06 18:14:42
const or #define?
if you use this for &, then eit
halyavin
2013/08/07 08:04:25
I used conversion instead of &.
| |
| 451 | 452 |
| 452 if (!l.stack_addr_p && l.special_addr_p | 453 if (!l.stack_addr_p && l.special_addr_p |
| 453 && !r.stack_addr_p && r.special_addr_p) | 454 && !r.stack_addr_p && r.special_addr_p) |
| 454 /* The outermost frame marker is equal to itself. This is the | 455 /* The outermost frame marker is equal to itself. This is the |
| 455 dodgy thing about outer_frame_id, since between execution steps | 456 dodgy thing about outer_frame_id, since between execution steps |
| 456 we might step into another function - from which we can't | 457 we might step into another function - from which we can't |
| 457 unwind either. More thought required to get rid of | 458 unwind either. More thought required to get rid of |
| 458 outer_frame_id. */ | 459 outer_frame_id. */ |
| 459 eq = 1; | 460 eq = 1; |
| 460 else if (!l.stack_addr_p || !r.stack_addr_p) | 461 else if (!l.stack_addr_p || !r.stack_addr_p) |
| 461 /* Like a NaN, if either ID is invalid, the result is false. | 462 /* Like a NaN, if either ID is invalid, the result is false. |
| 462 Note that a frame ID is invalid iff it is the null frame ID. */ | 463 Note that a frame ID is invalid iff it is the null frame ID. */ |
| 463 eq = 0; | 464 eq = 0; |
| 464 else if (l.stack_addr != r.stack_addr) | 465 else if ((l.stack_addr != r.stack_addr && l.stack_addr > max_addr |
| 466 » && r.stack_addr > max_addr) | |
| 467 » || (l.stack_addr & max_addr) != (r.stack_addr & max_addr)) | |
|
eaeltsin
2013/08/06 18:14:42
This definitely needs a comment, explaining what t
halyavin
2013/08/07 08:04:25
One value is read from the stack, the other is rea
| |
| 465 /* If .stack addresses are different, the frames are different. */ | 468 /* If .stack addresses are different, the frames are different. */ |
| 466 eq = 0; | 469 eq = 0; |
| 467 else if (l.code_addr_p && r.code_addr_p && l.code_addr != r.code_addr) | 470 else if (l.code_addr_p && r.code_addr_p && l.code_addr != r.code_addr) |
| 468 /* An invalid code addr is a wild card. If .code addresses are | 471 /* An invalid code addr is a wild card. If .code addresses are |
| 469 different, the frames are different. */ | 472 different, the frames are different. */ |
| 470 eq = 0; | 473 eq = 0; |
| 471 else if (l.special_addr_p && r.special_addr_p | 474 else if (l.special_addr_p && r.special_addr_p |
| 472 && l.special_addr != r.special_addr) | 475 && l.special_addr != r.special_addr) |
| 473 /* An invalid special addr is a wild card (or unused). Otherwise | 476 /* An invalid special addr is a wild card (or unused). Otherwise |
| 474 if special addresses are different, the frames are different. */ | 477 if special addresses are different, the frames are different. */ |
| (...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2507 | 2510 |
| 2508 /* Debug this files internals. */ | 2511 /* Debug this files internals. */ |
| 2509 add_setshow_zinteger_cmd ("frame", class_maintenance, &frame_debug, _("\ | 2512 add_setshow_zinteger_cmd ("frame", class_maintenance, &frame_debug, _("\ |
| 2510 Set frame debugging."), _("\ | 2513 Set frame debugging."), _("\ |
| 2511 Show frame debugging."), _("\ | 2514 Show frame debugging."), _("\ |
| 2512 When non-zero, frame specific internal debugging is enabled."), | 2515 When non-zero, frame specific internal debugging is enabled."), |
| 2513 NULL, | 2516 NULL, |
| 2514 show_frame_debug, | 2517 show_frame_debug, |
| 2515 &setdebuglist, &showdebuglist); | 2518 &setdebuglist, &showdebuglist); |
| 2516 } | 2519 } |
| OLD | NEW |