Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: gdb/frame.c

Issue 22399003: Fix finish command for PNaCl. (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 const uint32_t max_addr = (uint32_t) -1;
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 /* Hack for PNaCl support. Due to base address hiding
466 stack_addr may differ by base address. This creates false
467 positives for normal 64-bit mode, so we need to find a better way. */
468 else if ((l.stack_addr != r.stack_addr && l.stack_addr > max_addr
469 » && r.stack_addr > max_addr)
470 » || (uint32_t)l.stack_addr != (uint32_t)r.stack_addr)
eaeltsin 2013/08/07 18:03:38 Do we have any way to figure out we are in NaCl vs
465 /* If .stack addresses are different, the frames are different. */ 471 /* If .stack addresses are different, the frames are different. */
466 eq = 0; 472 eq = 0;
467 else if (l.code_addr_p && r.code_addr_p && l.code_addr != r.code_addr) 473 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 474 /* An invalid code addr is a wild card. If .code addresses are
469 different, the frames are different. */ 475 different, the frames are different. */
470 eq = 0; 476 eq = 0;
471 else if (l.special_addr_p && r.special_addr_p 477 else if (l.special_addr_p && r.special_addr_p
472 && l.special_addr != r.special_addr) 478 && l.special_addr != r.special_addr)
473 /* An invalid special addr is a wild card (or unused). Otherwise 479 /* An invalid special addr is a wild card (or unused). Otherwise
474 if special addresses are different, the frames are different. */ 480 if special addresses are different, the frames are different. */
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 2513
2508 /* Debug this files internals. */ 2514 /* Debug this files internals. */
2509 add_setshow_zinteger_cmd ("frame", class_maintenance, &frame_debug, _("\ 2515 add_setshow_zinteger_cmd ("frame", class_maintenance, &frame_debug, _("\
2510 Set frame debugging."), _("\ 2516 Set frame debugging."), _("\
2511 Show frame debugging."), _("\ 2517 Show frame debugging."), _("\
2512 When non-zero, frame specific internal debugging is enabled."), 2518 When non-zero, frame specific internal debugging is enabled."),
2513 NULL, 2519 NULL,
2514 show_frame_debug, 2520 show_frame_debug,
2515 &setdebuglist, &showdebuglist); 2521 &setdebuglist, &showdebuglist);
2516 } 2522 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698