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

Side by Side Diff: gdb/dwarf2-frame-tailcall.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 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 | « gdb/dwarf2-frame.c ('k') | gdb/dwarf2expr.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Virtual tail call frames unwinder for GDB. 1 /* Virtual tail call frames unwinder for GDB.
2 2
3 Copyright (C) 2010-2012 Free Software Foundation, Inc. 3 Copyright (C) 2010-2012 Free Software Foundation, Inc.
4 4
5 This file is part of GDB. 5 This file is part of GDB.
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or 9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 229 }
230 230
231 /* Find PC to be unwound from THIS_FRAME. THIS_FRAME must be a part of 231 /* Find PC to be unwound from THIS_FRAME. THIS_FRAME must be a part of
232 CACHE. */ 232 CACHE. */
233 233
234 static CORE_ADDR 234 static CORE_ADDR
235 pretend_pc (struct frame_info *this_frame, struct tailcall_cache *cache) 235 pretend_pc (struct frame_info *this_frame, struct tailcall_cache *cache)
236 { 236 {
237 int next_levels = existing_next_levels (this_frame, cache); 237 int next_levels = existing_next_levels (this_frame, cache);
238 struct call_site_chain *chain = cache->chain; 238 struct call_site_chain *chain = cache->chain;
239 int caller_no;
240 239
241 gdb_assert (chain != NULL); 240 gdb_assert (chain != NULL);
242 241
243 next_levels++; 242 next_levels++;
244 gdb_assert (next_levels >= 0); 243 gdb_assert (next_levels >= 0);
245 244
246 if (next_levels < chain->callees) 245 if (next_levels < chain->callees)
247 return chain->call_site[chain->length - next_levels - 1]->pc; 246 return chain->call_site[chain->length - next_levels - 1]->pc;
248 next_levels -= chain->callees; 247 next_levels -= chain->callees;
249 248
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 call frames frame base to get the SP value there - to simulate return 359 call frames frame base to get the SP value there - to simulate return
361 address pushed on the stack. */ 360 address pushed on the stack. */
362 361
363 void 362 void
364 dwarf2_tailcall_sniffer_first (struct frame_info *this_frame, 363 dwarf2_tailcall_sniffer_first (struct frame_info *this_frame,
365 void **tailcall_cachep, 364 void **tailcall_cachep,
366 const LONGEST *entry_cfa_sp_offsetp) 365 const LONGEST *entry_cfa_sp_offsetp)
367 { 366 {
368 CORE_ADDR prev_pc = 0, prev_sp = 0; /* GCC warning. */ 367 CORE_ADDR prev_pc = 0, prev_sp = 0; /* GCC warning. */
369 int prev_sp_p = 0; 368 int prev_sp_p = 0;
370 CORE_ADDR this_pc, pc; 369 CORE_ADDR this_pc;
371 struct gdbarch *prev_gdbarch; 370 struct gdbarch *prev_gdbarch;
372 struct call_site_chain *chain = NULL; 371 struct call_site_chain *chain = NULL;
373 struct frame_info *fi;
374 struct tailcall_cache *cache; 372 struct tailcall_cache *cache;
375 volatile struct gdb_exception except; 373 volatile struct gdb_exception except;
376 374
377 gdb_assert (*tailcall_cachep == NULL); 375 gdb_assert (*tailcall_cachep == NULL);
378 376
379 this_pc = get_frame_pc (this_frame); 377 this_pc = get_frame_pc (this_frame);
380 378
381 /* Catch any unwinding errors. */ 379 /* Catch any unwinding errors. */
382 TRY_CATCH (except, RETURN_MASK_ERROR) 380 TRY_CATCH (except, RETURN_MASK_ERROR)
383 { 381 {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 466
469 /* Provide a prototype to silence -Wmissing-prototypes. */ 467 /* Provide a prototype to silence -Wmissing-prototypes. */
470 extern initialize_file_ftype _initialize_tailcall_frame; 468 extern initialize_file_ftype _initialize_tailcall_frame;
471 469
472 void 470 void
473 _initialize_tailcall_frame (void) 471 _initialize_tailcall_frame (void)
474 { 472 {
475 cache_htab = htab_create_alloc (50, cache_hash, cache_eq, NULL, xcalloc, 473 cache_htab = htab_create_alloc (50, cache_hash, cache_eq, NULL, xcalloc,
476 xfree); 474 xfree);
477 } 475 }
OLDNEW
« no previous file with comments | « gdb/dwarf2-frame.c ('k') | gdb/dwarf2expr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698