From 497904917aff304efcc0079d989ea27a5b92292c Mon Sep 17 00:00:00 2001 From: Bili Dong Date: Tue, 3 Sep 2024 09:30:29 -0700 Subject: [PATCH] Update namespace usage in .gdbinit (#4895) Addresses https://github.com/p4lang/p4c/issues/4707#issuecomment-2299475531. Signed-off-by: Bili Dong --- .gdbinit | 60 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.gdbinit b/.gdbinit index 0511f984c7c..2e6e87d7984 100755 --- a/.gdbinit +++ b/.gdbinit @@ -6,52 +6,52 @@ set unwind-on-terminating-exception on set python print-stack full if $_isvoid($bpnum) - break ErrorReporter::emit_message + break P4::ErrorReporter::emit_message disable - break Util::P4CExceptionBase::P4CExceptionBase<> - break Util::P4CExceptionBase::traceCreation - break BaseCompileContext::getDefaultErrorDiagnosticAction + break P4::Util::P4CExceptionBase::P4CExceptionBase<> + break P4::Util::P4CExceptionBase::traceCreation + break P4::BaseCompileContext::getDefaultErrorDiagnosticAction end define pn if $argc == 2 - call ::dbprint($arg0 $arg1) + call P4::dbprint($arg0 $arg1) else - call ::dbprint($arg0) + call P4::dbprint($arg0) end end document pn - print a IR::Node pointer + print a P4::IR::Node pointer end define d if $argc == 2 - call ::dump($arg0 $arg1) + call P4::dump($arg0 $arg1) else - call ::dump($arg0) + call P4::dump($arg0) end end document d - dump IR::Node tree or Visitor::Context + dump P4::IR::Node tree or Visitor::Context end define dnt if $argc == 2 - call ::dump_notype($arg0 $arg1) + call P4::dump_notype($arg0 $arg1) else - call ::dump_notype($arg0) + call P4::dump_notype($arg0) end end document dnt - dump IR::Node tree, skipping 'type' fields + dump P4::IR::Node tree, skipping 'type' fields end define dsrc if $argc == 2 - call ::dump_src($arg0 $arg1) + call P4::dump_src($arg0 $arg1) else - call ::dump_src($arg0) + call P4::dump_src($arg0) end end document dsrc - dump IR::Node tree, skipping 'type' fields, and printing source info + dump P4::IR::Node tree, skipping 'type' fields, and printing source info end python @@ -99,7 +99,7 @@ def lookup_type(typename): return tp class ordered_map_Printer: - "Print an ordered_map<>" + "Print an P4::ordered_map<>" def __init__(self, val): self.val = val self.args = template_split(val.type.tag) @@ -125,7 +125,7 @@ class ordered_map_Printer: self.val['data']['_M_impl']['_M_node'].address) class ordered_set_Printer: - "Print an ordered_set<>" + "Print an P4::ordered_set<>" def __init__(self, val): self.val = val self.args = template_split(val.type.tag) @@ -161,7 +161,7 @@ class ordered_set_Printer: self.val['data']['_M_impl']['_M_node'].address) class cstringPrinter(object): - "Print a cstring" + "Print a P4::cstring" def __init__(self, val): self.val = val def to_string(self): @@ -171,7 +171,7 @@ class cstringPrinter(object): return "nullptr" class SourceInfoPrinter(object): - "Print a Util::SourceInfo" + "Print a P4::Util::SourceInfo" def __init__(self, val): self.val = val def to_string(self): @@ -181,7 +181,7 @@ class SourceInfoPrinter(object): str(self.val['end']['columnNumber'])) class bitvecPrinter(object): - "Print a bitvec" + "Print a P4::bitvec" def __init__(self, val): self.val = val def to_string(self): @@ -227,7 +227,7 @@ def vec_at(vec, i): return (vec_begin(vec) + i).dereference() class safe_vector_Printer: - "Print a safe_vector<>" + "Print a P4::safe_vector<>" def __init__(self, val): self.val = val def to_string(self): @@ -256,7 +256,7 @@ def bvec_size(vec): return sz class safe_vector_bool_Printer: - "Print a safe_vector" + "Print a P4::safe_vector" def __init__(self, val): self.val = val def to_string(self): @@ -287,19 +287,19 @@ class safe_vector_bool_Printer: return self._iter(self.val) def find_pp(val): - if str(val.type.tag).startswith('ordered_map<'): + if str(val.type.tag).startswith('P4::ordered_map<'): return ordered_map_Printer(val) - if str(val.type.tag).startswith('ordered_set<'): + if str(val.type.tag).startswith('P4::ordered_set<'): return ordered_set_Printer(val) - if str(val.type.tag).startswith('safe_vector